-
Bug
-
Resolution: Not an Issue
-
P4
-
None
-
8u144
-
x86
-
os_x
FULL PRODUCT VERSION :
n/a
A DESCRIPTION OF THE PROBLEM :
The JavaServer Pages(TM) Standard Tag Library is distributed via Apache maven.
The distributor (which is Sun Microsystems Inc., i.e. Oracle, according to the jar's MANIFEST.MF) is responsible for the metadata that is distributed with it (according to the maven user mailing list).
The maven-metadata.xml file on maven central for javax.servlet:jstl (which gets pushed there by Oracle) is broken; it doesn't list the latest/all available versions. This causes maven's version range resolution to fail for the artifact. The artifact identifiers were changed at some point to javax.servlet.jsp.jstl:jstl, but the version resolution for the old artifact shouldn't be affected.
Could a corrected version of maven-metadata.xml for the old identifiers please be pushed to maven central?
For more information on the issue, please see http://mail-archives.apache.org/mod_mbox/maven-users/201709.mbox/%3C2223454.JgCkStHX4D%40giga%3E
For information how to publicise a change of artifact identifiers, if needed, see here: http://maven.apache.org/ref/3.5.0/maven-model/maven.html#class_relocation
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Create a new maven project, and specify the dependency on javax.servlet:jstl as follows in the project's pom.xml:
<dependency>
<groupId>xml-resolver</groupId>
<artifactId>xml-resolver</artifactId>
<version>[1.2,2.alpha)</version>
</dependency>
Once completed, run mvn dependency:resolve
This should instruct maven to get the latest artifact, between version 1.2 (inclusive) and 2.alpha (exclusive). Resolution fails.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Maven should inspect the metadata file for the artifact on central. That file should list all available versions. It is published there by Oracle (Sun Microsystems) and located here:
http://central.maven.org/maven2/javax/servlet/jstl/maven-metadata.xml
Unfortunately, it does not list the latest available release:
http://central.maven.org/maven2/javax/servlet/jstl/1.2/jstl-1.2.jar
ACTUAL -
Dependency should be downloaded by maven. (Specifically, version 1.2)
ERROR MESSAGES/STACK TRACES THAT OCCUR :
[ERROR] Failed to execute goal on project bar: Could not resolve dependencies for project com.example.foo:bar:jar:1.0-SNAPSHOT: Failed to collect dependencies at javax.servlet:jstl:jar:[1.2,2.alpha): No versions available for javax.servlet:jstl:jar:[1.2,2.alpha) within specified range -> [Help 1]
REPRODUCIBILITY :
This bug can be reproduced always.
CUSTOMER SUBMITTED WORKAROUND :
As a workaround, you can specify the version explicitly as "any, ideally 1.2", in which case maven seems to use a different resolution mechanism and includes the dependency successfully (presumable by directly trying to download the artifact, and not going via the metadata file):
<dependency>
<groupId>xml-resolver</groupId>
<artifactId>xml-resolver</artifactId>
<version>1.2</version>
</dependency>
NB: Specifying exactly version 1.2 also fails:
<dependency>
<groupId>xml-resolver</groupId>
<artifactId>xml-resolver</artifactId>
<version>[1.2]</version>
</dependency>
Cf. http://maven.apache.org/pom.html#Dependency_Version_Requirement_Specification
n/a
A DESCRIPTION OF THE PROBLEM :
The JavaServer Pages(TM) Standard Tag Library is distributed via Apache maven.
The distributor (which is Sun Microsystems Inc., i.e. Oracle, according to the jar's MANIFEST.MF) is responsible for the metadata that is distributed with it (according to the maven user mailing list).
The maven-metadata.xml file on maven central for javax.servlet:jstl (which gets pushed there by Oracle) is broken; it doesn't list the latest/all available versions. This causes maven's version range resolution to fail for the artifact. The artifact identifiers were changed at some point to javax.servlet.jsp.jstl:jstl, but the version resolution for the old artifact shouldn't be affected.
Could a corrected version of maven-metadata.xml for the old identifiers please be pushed to maven central?
For more information on the issue, please see http://mail-archives.apache.org/mod_mbox/maven-users/201709.mbox/%3C2223454.JgCkStHX4D%40giga%3E
For information how to publicise a change of artifact identifiers, if needed, see here: http://maven.apache.org/ref/3.5.0/maven-model/maven.html#class_relocation
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Create a new maven project, and specify the dependency on javax.servlet:jstl as follows in the project's pom.xml:
<dependency>
<groupId>xml-resolver</groupId>
<artifactId>xml-resolver</artifactId>
<version>[1.2,2.alpha)</version>
</dependency>
Once completed, run mvn dependency:resolve
This should instruct maven to get the latest artifact, between version 1.2 (inclusive) and 2.alpha (exclusive). Resolution fails.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Maven should inspect the metadata file for the artifact on central. That file should list all available versions. It is published there by Oracle (Sun Microsystems) and located here:
http://central.maven.org/maven2/javax/servlet/jstl/maven-metadata.xml
Unfortunately, it does not list the latest available release:
http://central.maven.org/maven2/javax/servlet/jstl/1.2/jstl-1.2.jar
ACTUAL -
Dependency should be downloaded by maven. (Specifically, version 1.2)
ERROR MESSAGES/STACK TRACES THAT OCCUR :
[ERROR] Failed to execute goal on project bar: Could not resolve dependencies for project com.example.foo:bar:jar:1.0-SNAPSHOT: Failed to collect dependencies at javax.servlet:jstl:jar:[1.2,2.alpha): No versions available for javax.servlet:jstl:jar:[1.2,2.alpha) within specified range -> [Help 1]
REPRODUCIBILITY :
This bug can be reproduced always.
CUSTOMER SUBMITTED WORKAROUND :
As a workaround, you can specify the version explicitly as "any, ideally 1.2", in which case maven seems to use a different resolution mechanism and includes the dependency successfully (presumable by directly trying to download the artifact, and not going via the metadata file):
<dependency>
<groupId>xml-resolver</groupId>
<artifactId>xml-resolver</artifactId>
<version>1.2</version>
</dependency>
NB: Specifying exactly version 1.2 also fails:
<dependency>
<groupId>xml-resolver</groupId>
<artifactId>xml-resolver</artifactId>
<version>[1.2]</version>
</dependency>
Cf. http://maven.apache.org/pom.html#Dependency_Version_Requirement_Specification