You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Robert Scholte (JIRA)" <ji...@apache.org> on 2018/01/16 22:14:01 UTC

[jira] [Commented] (MRELEASE-923) mvn release:prepare-with-pom doesn't replace SNAPSHOTs defined in a SNAPSHOT parent

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

Robert Scholte commented on MRELEASE-923:
-----------------------------------------

bq. So first of all, why are the transitive dependencies resolved before the parent?

The project doesn't point to the parent, so there's no relationship between the 2 pom files.

bq. And now the issue: in the released version of my.parent (1.0.0) there is also the released version of my.maven.plugin (1.0.0) so why is the relase:prepare-with-pom failing?
If I manually set the parent version to 1.0.0 before I run mvn relase:prepare-with-pom everything works fine as expected.

I've done quite some changes for the 3.0.0 I can't reproduce your issue.

bq. Also I when use the option "Dependency type to resolve,: specify the selection number ( 0:All 1:Project Dependencies 2:Plugins 3:Reports 4:Extensions ): (0/1/2/3) 1: : 0" I'm asked for the relese version of the my.maven.plugin and can perform the release as expected.

There's room for improvement here. The root cause is that here all versions of the effective pom are mapped, without knowing that some versions come from a parent, which have already assigned new values.

bq. And a last question: why is the default answer for the "What version should the dependency be reset to for development?" question always the released version and not the next SNAPSHOT version?

This is by design. In the code it says: {{by default, keep the same version for the dependency after release, unless it was previously newer}}
And that makes sense. In general you should only point to a SNAPSHOT of an external dependency if it contains a specific change you depend on. Otherwise you should ask yourself if that external dependency should have been part of a multimodule project.

> mvn release:prepare-with-pom doesn't replace SNAPSHOTs defined in a SNAPSHOT parent
> -----------------------------------------------------------------------------------
>
>                 Key: MRELEASE-923
>                 URL: https://issues.apache.org/jira/browse/MRELEASE-923
>             Project: Maven Release Plugin
>          Issue Type: Bug
>          Components: prepare-with-pom
>    Affects Versions: 2.5.2, 2.5.3
>            Reporter: Andreas Schaller
>            Priority: Blocker
>
> If I use a SNAPSHOT version of a plugin within a parent pom that is also a SNAPSHOT, the mvn release:prepare-with-pom can't replace it with its released version.
> I'm asked:
> {noformat}
> There are still some remaining snapshot dependencies.
> : Do you want to resolve them now? (yes/no) no: : yes
> Dependency type to resolve,: specify the selection number ( 0:All 1:Project Dependencies 2:Plugins 3:Reports 4:Extensions ): (0/1/2/3) 1: : 
> Dependency 'my.group:my.dependency' is a snapshot (1.0.0-SNAPSHOT)
> : Which release version should it be set to? 1.0.0: : 
> What version should the dependency be reset to for development? 1.0.0: : 1.0.1-SNAPSHOT
> Dependency 'my.group:my.parent' is a snapshot (1.0.0-SNAPSHOT)
> : Which release version should it be set to? 1.0.0: : 
> What version should the dependency be reset to for development? 1.0.0: : 1.0.1-SNAPSHOT
> [INFO] ------------------------------------------------------------------------
> [INFO] BUILD FAILURE
> [INFO] ------------------------------------------------------------------------
> [INFO] Total time: 40.211s
> [INFO] Finished at: Wed Sep 23 13:35:33 CEST 2015
> [INFO] Final Memory: 17M/157M
> [INFO] ------------------------------------------------------------------------
> [ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.5.2:prepare-with-pom (default-cli) on project my.project: Can't release project due to non released dependencies :
> [ERROR] my.group:my.maven.plugin:maven-plugin:1.0.0-SNAPSHOT:runtime
> {noformat}
> Example parent pom:
> {code:xml}
> <project>
>     <groupId>my.group</groupId>
>     <artifactId>my.parent</artifactId>
>     <version>1.0.0-SNAPSHOT</version>
>     <packaging>pom</packaging>
>     <profiles>
>         <profile>
>             <id>java-packaging-tools</id>
>             <activation>
>                 <activeByDefault>true</activeByDefault>
>             </activation>
>             <build>
>                 <plugins>
>                     <plugin>
>                         <groupId>my.group</groupId>
>                         <artifactId>my.maven.plugin</artifactId>
>                         <version>1.0.0-SNAPSHOT</version>
>                     </plugin>
>                 </plugins>
>             </build>
>         </profile>
>     </profiles>
> </project>
> {code}
> Example project pom:
> {code:xml}
> <project>
>     <groupId>my.group</groupId>
>     <artifactId>my.project</artifactId>
>     <version>1.0.0-SNAPSHOT</version>
>     <dependencies>
>         <dependency>
>             <groupId>my.group</groupId>
>             <artifactId>my.dependency</artifactId>
>             <version>1.0.0-SNAPSHOT</version>
>         </dependency>
>     </dependencies>
> </project>
> {code}
> So first of all, why are the transitive dependencies resolved before the parent?
> And now the issue: in the released version of my.parent (1.0.0) there is also the released version of my.maven.plugin (1.0.0) so why is the relase:prepare-with-pom failing?
> If I manually set the parent version to 1.0.0 before I run mvn relase:prepare-with-pom everything works fine as expected.
> Also I when use the option "Dependency type to resolve,: specify the selection number ( 0:All 1:Project Dependencies 2:Plugins 3:Reports 4:Extensions ): (0/1/2/3) 1: : 0" I'm asked for the relese version of the my.maven.plugin and can perform the release as expected.
> And a last question: why is the default answer for the "What version should the dependency be reset to for development?" question always the released version and not the next SNAPSHOT version?



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)