maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tuomas Kiviaho (JIRA)" <j...@codehaus.org>
Subject [jira] (MNG-5384) Declarative artifacts
Date Fri, 11 Jan 2013 11:18:13 GMT

    [ https://jira.codehaus.org/browse/MNG-5384?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=317148#comment-317148
] 

Tuomas Kiviaho edited comment on MNG-5384 at 1/11/13 5:17 AM:
--------------------------------------------------------------

M2E workspace resolution would benefit from this by being able to pinpoint directly to {{testOutputDirectory}}
when an artifact from MavenProject.getArtifacts is of type test-jar. Currently it points to
the {{outputDirectory}} because Aether only fixes the location of test-jar artifact retrievable
from MavenProject.getAttacheArtifacts.

Since Maven 2.x the behavior of attached test-jar artifact has somewhat changed. It used to
be so that project's test-jar attachment was already in place before actual artifact was attached.
With Maven 3 this feature was removed (thus some the magic seems to have been shifted to Aether).
It would be beneficial if the artifact file location would be dynamic, since static approach
doesn't have such advantages as with as it does with {{properties}} section of the POM. I
think that the plugins responsible of produced artifacts should state the file location of
the artifact in declarative manner (perhaps an {{<artifacts>}} tag inside {{<execution>}}
tag). 
                
      was (Author: tuomas_kiviaho):
    M2E workspace resolution would benefit from this by being able to pinpoint directly to
{{testOutputDirectory}} when an artifact from MavenProject.getArtifacts is of type test-jar.
Currently it points to the {{outputDirectory}} because Aether only fixes the location of test-jar
artifact retrievable from MavenProject.getAttacheArtifacts.

Since Maven 2.x the behavior of attached test-jar artifact has somewhat changed. It used to
be so that project's test-jar attachment was already in place before actual artifact was attached.
With Maven 3 this feature was removed (thus some the magic seems to have been shifted to Aether).
It would be beneficial if the artifact file location would be dynamic, since static approach
doesn't have such advantages as with as it does with {{properties}} section of the POM.
                  
> Declarative artifacts
> ---------------------
>
>                 Key: MNG-5384
>                 URL: https://jira.codehaus.org/browse/MNG-5384
>             Project: Maven 2 & 3
>          Issue Type: New Feature
>          Components: Artifacts and Repositories, POM, Reactor and workspace
>    Affects Versions: 3.0.4
>            Reporter: Tuomas Kiviaho
>
> Currently there's no way to know what attachments a project is going to have beforehand.
Lack of this feature is currently patched inside Aether where test-jar for instance has a
special treatment prior packaging phase so that we can get a file pointer to ${project.target.testOutputDirectory}.

> Maven 2 had this hack embedded inside of it, but with Maven 3 the project attachments
list doesn't contain test-jar until it is actually added to the project. I had to patch MBUILDHELPER-41
to be able attach this artifact prior packaging phase and remove it at prepare-package so
that the actual attachment could be added to the project.
> I propose that POM could have a section similar to {{build.finalName}} where you'd list
the attacments that the project is going to introduce. For backwards compatibility this of
course would not be required. Plugins such as jar, sources and javadoc could kick in automatically
when pom contains the respective declarations (race conditions would arise between maven-bundle-plugin
and jar for instance).

--
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

        

Mime
View raw message