mvn archetype:generate 使用内部 Maven 仓库
mvn archetype:generate using internal maven repo
我想使用“mvn archetype:generate ...”创建一个maven项目来创建一个maven项目骨架。我在网上查了一下,想出了这个:
在settings.xml
<profile>
<id>PlatMigr</id>
<repositories>
<repository>
<id>internal repo</id>
<name>IT Maven Central</name>
<url>https://<internal maven repo></url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
</profile>
从命令行:
mvn archetype:generate -DarchetypeCatalog=internal -DarchetypeGroupId=org.apache.maven.archetypes -DgroupId=com.mycompany.myproj -DartifactId=ProjName
但是 maven 仍然尝试从官方中央 maven 仓库下载工件:
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.pom
我们安装了防火墙来阻止互联网访问,这就是我一开始就难以使用内部存储库的原因。任何人都可以建议如何设置和使用内部回购来创建 Maven 项目?
在 m2_home 中编辑你 settings.xml,为你的 nexus 添加镜像并创建和设置为没有中央存储库的活动配置文件
我想使用“mvn archetype:generate ...”创建一个maven项目来创建一个maven项目骨架。我在网上查了一下,想出了这个:
在settings.xml
<profile>
<id>PlatMigr</id>
<repositories>
<repository>
<id>internal repo</id>
<name>IT Maven Central</name>
<url>https://<internal maven repo></url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
</profile>
从命令行:
mvn archetype:generate -DarchetypeCatalog=internal -DarchetypeGroupId=org.apache.maven.archetypes -DgroupId=com.mycompany.myproj -DartifactId=ProjName
但是 maven 仍然尝试从官方中央 maven 仓库下载工件:
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.pom
我们安装了防火墙来阻止互联网访问,这就是我一开始就难以使用内部存储库的原因。任何人都可以建议如何设置和使用内部回购来创建 Maven 项目?
在 m2_home 中编辑你 settings.xml,为你的 nexus 添加镜像并创建和设置为没有中央存储库的活动配置文件