0

I'm trying to build a Multi-Module Project with Maven. I'm stuck in the first step 6.1 of the post.

mvn archetype:generate -DgroupId=com.baeldung -DartifactId=parent-project

Enter image description here

Am I missing anything?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Will Huang
  • 2,955
  • 2
  • 37
  • 90
  • Please review *[Why not upload images of code/errors when asking a question?](https://meta.stackoverflow.com/questions/285551/)* (e.g., *"Images should only be used to illustrate problems that* ***can't be made clear in any other way,*** *such as to provide screenshots of a user interface."*) and [do the right thing](https://stackoverflow.com/posts/73659430/edit). Thanks in advance. – Peter Mortensen Sep 10 '22 at 23:28

2 Answers2

0

You're not missing anything. You may not have run the command line command correctly.

The same command works for me:

mvn archetype:generate -DgroupId=com.baeldung -DartifactId=parent-project

Result:

[INFO] Using following parameters for creating project from Old (1.x) Archetype: maven-archetype-quickstart:1.0
[INFO] ----------------------------------------------------------------------------
[INFO] Parameter: basedir, Value: C:\dev\testing
[INFO] Parameter: package, Value: com.baeldung
[INFO] Parameter: groupId, Value: com.baeldung
[INFO] Parameter: artifactId, Value: parent-project
[INFO] Parameter: packageName, Value: com.baeldung
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[INFO] project created from Old (1.x) Archetype in dir: C:\dev\testing\parent-project
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  45.571 s
[INFO] Finished at: 2022-09-09T11:16:06+02:00
[INFO] ------------------------------------------------------------------------

Check also the version of mvn you have installed

Apache Maven 3.8.1 (05c21c65bdfed0f71a2f2ada8b84da59348c4c5d)
Maven home: C:\apache-maven-3.8.1
Java version: 11.0.12, vendor: Oracle Corporation, runtime: C:\Program Files\Java\jdk-11.0.12
Default locale: no_NO, platform encoding: Cp1252
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
vikingsteve
  • 38,481
  • 23
  • 112
  • 156
0

I have finally realized that my PowerShell environment will interpret into the wrong command. So the correct command in PowerShell should be:

mvn archetype:generate '-DgroupId=com.baeldung' '-DartifactId=parent-project'

If I put the original command in a Command Prompt, it will not produce any error.

See also: How to disable/override PowerShell dot notation

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Will Huang
  • 2,955
  • 2
  • 37
  • 90