Hayarobi Park created MWAR-296:
----------------------------------
Summary: maven-war-plugin can cause multiple dependent lib files
with same snapshot version.
Key: MWAR-296
URL: https://jira.codehaus.org/browse/MWAR-296
Project: Maven 2.x WAR Plugin
Issue Type: Bug
Affects Versions: 2.3
Reporter: Hayarobi Park
maven-war-plugin copies jar files of dependent artifacts to WEB-INF/lib
directory. with filename as is. It could make trouble when the version of
depenedent artifact is snapshot.
If the artifact was downloaded from remote repository, the jar filename in
local repository contains timestamp value. (eg.
deplib-1.0.0-20121220.074535-93.jar )
If the artifact was built in workspace, the jar file in local repository
contains 'SNAPSHOT'. (eg. deplib-1.0.0-SNAPSHOT.jar )
Guess multimodule project MyProject which has submodules modA and modWAR, where
modWAR is dependent to modA.
MyProject |-- modA
|-- modWAR
When I built just modWAR in my PC, maven (maybe war plugin) looks for
repository, and then find modA-0.1-20130101.074535-93.jar, copy this file to
WEB-INF/lib with same filename.
Then, I 'mvn install' upper moudule MyProject, the submodules will be built.
modA is built and copied to local repository with filename
modA-0.1-SNAPSHOT.jar, and war plugin will copy modA-0.1-SNAPSHOT.jar to
WEB-INF/lib when submodule modWAR is built. Now, there are two modA jar files
in WEB-INF/lib directory of modWAR; modA-0.1-20130101.074535-93.jar and
modA-0.1-SNAPSHOT.jar.
If co-work developer build modA and deploy next day in his PC, the lastest
snapshot file will look like modA-0.1-20130102.110000-1.jar
I build modWAR without cleaning modWAR beforehand. maven will find newer
snapshot of modA, download it, and copy it to WEB-INF/lib without deleting
older snapshot version. There are three of modA jar files now.
This behavier is different from that of dependey-plugin. 'mvn
dependency:copy-dependencies' will copy files to target directory, changing
timestamp value of filename to 'SNAPSHOT'. There is duplicated dependent
library problem.
I think maven-war-plugin's copying behavier should be like dependent-plugin.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira