Gradle

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What’s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
To raise new issues or bugs against Gradle, please use forums.gradle.org.
  • Gradle
  • GRADLE-1114

Cannot upload: POM does not validate

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Open Open
  • Resolution: Unresolved
  • Affects Version/s: 0.9
  • Fix Version/s: None

Description

I've got a pretty straightforward upload process, but it won't upload because the POM apparently won't validate. However, it seems valid to me, and it's generated pretty directly. I've attached the POM and the relevant files from the build directory.

FAILURE: Build failed with an exception.

  • Where:
    Build file '/Users/robert/wkdir/ashlar/runtime/build.gradle'
  • What went wrong:
    Execution failed for task ':runtime:uploadArchives'.
    Cause: Could not publish configurations [configuration ':runtime:archives'].
  • Try:
    Run with -S option to get the full (very verbose) stacktrace.
  • Exception is:
    org.gradle.api.tasks.LocationAwareTaskExecutionException: Build file '/Users/robert/wkdir/ashlar/runtime/build.gradle'
    Execution failed for task ':runtime:uploadArchives'.
    at org.gradle.api.internal.tasks.DefaultTaskExecuter.executeActions(DefaultTaskExecuter.java:63)
    at org.gradle.api.internal.tasks.DefaultTaskExecuter.execute(DefaultTaskExecuter.java:41)
    at org.gradle.api.internal.project.taskfactory.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:32)
    at org.gradle.api.internal.project.taskfactory.ExecutionShortCircuitTaskExecuter.execute(ExecutionShortCircuitTaskExecuter.java:50)
    at org.gradle.api.internal.tasks.SkipTaskExecuter.doExecute(SkipTaskExecuter.java:57)
    at org.gradle.api.internal.tasks.SkipTaskExecuter.execute(SkipTaskExecuter.java:35)
    at org.gradle.api.internal.tasks.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:32)
    at org.gradle.api.internal.AbstractTask.execute(AbstractTask.java:231)
    at org.gradle.execution.DefaultTaskGraphExecuter.executeTask(DefaultTaskGraphExecuter.java:167)
    at org.gradle.execution.DefaultTaskGraphExecuter.doExecute(DefaultTaskGraphExecuter.java:160)
    at org.gradle.execution.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:78)
    at org.gradle.execution.TaskNameResolvingBuildExecuter.execute(TaskNameResolvingBuildExecuter.java:161)
    at org.gradle.execution.DelegatingBuildExecuter.execute(DelegatingBuildExecuter.java:54)
    at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:153)
    at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:107)
    at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:75)
    at org.gradle.launcher.Main.execute(Main.java:93)
    at org.gradle.launcher.Main.main(Main.java:42)
    at org.gradle.launcher.GradleMain.main(GradleMain.java:49)
    Caused by: org.gradle.api.GradleException: Could not publish configurations [configuration ':runtime:archives'].
    at org.gradle.api.internal.artifacts.ivyservice.ErrorHandlingIvyService.publish(ErrorHandlingIvyService.java:44)
    at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.publish(DefaultConfiguration.java:211)
    at org.gradle.api.tasks.Upload.upload(Upload.java:57)
    at org.gradle.api.internal.BeanDynamicObject.invokeMethod(BeanDynamicObject.java:158)
    at org.gradle.api.internal.CompositeDynamicObject.invokeMethod(CompositeDynamicObject.java:93)
    at org.gradle.api.tasks.Upload_Decorated.invokeMethod(Unknown Source)
    at org.gradle.util.ReflectionUtil.invoke(ReflectionUtil.groovy:23)
    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$2.execute(AnnotationProcessingTaskFactory.java:131)
    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$2.execute(AnnotationProcessingTaskFactory.java:129)
    at org.gradle.api.internal.tasks.DefaultTaskExecuter.executeActions(DefaultTaskExecuter.java:55)
    ... 18 common frames omitted
    Caused by: org.apache.tools.ant.BuildException: Unable to initialize POM pom-default.xml: Failed to validate POM for project ashlar:ashlar-runtime at /Users/robert/wkdir/ashlar/runtime/build/poms/pom-default.xml
    at org.apache.maven.artifact.ant.Pom.initialiseMavenProject(Pom.java:211)
    at org.apache.maven.artifact.ant.AbstractArtifactTask.initializePom(AbstractArtifactTask.java:528)
    at org.apache.maven.artifact.ant.InstallDeployTaskSupport.initializePom(InstallDeployTaskSupport.java:60)
    at org.apache.maven.artifact.ant.DeployTask.doExecute(DeployTask.java:100)
    at org.gradle.api.internal.artifacts.publish.maven.deploy.CustomDeployTask.doExecute(CustomDeployTask.java:42)
    at org.apache.maven.artifact.ant.AbstractArtifactTask.execute(AbstractArtifactTask.java:721)
    at org.gradle.api.internal.artifacts.publish.maven.deploy.AbstractMavenResolver.execute(AbstractMavenResolver.java:185)
    at org.gradle.api.internal.artifacts.publish.maven.deploy.AbstractMavenResolver.commitPublishTransaction(AbstractMavenResolver.java:176)
    at org.apache.ivy.core.publish.PublishEngine.publish(PublishEngine.java:262)
    at org.gradle.api.internal.artifacts.ivyservice.DefaultIvyDependencyPublisher.publish(DefaultIvyDependencyPublisher.java:54)
    at org.gradle.api.internal.artifacts.ivyservice.DefaultIvyService.publish(DefaultIvyService.java:144)
    at org.gradle.api.internal.artifacts.ivyservice.ShortcircuitEmptyConfigsIvyService.publish(ShortcircuitEmptyConfigsIvyService.java:61)
    at org.gradle.api.internal.artifacts.ivyservice.ErrorHandlingIvyService.publish(ErrorHandlingIvyService.java:42)
    ... 27 common frames omitted
    Caused by: org.apache.maven.project.InvalidProjectModelException: Failed to validate POM for project ashlar:ashlar-runtime at /Users/robert/wkdir/ashlar/runtime/build/poms/pom-default.xml
    at org.apache.maven.project.DefaultMavenProjectBuilder.processProjectLogic(DefaultMavenProjectBuilder.java:1077)
    at org.apache.maven.project.DefaultMavenProjectBuilder.buildInternal(DefaultMavenProjectBuilder.java:880)
    at org.apache.maven.project.DefaultMavenProjectBuilder.buildFromSourceFileInternal(DefaultMavenProjectBuilder.java:508)
    at org.apache.maven.project.DefaultMavenProjectBuilder.build(DefaultMavenProjectBuilder.java:200)
    at org.apache.maven.artifact.ant.Pom.initialiseMavenProject(Pom.java:207)
    ... 39 common frames omitted
  • Options
    • Sort By Name
    • Sort By Date
    • Ascending
    • Descending
    • Download All

