[ https://issues.apache.org/jira/browse/MNG-6770?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16983933#comment-16983933 ]
Karl Heinz Marbaise commented on MNG-6770: ------------------------------------------ The thing is first if you like to change the version in your pom file you can of course use `versions-maven-plugin` but this will not work if you execute it within your pom which means to bind it to the life cycle (as you already realised). If you like to have a more flexible way to change the version in your pom or even run without a version in your pom at all I recommend to check out https://maven.apache.org/maven-ci-friendly.html. Furthermore if you have in particular a spring boot application you usually use either the spring-boot-parent (or use a BOM file; than you handle the plugins versions yourself which should be done via corporate pom) which already configures all plugins and also defines the versions of plugins and also defines the versions of artifacts offered by spring boot which should not being changed except the direct dependencies in your own project. I have taken a look into the project you have given as an example. The part for plugins looks more or less the same as the http://takari.io/book/40-lifecycle.html it combines the execution of plugins into a single one. > Custom mojo changing project version but mavenSession doesn't get updated > -------------------------------------------------------------------------- > > Key: MNG-6770 > URL: https://issues.apache.org/jira/browse/MNG-6770 > Project: Maven > Issue Type: Wish > Reporter: Yuna Morgenstern > Priority: Minor > > I am using a custom maven plugin which helps me to preset the other plugins. > When I change my pom version (with > org.codehaus.mojo:versions-maven-plugin:2.7) > and execute the maven-deploy-plugin afterwords, than the plugin is getting my > old version from somewhere in the session. As I am unable to debug through, > it would be great if someone could help me to fix this issue. where are these > properties coming from: "artifact", "projectArtifact", "finalName" > "project.build.finalName", "attachedArtifacts"... > Every plugin seems to work fine except the maven-deploy-plugin which is using > the project version from somewhere. > After versioning, I am changing the project in the MavenProject session as > well without success of effect for the next plugin. The only way is currently > to run my plugin twice. one for deployment and before everything else. > My application is doing following in order: > * Cleaning > * Resolving Plugins & Dependencies > * Updates Plugins & Dependencies > * Updates Project Semantic Version > * Compiles Main & Test > * Builds Javadoc > * Builds Sources > * Builds Artifact file > * Signs files with GPG > * Tagging > * Deployment > Oh and I can't change the Settings xml data in the session, it doesn't have > an effect to the maven-deploy-plugin as well. seems that the deploy plugin > reads the settings file again. can I switch the settings file location in the > mavenSession somehow? -- This message was sent by Atlassian Jira (v8.3.4#803005)