You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Johan Elmström (JIRA)" <ji...@apache.org> on 2015/08/19 17:18:45 UTC

[jira] [Commented] (MNG-5614) Continuous Delivery Friendly Versions not present in installed artifacts

    [ https://issues.apache.org/jira/browse/MNG-5614?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14703166#comment-14703166 ] 

Johan Elmström commented on MNG-5614:
-------------------------------------

I ran into the same problem, but it seemed like it did not affect all submodules in my project, which seems a bit strange, but I am not that familiar with how maven build multi-module projects.It could be a threading issue as the same error does not appear in my simple project created to expose the bug.


I found that the easiest workaround was to place the dependencies in the root pom under dependencyManagement

{code}
<dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>se.aptitud.maven/groupId>
                <artifactId>sub-module</artifactId>
                <version>${project.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>
{code}

And then refer to the dependencies in sub-module without the version. This seems fairly stable..

> Continuous Delivery Friendly Versions not present in installed artifacts
> ------------------------------------------------------------------------
>
>                 Key: MNG-5614
>                 URL: https://issues.apache.org/jira/browse/MNG-5614
>             Project: Maven
>          Issue Type: Bug
>    Affects Versions: 3.2.1
>            Reporter: Axel Fontaine
>
> Consider a parent pom with these tags:
> ...
> <version>${revision}</version>
> ...
> <properties>
>         <revision>0-SNAPSHOT</revision>
> </properties>
> ...
> If I start the build with:
>   mvn install -Drevision=666
> The revision gets replaced correctly at runtime (correct), but the placeholder remains in the installed artifact in the local repository (wrong).
> To make matters worse, if you have a Maven Plugin child module with these tags in the pom:
> ...
> <parent>
>         ...
>         <version>${revision}</version>
> </parent>
> ...
> <packaging>maven-plugin</packaging>
> ...
> <dependencies>
>         <dependency>
>             <groupId>${project.groupId}</groupId>
>             <artifactId>other-artifact</artifactId>
>             <version>${project.version}</version>
>         </dependency>
> </dependencies>
> Once the plugin gets used in yet another module, the resolution of other-artifact will fail at runtime with:
>  Plugin ...:666 or one of its dependencies could not be resolved: Could not find artifact ...:other-artifact:jar:0-SNAPSHOT
> Until this is fixed the functionality provided by MNG-5576 is virtually useless.
> By speaking about the fix, why bother with replacing variables? Why bother with parent POMs? How about simply installing and deploying the effective POM? This would solve a whole range of problems at once. And at the end of the day, this will simplify many things, at the cost of slightly larger installed POMs.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)