[
http://jira.codehaus.org/browse/MEAR-116?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Benjamin Bentmann updated MEAR-116:
-----------------------------------
Attachment: MEAR-116.patch
Quote from javadoc of {{StandardFileNameMapping}}:
bq. It returns the name of the file in the local repository.
This does not always hold when calling {{Artifact.getFile().getName()}}.
During a reactor build, the artifact is resolved from the project's output
directory and the filename here is controlled by the {{finalName}} of the build
section or the config of the packaging plugin. In contrast, the filename in the
local/remote repo is entirely controlled by the repo layout (which doesn't
consider {{finalName}}). Milos' example is using non-default finalName's,
thereby making the conceptual difference visible.
The attached patch demos a potential solution by calculating the filename in
the plugin itself, based on the artifact coordinates. The code basically mimics
the calculation from {{DefaultRepositoryLayout}} with the difference of using
{{getBaseVersion()}} instead of {{getVersion()}}.
The patch is incomplete. Apart from tests, it doesn't update the other affected
{{FullFileNameMapping}}.
> different build results from single module build and from reactor build
> -----------------------------------------------------------------------
>
> Key: MEAR-116
> URL: http://jira.codehaus.org/browse/MEAR-116
> Project: Maven 2.x Ear Plugin
> Issue Type: Bug
> Affects Versions: 2.4
> Environment: maven 2.2.0
> Reporter: Milos Kleint
> Priority: Critical
> Attachments: ear116.zip, MEAR-116.patch
>
>
> attached is a sample application as generated by netbeans 6.8 (using
> archetypes from org.codehaus.mojo.archetypes)
> a simple ear+ejb+war multiproject.
> when building everything together from the root pom, I get this output:
> [ear:ear]
> Copying artifact[ejb:org.kleint:samplejavaee6-ejb:1.0-SNAPSHOT]
> to[samplejavaee6-ejb.jar]
> Copying artifact[war:org.kleint:samplejavaee6-web:1.0-SNAPSHOT]
> to[samplejavaee6-web.war]
> and the war and ejb artifacts are included with names not including version.
> However if I later do a mvn clean install on the ear project, I get this
> output:
> [ear:ear]
> Copying artifact[ejb:org.kleint:samplejavaee6-ejb:1.0-SNAPSHOT]
> to[samplejavaee6-ejb-1.0-SNAPSHOT.jar]
> Copying artifact[war:org.kleint:samplejavaee6-web:1.0-SNAPSHOT]
> to[samplejavaee6-web-1.0-SNAPSHOT.war]
> and the war/ejb artifacts get a version in the name.
> This sounds like it has to do with the finalname being resolved differently
> in single module build and in reactor build.
--
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