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

Support for workingDirectory for version goal #15

Open
stefandesmit-tomtom opened this issue Oct 21, 2021 · 2 comments
Open

Support for workingDirectory for version goal #15

stefandesmit-tomtom opened this issue Oct 21, 2021 · 2 comments
Assignees

Comments

@stefandesmit-tomtom
Copy link

stefandesmit-tomtom commented Oct 21, 2021

When executing "mvn -f someDir/pom.xml ci-friendly-flatten:version", we get:
"Failed to retrieve version tag, continuing with default tag:"

This is probably caused by VersionProviderImpl simply calling:
Runtime.getRuntime().exec(command); where command is "git ..."
while not in the actual repository directory.

There's also a configuration property but this does not fix it.
Proposed (but not tested) solution:
Runtime.getRuntime().exec(command, null, workingDirectory)

@ayoukhananov
Copy link
Contributor

@stefandesmit-tomtom If there is no tag we put a default tag {project.artifactId}-0.0.0.1 .
Which also can be overrides by passing this param -Ddefault.tag=????

Did you try it ?

@stefandesmit-tomtom
Copy link
Author

There is a tag (and default tag). It does find the default tag from pom, but not the tag from git.
I see now that something was not formatted well in my comment (put

instead of someDir, which didn't show up outside of editing mode) which was hiding the important information that we execute the command outside of the git directory.
(just putting this in some shell & first cd into the directory makes everything work ok)
"mvn -f someDir/pom.xml ci-friendly-flatten:scmTag" does work, because that's using the whole Scm abstraction. it's just the version goal that doesn't.

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

3 participants