Attachments

  1. File
    blaines_simplest_build.gradle
    16/Oct/11 4:05 PM
    1 kB
    Blaine Simpson
  2. File
    blaines_with_workarounds_build.gradle
    16/Oct/11 12:13 PM
    6 kB
    Blaine Simpson
  3. File
    build.gradle
    13/Aug/10 11:23 AM
    2 kB
    Robert Fischer
  4. Hide
    Zip Archive
    error.zip
    13/Aug/10 11:23 AM
    4.83 MB
    Robert Fischer
    1. File
      build.gradle 2 kB
    2. File
      gradle.properties 0.1 kB
    3. File
      lang/build/classes/.../lang/Prevalent.class 0.8 kB
    4. File
      lang/build/classes/.../lang/Unit.class 0.3 kB
    5. XML File
      lang/build/ivy.xml 1 kB
    6. Java Archive File
      lang/build/libs/lang-0.0.1-SNAPSHOT.jar 2 kB
    7. XML File
      lang/build/poms/pom-default.xml 0.4 kB
    8. File
      lang/build/tmp/jar/MANIFEST.MF 0.2 kB
    9. File
      lang/build.gradle.old 0.3 kB
    10. File
      lang/gradle.properties 0.0 kB
    11. Java Source File
      lang/src/main/.../ashlar/lang/Prevalent.java 0.4 kB
    12. Java Source File
      lang/src/main/java/ashlar/lang/Unit.java 0.1 kB
    13. File
      runtime/build/.../AshlarClass.class 0.3 kB
    14. File
      runtime/build/.../AshlarExecuteOnLoad.class 0.3 kB
    15. File
      runtime/build/.../ast/FinalAST$.class 1 kB
    16. File
      runtime/build/.../FinalAST$Expression$.class 2 kB
    17. File
      runtime/build/.../FinalAST$Expression.class 0.3 kB
    18. File
      runtime/.../FinalAST$ExpressionNode.class 1.0 kB
    19. File
      runtime/.../FinalAST$File$$anonfun$1.class 2 kB
    20. File
      runtime/build/.../ast/FinalAST$File.class 2 kB
    21. File
      runtime/.../FinalAST$FunctionCall$$anonfun$2.class 1 kB
    22. File
      runtime/.../FinalAST$FunctionCall.class 2 kB
    23. File
      runtime/build/.../FinalAST$Literal$.class 2 kB
    24. File
      runtime/build/.../ast/FinalAST$Literal.class 0.3 kB
    25. File
      runtime/build/.../FinalAST$LiteralNode.class 1 kB
    26. File
      runtime/build/.../ast/FinalAST$Node.class 0.9 kB
    27. File
      runtime/.../FinalAST$StringLiteral.class 1 kB
    28. File
      runtime/build/classes/.../ast/FinalAST.class 3 kB
    29. File
      runtime/build/classes/.../ast/RawAST$.class 3 kB
    30. File
      runtime/.../RawAST$DoubleQuoteString.class 1 kB
    Showing 30 of 215 items Download Zip
    Show
    Zip Archive
    error.zip
    13/Aug/10 11:23 AM
    4.83 MB
    Robert Fischer
  5. XML File
    pom-default.xml
    13/Aug/10 11:23 AM
    2 kB
    Robert Fischer

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • History
  • Activity
  • TeamCity
  • Commits
  • Source
  • Reviews
