# uploadArchives task in cpp project publishes nothing

**URL:** <https://discuss.gradle.org/t/uploadarchives-task-in-cpp-project-publishes-nothing/5620>\
**Category:** Old Forum Archive\
**Created:** [September 4, 2013, 10:16pm UTC](https://discuss.gradle.org/t/uploadarchives-task-in-cpp-project-publishes-nothing/5620 "2013-09-04T22:16:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Steven\_Emmerson](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/steven_emmerson/32/439_2.png) [@Steven\_Emmerson](https://discuss.gradle.org/u/Steven_Emmerson)\
**Post date:** [September 4, 2013, 10:16pm UTC](https://discuss.gradle.org/t/uploadarchives-task-in-cpp-project-publishes-nothing/5620/1 "2013-09-04T22:16:00Z")

</div>

The ‘uploadArchives’ task of my ‘cpp’ project doesn’t publish anything. Here’s the build-file:

apply plugin: ‘cpp’

version = ‘2.1.25’

sources {

lib {

c {

source {

srcDirs = [“src/lib”]

include “\*.c”

exclude “scanner.c”, “test\*.c”

}

exportedHeaders {

srcDirs = [“src/lib”]

include “udunits.h”

include “udunits2.h”

include “converter.h”

}

}

}

exe {

c {

source {

srcDirs = [“src/prog”]

include “\*.c”

}

}

}

}

libraries {

udunits2 {

source sources.lib

binaries.all {

compilerArgs “-DDEFAULT\_UDUNITS2\_XML\_PATH=”${projectDir}" +

‘/share/udunits/udunits2.xml"’

}

}

}

executables {

udunits2 {

source sources.exe

binaries.all {

lib libraries.udunits2.shared

compilerArgs “-I” + projectDir.toString() + “/src/lib”

linkerArgs “-lexpat”

}

}

}

apply plugin: ‘maven’

uploadArchives {

repositories {

mavenDeployer {

repository(url: uri("${buildDir}/repo"))

}

}

}

task wrapper(type: Wrapper) {

gradleVersion = “1.9-20130903235553+0000”

}

And here’s the output:

~/udunits2: ./gradlew --no-daemon --info --build-file problem.gradle uploadArchives

Starting Build

Settings evaluated using empty settings script.

Projects loaded. Root project using build file ‘/home/steve/udunits2/problem.gradle’.

Included projects: [root project ‘udunits2’]

Evaluating root project ‘udunits2’ using build file ‘/home/steve/udunits2/problem.gradle’.

Starting process ‘command ‘/usr/bin/g++’’. Working directory: /usr/bin Command: /usr/bin/g++ -v

An attempt to initialize for well behaving parent process finished.

Successfully started process ‘command ‘/usr/bin/g++’’

Process ‘command ‘/usr/bin/g++’’ finished with exit value 0 (state: SUCCEEDED)

Found C++ compiler with version 4.5.1

All projects evaluated.

Selected primary task ‘uploadArchives’

Tasks to be executed: [task ‘:uploadArchives’]

:uploadArchives (Thread[main,5,main]) started.

:uploadArchives

Executing task ‘:uploadArchives’ (up-to-date check took 0.0 secs) due to:

Task has not declared any outputs.

Publishing configuration: configuration ‘:archives’

Publishing to repository ‘mavenDeployer’

[ant:null] Error reading settings file ‘/tmp/gradle\_empty\_settings6251621177122270207.xml’ - ignoring. Error was:

/tmp/gradle\_empty\_settings6251621177122270207.xml (No such file or directory)

:uploadArchives (Thread[main,5,main]) completed. Took 0.77 secs.

BUILD SUCCESSFUL

Total time: 6.098 secs

~/udunits2: ls build/repo

ls: cannot access build/repo: No such file or directory

I assume I’m doing something stupid, but what is it?

---

<div class="post-metadata">

**Author:** ![Peter\_Niederwieser](https://avatars.discourse-cdn.com/v4/letter/p/9f8e36/32.png) [@Peter\_Niederwieser](https://discuss.gradle.org/u/Peter_Niederwieser)\
**Post date:** [September 5, 2013, 12:31am UTC](https://discuss.gradle.org/t/uploadarchives-task-in-cpp-project-publishes-nothing/5620/2 "2013-09-05T00:31:00Z")

</div>

I think you’ll need at least an ‘archives’ block, telling it which artifacts to publish (see upload chapter in [Gradle User Guide](http://gradle.org/docs/current/userguide/userguide_single.html)).

---

<div class="post-metadata">

**Author:** ![Steven\_Emmerson](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/steven_emmerson/32/439_2.png) [@Steven\_Emmerson](https://discuss.gradle.org/u/Steven_Emmerson)\
**Post date:** [September 6, 2013, 5:16pm UTC](https://discuss.gradle.org/t/uploadarchives-task-in-cpp-project-publishes-nothing/5620/3 "2013-09-06T17:16:00Z")

</div>

I thought the “cpp” plugin automatically configured the artifacts to be published (see [http://www.gradle.org/docs/current/userguide/userguide\_single.html#cppPublish](http://www.gradle.org/docs/current/userguide/userguide_single.html#cppPublish)). I’ll try your suggestion, however.

---

<div class="post-metadata">

**Author:** ![daz](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/daz/32/2475_2.png) [@daz](https://discuss.gradle.org/u/daz)\
**Post date:** [September 8, 2013, 11:55pm UTC](https://discuss.gradle.org/t/uploadarchives-task-in-cpp-project-publishes-nothing/5620/4 "2013-09-08T23:55:00Z")

</div>

Automatic artifact configuration is only done by the conventional ‘cpp-lib’ and ‘cpp-exe’ plugins.
