Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I change the version during deploy goal #13

Open
betonetotbo opened this issue Sep 24, 2018 · 1 comment
Open

How can I change the version during deploy goal #13

betonetotbo opened this issue Sep 24, 2018 · 1 comment

Comments

@betonetotbo
Copy link

I'm trying to create a dynamic version control using a groovy script like this:

<build>	
	<plugins>
			<plugin>
				<groupId>org.codehaus.gmaven</groupId>
				<artifactId>groovy-maven-plugin</artifactId>
				<executions>
					<execution>
						<phase>prepare-package</phase>
						<goals>
							<goal>execute</goal>
						</goals>
						<configuration>
							<source>
								project.version = '1.0.0'
								project.build.finalName = "${project.name}-1.0.0"
							</source>
						</configuration>
					</execution>
				</executions>
			</plugin>
		</plugins>
</build>

In this example, I just trying to force the change of the version from 0.0.1-SNAPSHOT to 1.0.0.

The jar file name and it contents is created correct (ex. my-project-1.0.0.jar) but when the deploy goal starts, it deploy the JAR with the old name (my-proejct-0.0.1-SNAPSHOT.jar) on my maven distribution repository.

How can I solve this?

@jdillon
Copy link
Member

jdillon commented Sep 25, 2018

I'm not sure there is a really good answer to this. Mutation of the project model like this is certainly not going to behave very well. Any reason why the maven-release-plugin doesn't work for you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants