Hi all. I have run into a strange problem with transitive dependencies. This shows itself both under m2clipse and Maven 2.0.9. However, it does not manifest itself on other installation of the same m2clipse (latest stable) with my colleague.
A project has a dependency on org.springframework:spring-webmvc:2.5.5, which
has a dependency on javax.servlet:servlet-api:2.4 (scope=provided).
I would expect that this transitive dependency gets brought in in both m2clipse
Maven Dependencies and Maven2 reactor for compile phase. This, however, does
not happen on two installations of m2clipse that I have. It also fails in
command line. I have attached a screenshot of dependency graph, the POM and CLI
output.
Also, when I add the dependency myself to the project, with scope=provided,
everything works.
Any comment?
Nix.
<<attachment: dep_graf.png>>
C:\eclipse\test>mvn clean compile
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building test
[INFO] task-segment: [clean, compile]
[INFO] ------------------------------------------------------------------------
[INFO] [clean:clean]
[INFO] Deleting directory C:\work\Nexus\eclipse\test\target
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:compile]
[INFO] Compiling 2 source files to C:\work\Nexus\eclipse\test\target\classes
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Compilation failure
C:\eclipse\test\src\main\java\rs\test\test\TestServlet.java:[6,25] package
javax.servlet.http does not exist
C:\eclipse\test\src\main\java\rs\test\test\TestServlet.java:[12,39] cannot find
symbol
symbol: class HttpServlet
public final class TestServlet extends HttpServlet {
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3 seconds
[INFO] Finished at: Sun Sep 21 23:24:16 CEST 2008
[INFO] Final Memory: 6M/13M
[INFO] ------------------------------------------------------------------------<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>rs.test</groupId> <artifactId>test</artifactId> <packaging>jar</packaging> <version>0.0.1-SNAPSHOT</version> <name>test</name> <url>http://maven.apache.org</url> <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>3.8.1</version> <scope>test</scope> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-webmvc</artifactId> <version>2.5.5</version> </dependency> <!-- This dependency should not be necessary --> <!-- dependency> <groupId>javax.servlet</groupId> <artifactId>servlet-api</artifactId> <version>2.4</version> <scope>provided</scope> </dependency --> </dependencies> </project>
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email