Hide
Permalink
Hans Dockter added a comment - 16/Aug/10 9:48 AM

The upload works for me if I use: repository(url: "file://localhost/tmp/robertRepo/") as a repository. Could you try this on your machine? One other thing I need to do differently was to use: compile files("/Users/hans/Downloads/cojen-2.2.1.jar", "/Users/hans/Downloads/trove-2.1.0a2/lib/trove-2.1.0a2.jar"), as they were not available from the defined repos.

For some reason I can't get a local ssh upload working to check if wagon-ssh is the culprit.

Show
Hans Dockter added a comment - 16/Aug/10 9:48 AM The upload works for me if I use: repository(url: "file://localhost/tmp/robertRepo/") as a repository. Could you try this on your machine? One other thing I need to do differently was to use: compile files("/Users/hans/Downloads/cojen-2.2.1.jar", "/Users/hans/Downloads/trove-2.1.0a2/lib/trove-2.1.0a2.jar"), as they were not available from the defined repos. For some reason I can't get a local ssh upload working to check if wagon-ssh is the culprit.
Hide
Permalink
lucas gray added a comment - 25/Feb/11 10:27 AM

I'm having the same issues, and I've narrowed it down to this: trying to deploy (ftp for me) to my local repository fails in this fashion when my project has dependencies that exist in the repository I'm publishing to. Unsure if the problem is simply because they're not in central, or if the problem is because of the 'circular-ness' of publishing to a repo that the dependencies come from.

Show
lucas gray added a comment - 25/Feb/11 10:27 AM I'm having the same issues, and I've narrowed it down to this: trying to deploy (ftp for me) to my local repository fails in this fashion when my project has dependencies that exist in the repository I'm publishing to. Unsure if the problem is simply because they're not in central, or if the problem is because of the 'circular-ness' of publishing to a repo that the dependencies come from.
Hide
Permalink
Blaine Simpson added a comment - 16/Oct/11 12:17 PM - edited

I am having this problem, and it persists after narrowing the test case drastically and eliminating the issues mentioned by Hans and Lucas about dependency availability and remote transfer protocols. My test case is a simple, non-nested project using only the Java and Maven plugins, attempting to publish to a local file repository, and it works perfectly well other than the Maven plugin features.

