Reputation: 53
I am following this instruction to understand maven
archetype.
Calling mvn archetype:create-from-project
on a simple webapp project asking me to have setting.xml
file under .m2
dir.
Not sure why it's asking, was not able to found any specific reason behind this.Neither any doc state to create for any local project.
Please help if you give a clear picture . Attaching the error while running the command.
[INFO] Scanning for projects...
[INFO]
[INFO] -------------------------< com.example:myapp >--------------------------
[INFO] Building myapp Maven Webapp 0.0.1-SNAPSHOT
[INFO] --------------------------------[ war ]---------------------------------
[INFO]
[INFO] >>> maven-archetype-plugin:3.1.2:create-from-project (default-cli) > generate-sources @ myapp >>>
[INFO]
[INFO] <<< maven-archetype-plugin:3.1.2:create-from-project (default-cli) < generate-sources @ myapp <<<
[INFO]
[INFO]
[INFO] --- maven-archetype-plugin:3.1.2:create-from-project (default-cli) @ myapp ---
[INFO] Setting default groupId: com.example
[INFO] Setting default artifactId: myapp
[INFO] Setting default version: 0.0.1-SNAPSHOT
[INFO] Setting default package: com.example
[WARN] Maven will be executed in interactive mode, but no input stream has been configured for this MavenInvoker instance.
[ERROR] Error executing Maven.
[ERROR] The specified user settings file does not exist: C:\Users\Rajat Dobriyal\.m2\settings.xml
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.303 s
[INFO] Finished at: 2020-01-06T00:38:43+05:30
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:3.1.2:create-from-project (default-cli) on project myapp: Invoker process ended with result different than 0! -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
Any help would be great.
Upvotes: 2
Views: 1677
Reputation: 917
settings.xml
is not created during installation, that's why you need to create a default settings file under C:\Users\Rajat Dobriyal\.m2\settings.xml
with content:
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
https://maven.apache.org/xsd/settings-1.0.0.xsd">
</settings>
More detailed is here
Upvotes: 7