Project

Profile

Help

Bug #5801

closed

Dependency on axiom pom causes maven-dependency-plugin error

Added by Robin Meade over 1 year ago. Updated about 1 year ago.

Status:
Closed
Priority:
Normal
Category:
-
Sprint/Milestone:
-
Start date:
2023-01-07
Due date:
% Done:

100%

Estimated time:
Legacy ID:
Applies to branch:
11, 12, trunk
Fix Committed on Branch:
11, 12, trunk
Fixed in Maintenance Release:
Platforms:
Java

Description

I don't think the Saxon-HE-11.4 pom should specify this dependency:

<dependency>
  <groupId>org.apache.ws.commons.axiom</groupId>
  <artifactId>axiom</artifactId>
  <version>1.2.15</version>
  <optional>true</optional>
</dependency>

because it serves only as a parent pom. (It's packaging is pom, not jar.)

Alternatively, add <type>pom</type> if you really want this as a dependency, add pom`:

<dependency>
  <groupId>org.apache.ws.commons.axiom</groupId>
  <artifactId>axiom</artifactId>
  <version>1.2.15</version>
  <optional>true</optional>
  <type>pom</type>
</dependency>

The way it is now causes errors when I use a recent version of the Maven Dependency Plugin:

To see the problem, try this:

$ mvn org.apache.maven.plugins:maven-dependency-plugin:2.10:get -Dartifact=net.sf.saxon:Saxon-HE:11.4
[INFO] Scanning for projects...
[INFO] 
[INFO] ------------------< org.apache.maven:standalone-pom >-------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] --------------------------------[ pom ]---------------------------------
[INFO] 
[INFO] --- maven-dependency-plugin:2.10:get (default-cli) @ standalone-pom ---
[INFO] Resolving net.sf.saxon:Saxon-HE:jar:11.4 with transitive dependencies
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  0.553 s
[INFO] Finished at: 2023-01-03T16:56:45-10:00
[INFO] ------------------------------------------------------------------------

The above invocation gave no error because, for some reason, the older version of the maven-dependency-plugin didn't attempt to download optional dependencies.

Now try a more recent version of the maven-dependency-plugin:

$ mvn org.apache.maven.plugins:maven-dependency-plugin:3.4.0:get -Dartifact=net.sf.saxon:Saxon-HE:11.4
[INFO] Scanning for projects...
[INFO] 
[INFO] ------------------< org.apache.maven:standalone-pom >-------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] --------------------------------[ pom ]---------------------------------
[INFO] 
[INFO] --- maven-dependency-plugin:3.4.0:get (default-cli) @ standalone-pom ---
[INFO] Resolving net.sf.saxon:Saxon-HE:jar:11.4 with transitive dependencies
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/ws/commons/axiom/axiom/1.2.15/axiom-1.2.15.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/ws/commons/axiom/axiom/1.2.15/axiom-1.2.15.pom (45 kB at 60 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/ws/commons/axiom/axiom-dom/1.2.15/axiom-dom-1.2.15.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/ws/commons/axiom/axiom-dom/1.2.15/axiom-dom-1.2.15.pom (5.3 kB at 36 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/ws/commons/axiom/implementations/1.2.15/implementations-1.2.15.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/ws/commons/axiom/implementations/1.2.15/implementations-1.2.15.pom (5.3 kB at 35 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/ws/commons/axiom/axiom-api/1.2.15/axiom-api-1.2.15.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/ws/commons/axiom/axiom-api/1.2.15/axiom-api-1.2.15.pom (16 kB at 107 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/ws/commons/axiom/axiom-impl/1.2.15/axiom-impl-1.2.15.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/ws/commons/axiom/axiom-impl/1.2.15/axiom-impl-1.2.15.pom (4.6 kB at 29 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/ws/commons/axiom/axiom/1.2.15/axiom-1.2.15.jar
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/ws/commons/axiom/axiom-dom/1.2.15/axiom-dom-1.2.15.jar
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/ws/commons/axiom/axiom-api/1.2.15/axiom-api-1.2.15.jar
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/ws/commons/axiom/axiom-impl/1.2.15/axiom-impl-1.2.15.jar
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/ws/commons/axiom/axiom-impl/1.2.15/axiom-impl-1.2.15.jar (348 kB at 687 kB/s)
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/ws/commons/axiom/axiom-api/1.2.15/axiom-api-1.2.15.jar (421 kB at 811 kB/s)
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/ws/commons/axiom/axiom-dom/1.2.15/axiom-dom-1.2.15.jar (447 kB at 807 kB/s)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  2.749 s
[INFO] Finished at: 2023-01-03T16:59:19-10:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:3.4.0:get (default-cli) on project standalone-pom: Couldn't download artifact: org.eclipse.aether.resolution.DependencyResolutionException: Could not find artifact org.apache.ws.commons.axiom:axiom:jar:1.2.15 in central (https://repo.maven.apache.org/maven2) -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

The error message shows that it is trying to download a .jar file for

   org.apache.ws.commons.axiom:axiom:jar:1.2.15

which doesn't make sense because the referenced dependency isn't a jar artifact; it is a pom artificat.

Another good test is this:

cd "$(mktemp -d)"
curl -OJ https://repo.maven.apache.org/maven2/net/sf/saxon/Saxon-HE/11.4/Saxon-HE-11.4.pom
mvn -f Saxon-HE-11.4.pom org.apache.maven.plugins:maven-dependency-plugin:2.8:resolve
mvn -f Saxon-HE-11.4.pom org.apache.maven.plugins:maven-dependency-plugin:3.4.0:resolve

Both of the above mvn invocations fail with error about:

Could not find artifact org.apache.ws.commons.axiom:axiom:jar:1.2.15 
in central (https://repo.maven.apache.org/maven2

Update: I see you use Gradle. I'm not sure how type maps to Gradle concepts. Maybe adding @pom.

Actions #1

Updated by Michael Kay over 1 year ago

  • Assignee set to Norm Tovey-Walsh
Actions #2

Updated by Michael Kay over 1 year ago

  • Priority changed from Low to Normal
Actions #3

Updated by Norm Tovey-Walsh about 1 year ago

  • Status changed from New to Resolved
  • Applies to branch 12, trunk added
  • Fix Committed on Branch 11, 12, trunk added

Thanks. I've arranged for type=pom to be added for the axiom dependency.

Fix applied to the Saxon11 and main/saxon12 branches.

Actions #4

Updated by O'Neil Delpratt about 1 year ago

  • Fixed in Maintenance Release 11.5 added

Bug fix applied in the Saxon 11.5 maintenance release.

Actions #5

Updated by O'Neil Delpratt about 1 year ago

  • Status changed from Resolved to Closed
  • % Done changed from 0 to 100
  • Fixed in Maintenance Release 12.1 added

Bug fix applied in the Saxon 12.1 maintenance release.

Please register to edit this issue

Also available in: Atom PDF