[英]Calling mvn archetype:create-from-project on a simple archetype:webapp project is asking for Setting.xml
我正在按照此說明了解maven
原型。 在一個簡單的 webapp 項目上調用mvn archetype:create-from-project
project 要求我在.m2
目錄下有setting.xml
文件。
不知道為什么要問,無法找到這背后的任何具體原因。沒有為任何本地項目創建任何文檔狀態。
如果您提供清晰的圖片,請幫助。 運行命令時附加錯誤。
[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
任何幫助都會很棒。
settings.xml
不是在安裝過程中創建的,這就是為什么您需要在C:\\Users\\Rajat Dobriyal\\.m2\\settings.xml
下創建一個默認設置文件,內容如下:
<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>
更詳細的在這里
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.