Hi Maven Gurus,
I'm really puzzled... Can someone in the forum explain this to me?
I have a simple pom.xml that defines the a dependency on jsp-impl from
the Maven repository: http://download.java.net/maven/2
--------------------------pom.xml-----------------------------
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>maven.test</groupId>
<artifactId>simple</artifactId>
<version>1.0</version>
<name>SimpleTest</name>
<repositories>
<repository>
<id>java.net</id>
<name>Java Net Maven 2 </name>
<url>http://download.java.net/maven/2</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.glassfish.web</groupId>
<artifactId>jsp-impl</artifactId>
<version>2.1.3-b17</version>
</dependency>
</dependencies>
</project>
-------------------------------------------------------------------
Running "mvn install" will fail with the message:
Downloading:
http://repo1.maven.org/maven2/javax/servlet/jsp/jsp-api/2.1.3-b05/jsp-api-2.1.3-b05.jar
[INFO]
------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO]
------------------------------------------------------------------------
[INFO] Failed to resolve artifact.
Missing:
----------
1) javax.servlet.jsp:jsp-api:jar:2.1.3-b05
Try downloading the file manually from the project website.
Then, install it using the command:
mvn install:install-file -DgroupId=javax.servlet.jsp
-DartifactId=jsp-api -Dversion=2.1.3-b05 -Dpackaging=jar
-Dfile=/path/to/file
Alternatively, if you host your own repository you can deploy the file
there:
mvn deploy:deploy-file -DgroupId=javax.servlet.jsp
-DartifactId=jsp-api -Dversion=2.1.3-b05 -Dpackaging=jar
-Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
Path to dependency:
1) maven.test:simple:jar:1.0
2) org.glassfish.web:jsp-impl:jar:2.1.3-b17
3) javax.servlet.jsp:jsp-api:jar:2.1.3-b05
----------
1 required artifact is missing.
for artifact:
maven.test:simple:jar:1.0
from the specified remote repositories:
central (http://repo1.maven.org/maven2),
java.net (http://download.java.net/maven/2)
It's complaining about resolving the artifact jsp-api. But this
artifact (javax.servlet.jsp:jsp-api:jar:2.1.3-b05) exists in java.net
(http://download.java.net/maven/2/javax/servlet/jsp/jsp-api/2.1.3-b05/).
Looks like it's trying to download the artifact from the Central repo
(http://repo1.maven.org/maven2) and not even search for it in
java.net. The message at the end is not true.
If I explicitly define jsp-api artifact in the pom.xml then it compiles
successfully.
Is this a bug in Maven? a known issue?
I'm using Maven version 2.2.1 and JDK version 1.6.
Thanks,
Jane
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]