[ http://jira.codehaus.org/browse/MNG-1975?page=comments#action_67910 ]
Stephane Nicoll commented on MNG-1975: -------------------------------------- John, I don't think so. See the previous comment. > EAR project depends on WAR that doesn't exist, but it builds succesfully > ------------------------------------------------------------------------ > > Key: MNG-1975 > URL: http://jira.codehaus.org/browse/MNG-1975 > Project: Maven 2 > Type: Bug > Components: Artifacts and Repositories > Versions: 2.0.2 > Environment: Debian GNU/Linux Etch (Testing), Eclipse WTP 1.0 > Reporter: Duncan Doyle > Fix For: 2.0.5 > > > While I was testing the features of Maven 2.0.1 and 2.0.2 I noticed the > following. > When specifying the correct version of my WAR project as a dependency in my > EAR pom.xml, the EAR file is generated correctly during a "mvn install" on my > SuperPom. However, when I specify a wrong WAR version number (a non-existing > one) in the dependency of my EAR Pom, the build still succeeds and an EAR > file is generated. I'm doing this just as a test. I would expect the build to > fail when the EAR project can't find the WAR file it depends on, but instead > it gives a message that it can't find the WAR file in the local repository > and remote repository and uses the generated WAR file (that is created before > the EAR file is created), which has the wrong version number, to create the > EAR package. > This my super pom.xml: > <project> > <modelVersion>4.0.0</modelVersion> > <name>Tour de France Service</name> > <groupId>nl.doyle.mccloud.TourDeFranceService</groupId> > <version>0.0.1</version> > <artifactId>TourDeFranceService</artifactId> > <packaging>pom</packaging> > <modules> > <module>../TourDeFranceServiceEAR</module> > <module>../TourDeFranceServiceWeb</module> > </modules> > </project> > This my WAR pom.xml: > <project> > <modelVersion>4.0.0</modelVersion> > <name>Tour de France Service Web</name> > <groupId>nl.doyle.mccloud.TourDeFranceService</groupId> > <artifactId>TourDeFranceServiceWeb</artifactId> > <packaging>war</packaging> > <version>0.0.2</version> > <dependencies> > <dependency> > <groupId>junit</groupId> > <artifactId>junit</artifactId> > <version>3.8.1</version> > <scope>test</scope> > </dependency> > </dependencies> > <build> > <plugins> > <plugin> > <groupId>org.apache.maven.plugins</groupId> > <artifactId>maven-war-plugin</artifactId> > <configuration> > <webXml>../TourDeFranceServiceWeb/WebContent/WEB-INF/web.xml</webXml> > </configuration> > </plugin> > </plugins> > <finalName>TourDeFranceServiceWeb</finalName> > </build> > </project> > And this my EAR pom.xml with the wrong version number of the WAR project: > <project> > <modelVersion>4.0.0</modelVersion> > <name>Tour de France Service EAR</name> > <groupId>nl.doyle.mccloud.TourDeFranceService</groupId> > <artifactId>TourDeFranceServiceEAR</artifactId> > <packaging>ear</packaging> > <version>0.0.1</version> > <dependencies> > <dependency> > <groupId>nl.doyle.mccloud.TourDeFranceService</groupId> > <artifactId>TourDeFranceServiceWeb</artifactId> > <type>war</type> > <version>1.0.2</version> > </dependency> > </dependencies> > <build> > <finalName>TourDeFranceServiceEAR</finalName> > </build> > </project> > This is part of the message that "mvn install" gives me: > Downloading: > http://repo1.maven.org/maven2/nl/doyle/mccloud/TourDeFranceService/TourDeFranceServiceWeb/1.0.2/TourDeFranceServiceWeb-1.0.2.pom > [WARNING] Unable to get resource from repository central > (http://repo1.maven.org/maven2) > [INFO] [ear:generate-application-xml] > [INFO] Generating application.xml > [INFO] [resources:resources] > [INFO] Using default encoding to copy filtered resources. > [INFO] [ear:ear] > [INFO] Copying > artifact[war:nl.doyle.mccloud.TourDeFranceService:TourDeFranceServiceWeb:1.0.2] > to[TourDeFranceServiceWeb.war] > How can it copy an artifact that doesn't exist??? The 1.0.2 version of my WAR > file doesn't exist in my local repository and the WAR file in my Enterprise > project has a different version number!!! -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira