maven-archetype icon indicating copy to clipboard operation
maven-archetype copied to clipboard

[ARCHETYPE-311] Basedir property in archetype:generate cannot be overriden

Open jira-importer opened this issue 15 years ago • 8 comments

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:

Remote Links:

1 votes, 4 watchers

jira-importer avatar Apr 16 '10 03:04 jira-importer

Samuli Saarinen commented

patch for the issue

jira-importer avatar Apr 16 '10 03:04 jira-importer

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?

jira-importer avatar Feb 01 '13 06:02 jira-importer

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?

 

jira-importer avatar Jan 24 '18 03:01 jira-importer

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.

jira-importer avatar Jul 06 '18 15:07 jira-importer

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).

jira-importer avatar Jul 06 '18 16:07 jira-importer

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?

jira-importer avatar Jul 11 '18 03:07 jira-importer

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.

jira-importer avatar Jul 11 '18 16:07 jira-importer

Eric R. Green commented

Ah, pull request, yes! Very good. Okay thanks Robert Scholte. I shall proceed as you have requested.

jira-importer avatar Jul 12 '18 06:07 jira-importer