sdo*_*oca 5 java nexus m2eclipse maven maven-archetype
我想使用New Maven Project向导使用原型在Eclipse中创建一个新的Maven项目.在"选择原型"步骤中,我有三个目录可供选择:Nexus Indexer,Internal和Default Local.我不明白这些目录的内容应该来自哪里.如果我点击"配置"按钮,它们都是灰色的,我无法修改它们.
只有Internal目录中列出了任何原型.这些原型来自哪里?它不是来自我的本地Maven存储库,因为组/工件不在其中(并且未列出repo中的原型).
为什么Nexus Indexer列表是空的?我已经阅读了一些Nexus索引需要更新的帖子,但不知道如何更新.这与存储库索引(计划每天更新)不同.
正如您所看到的,我对整个目录业务以及Maven,m2eclipse和Nexus的交互方式有点困惑.任何澄清都是最受欢迎的!
我的设置:
我的本地Maven settings.xml如下所示:
<settings>
<mirrors>
<mirror>
<!--This sends everything else to /public -->
<id>nexus</id>
<mirrorOf>*</mirrorOf>
<url>http://myserver:8080/nexus/content/groups/public</url>
</mirror>
</mirrors>
<profiles>
<profile>
<id>nexus</id>
<!--Enable snapshots for the built in central repo to direct -->
<!--all requests to nexus via the mirror -->
<repositories>
<repository>
<id>central</id>
<url>http://central</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<url>http://central</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<activeProfiles>
<!--make the profile active all the time -->
<activeProfile>nexus</activeProfile>
</activeProfiles>
<servers>
<server>
<id>my-snapshots</id>
<username>user</username>
<password>password</password>
</server>
<server>
<id>my-releases</id>
<username>user</username>
<password>password</password>
</server>
</servers>
</settings>
Run Code Online (Sandbox Code Playgroud)
默认原型目录可以包含新原型。这是一个手动过程,您必须将它们添加到 ~/.m2 目录中的自定义 .xml 文件中。
欲了解更多信息:http://maven.apache.org/archetype/maven-archetype-plugin/specation/archetype-catalog.html
作为参考,这里有一个模板 archetype-catalog.xml
<?xml version="1.0" encoding="UTF-8"?>
<archetype-catalog>
<archetypes>
<archetype>
<groupId>com.spedge</groupId>
<artifactId>archetype-application-custom-filter</artifactId>
<version>1.0-SNAPSHOT</version>
</archetype>
</archetypes>
</archetype-catalog>
Run Code Online (Sandbox Code Playgroud)
另外,这里有一个关于原型的很好的链接:What are the URLs of all the Maven Archetype Catalogs that you know about?