I don't know of a more simple way to try to do what the Maven Plugin chapter of the user guide says to do, and it totally is not working.

Attachment descriptions:

  • blaines_simplest_build.gradle: Stripped-down use case exhibiting uploadArchives abortion with "Failed to validate POM..."
  • blaines_with_workarounds_build.gradle: Same but with several attempted work-arounds including references to sources of work-arounds.

Update: Seems that a cache (I think the $HOME/.gradle one) was retaining some bad configs from an earlier attempt, because after wiping $HOME/.gradle and the project cache, uploadArchives is now working for me.

_

Show
Blaine Simpson added a comment - 16/Oct/11 12:17 PM - edited I am having this problem, and it persists after narrowing the test case drastically and eliminating the issues mentioned by Hans and Lucas about dependency availability and remote transfer protocols. My test case is a simple, non-nested project using only the Java and Maven plugins, attempting to publish to a local file repository, and it works perfectly well other than the Maven plugin features. I don't know of a more simple way to try to do what the Maven Plugin chapter of the user guide says to do, and it totally is not working. Attachment descriptions:
  • blaines_simplest_build.gradle: Stripped-down use case exhibiting uploadArchives abortion with "Failed to validate POM..."
  • blaines_with_workarounds_build.gradle: Same but with several attempted work-arounds including references to sources of work-arounds.
Update: Seems that a cache (I think the $HOME/.gradle one) was retaining some bad configs from an earlier attempt, because after wiping $HOME/.gradle and the project cache, uploadArchives is now working for me. _
Hide
Permalink
Stanford S. Guillory added a comment - 20/Aug/12 3:32 PM

I am experiencing the exact same symptoms when trying do deploy my artifacts to a Sonatype Nexus instance. Are there any plans to work on this defect in the near future? Thx

Show
Stanford S. Guillory added a comment - 20/Aug/12 3:32 PM I am experiencing the exact same symptoms when trying do deploy my artifacts to a Sonatype Nexus instance. Are there any plans to work on this defect in the near future? Thx
Hide
Permalink
Nick Spor added a comment - 29/Aug/12 10:49 AM

Hi, if you have any dependencies like this: testRuntime group: 'junit', name: 'junit', version: '4.8' ive found that it will throw this error, after removing these dependencies from the task that was calling uploadArchives the pom validated and the war/pom would upload successfully.

Show
Nick Spor added a comment - 29/Aug/12 10:49 AM Hi, if you have any dependencies like this: testRuntime group: 'junit', name: 'junit', version: '4.8' ive found that it will throw this error, after removing these dependencies from the task that was calling uploadArchives the pom validated and the war/pom would upload successfully.
Hide
Permalink
Erich Oswald added a comment - 04/Oct/12 4:47 AM

I got the same error when I tried to publish a project that included a dependency to a JAR file in a flatDir repository. In the generated POM the groupId and version for that dependency were missing (well, can hardly blame Gradle for that ). When I moved the dependency to our local Maven proxy, publishing worked.

Wouldn't it make sense if Gradle either ignored such incomplete dependencies when generating the pom-default.xml or at least gave a warning that it had to generate incomplete dependencies and the upload might fail?

Show
Erich Oswald added a comment - 04/Oct/12 4:47 AM I got the same error when I tried to publish a project that included a dependency to a JAR file in a flatDir repository. In the generated POM the groupId and version for that dependency were missing (well, can hardly blame Gradle for that ). When I moved the dependency to our local Maven proxy, publishing worked. Wouldn't it make sense if Gradle either ignored such incomplete dependencies when generating the pom-default.xml or at least gave a warning that it had to generate incomplete dependencies and the upload might fail?

People

  • Assignee:
    Unassigned
    Reporter:
    Robert Fischer
Vote (8)
Watch (6)

Dates

  • Created:
    13/Aug/10 11:23 AM
    Updated:
    04/Oct/12 4:47 AM
  • Atlassian JIRA (v5.0.3#729-sha1:bf569e4)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Gradle. Try JIRA - bug tracking software for your team.