"Error reading settings file" while trying simple project with maven plugin


(Justin Ryan) #1

My goal is to create a parent POM as part of a bigger multi-module build. I was having trouble with it, so I simplified it and I still get an error. If I add the java plugin, it’ll run but it’ll also take over package type which I need to be “pom”. Here’s the error:

jryan:parent$ ../gradlew uploadArchives
:uploadArchives
[ant:null] Error reading settings file '/var/folders/44/lyp59ywhj4l0hbn2q633q0ww0009sb/T/gradle_empty_settings8855699673800409157.xml' - ignoring. Error was: /var/folders/44/lyp59ywhj4l0hbn2q633q0ww0009sb/T/gradle_empty_settings8855699673800409157.xml (No such file or directory)

My project build.gradle is below and it’s very similar the the documentation examples:

apply plugin: 'maven'
      uploadArchives {
        repositories.mavenDeployer {
            repository(url: "file://localhost/${rootProject.rootDir}/repo")
        }
    }

I’m also finding that this simple use of the maven plugin does not add the “install” task, like it used it and as it is specified in the documentation. I’m using m8.


(Peter Niederwieser) #2

Please provide the output of ‘gradlew -v’ and ‘gradlew -s uploadArchives’. The Maven plugin only adds an ‘install’ task for projects that have the Java plugin applied. Gradle can’t currently help you much with creating a parent POM. I’d consider creating it by hand (or with Groovy scripting means) and adding it to the ‘archives’ configuration for publication.


(Justin Ryan) #3

Thanks. I can see how MavenPlugin only adds the install task to projects with the Java plugin, not exactly intuitive. Just creating the POM by hand probably is the best way, thanks again. Oh by the way, here’s the output from -v and -s uploadArchives (note, no stack trace is shown)

------------------------------------------------------------
Gradle 1.0-milestone-8
------------------------------------------------------------
  Gradle build time: Monday, February 13, 2012 11:53:32 PM UTC
Groovy: 1.8.4
Ant: Apache Ant(TM) version 1.8.2 compiled on December 20 2010
Ivy: 2.2.0
JVM: 1.6.0_29 (Apple Inc. 20.4-b02-402)
OS: Mac OS X 10.7.2 x86_64
lgmac-jryan2:curator-parent jryan$ ../gradlew -b error.gradle -s uploadArchives
:uploadArchives
[ant:null] Error reading settings file '/var/folders/44/lyp59ywhj4l0hbn2q633q0ww0009sb/T/gradle_empty_settings8030818672837693956.xml' - ignoring. Error was: /var/folders/44/lyp59ywhj4l0hbn2q633q0ww0009sb/T/gradle_empty_settings8030818672837693956.xml (No such file or directory)
  BUILD SUCCESSFUL
  Total time: 2.366 secs

(Yennick Trevels) #4

Hi,

I’m getting the exact same error with Gradle RC3.

gradlew -v: ------------------------------------------------------------ Gradle 1.0-rc-3 ------------------------------------------------------------

Gradle build time: zondag 29 april 2012 23.51 u. UTC Groovy: 1.8.6 Ant: Apache Ant™ version 1.8.2 compiled on December 20 2010 Ivy: 2.2.0 JVM: 1.6.0_20 (Sun Microsystems Inc. 16.3-b01) OS: Windows 7 6.1 x86

gradlew -s uploadArchives: :buildSrc:compileJava UP-TO-DATE :buildSrc:compileGroovy UP-TO-DATE :buildSrc:processResources UP-TO-DATE :buildSrc:classes UP-TO-DATE :buildSrc:jar UP-TO-DATE :buildSrc:assemble UP-TO-DATE :buildSrc:compileTestJava UP-TO-DATE :buildSrc:compileTestGroovy UP-TO-DATE :buildSrc:processTestResources UP-TO-DATE :buildSrc:testClasses UP-TO-DATE :buildSrc:test UP-TO-DATE :buildSrc:check UP-TO-DATE :buildSrc:build UP-TO-DATE :uploadArchives [ant:null] Error reading settings file ‘D:\Users\Yennick\AppData\Local\Temp\gradle_empty_settings2874847193636193111.xml’ - ignoring. Error was: D:\Us ers\Yennick\AppData\Local\Temp\gradle_empty_settings2874847193636193111.xml (The system cannot find the file specified)

Anyone has found a solution for this issue?


(Ben Jansen) #5

I just spent a long time debugging the “cannot find the file” gradle_empty_settings problem. In my case, it turned out to simply be a terrible way of saying, “The artifacts you have defined don’t exist on the filesystem.”


(o.groulx) #6

What should I do to define the artifact?


(Yennick Trevels) #7

You can define artifacts like this:

artifacts {

archives someFile

}

But GradleFx does this for you when you compile your application.


(Yennick Trevels) #8

@bjansen You’re right, it was indeed a missing artifact problem, thanks!


(robert.j.lloyd) #9

Is there any reason why this error doesn’t cause a failure in the build? Just curious, as I can see it both ways (“no file to upload? -> UP-TO-DATE interpretation”, or “no file to upload? -> something’s wrong!”)

Thoughts?