maven-archetype
maven-archetype copied to clipboard
[ARCHETYPE-311] Basedir property in archetype:generate cannot be overriden
Samuli Saarinen opened ARCHETYPE-311 and commented
Following is the output when trying to execute archetype:generate using alternative directory for basedir
D:\tmp>mvn -o -npr archetype:generate *-Dbasedir=d:/foo*
....
[INFO] ----------------------------------------------------------------------------
[INFO] Using following parameters for creating OldArchetype: maven-archetype-quickstart:RELEASE
[INFO] ----------------------------------------------------------------------------
[INFO] Parameter: groupId, Value: test
[INFO] Parameter: packageName, Value: test
[INFO] Parameter: package, Value: test
[INFO] Parameter: artifactId, Value: test
[INFO] Parameter: basedir, Value: *D:\tmp*
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[INFO] ********************* End of debug info from resources from generated POM ***********************
[INFO] OldArchetype created in dir: D:\tmp\test
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 8 seconds
[INFO] Finished at: Fri Apr 16 10:53:06 EEST 2010
[INFO] Final Memory: 10M/19M
[INFO] ------------------------------------------------------------------------
Attachments:
- patch.txt (2.31 kB)
Remote Links:
1 votes, 4 watchers
Anders Hammar commented
I can reproduce this with Maven 3.0.4 and version 2.2 of the plugin. It doesn't seem to be possible to override 'basedir'. Maybe renaming the param is the way to solve this?
Yan Zhang commented
Same for me.
maven-archetype-plugin:3.0.1, ``-Dbasedir doesn't work at all.
Others also suffer from the same issue:
https://stackoverflow.com/questions/46439296/how-can-i-specify-the-directory-where-to-create-the-project-for-archetypegenera
After so many years, is there any update?
Eric R. Green commented
Has this sat around unfixed for all these years just because nobody's gotten to it? Or, is it basically an undesired feature? I'm asking because I'd like to provide a fix for this, but if someone's just going to reject my pull request I don't want to waste my time.
Robert Scholte commented
Eric R. Green the already provided patch seems reasonable to me, although I would call the parameter outputDirectory. If you can create a PR and can think of a unittest/integration test (just to prevent regression, I know the fix looks simple).
Eric R. Green commented
Robert Scholte please forgive me, I have been a Java developer for over sixteen years, but I'm still a bit new to maven plugin development. By PR, do you mean "plugin registry"? If so, can you point me to the appropriate documentation for what I'd need to do with regard to this?
Robert Scholte commented
PR stand for pull request. You can go to https://github.com/apache/maven-archetype and clone the project. You can use patch.txt as base for your solution. Once you're happy with your code, push back to github and do a pullrequest.
Eric R. Green commented
Ah, pull request, yes! Very good. Okay thanks Robert Scholte. I shall proceed as you have requested.