如何发布/使用SNAPSHOT Maven Archetypes

时间:2017-05-24 17:11:10

标签: maven-3 maven-archetype

我正在尝试生成一个SNAPSHOT maven原型,将其发布到Sonatype的OSS回购:https://oss.sonatype.org/content/repositories/snapshots/funcatron/starter/

发布正确。但是,当我尝试从SNAPSHOT mvn archetype:generate时,事情不起作用:

mvn archetype:generate -B \ -DarchetypeGroupId=funcatron \ -DarchetypeArtifactId=starter \ -DarchetypeVersion=0.3.0-SNAPSHOT \ -DgroupId=my.stellar \ -DartifactId=thang \ -DarchetypeRepository=https://oss.sonatype.org/content/repositories/snapshots/

未找到原型:

[INFO] Generating project in Batch mode [WARNING] Archetype not found in any catalog. Falling back to central repository. [WARNING] Add a repsoitory with id 'archetype' in your settings.xml if archetype's repository is elsewhere. [WARNING] The POM for funcatron:starter:jar:0.3.0-SNAPSHOT is missing, no dependency information available [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------

那么......我做错了什么?我是否应该添加pom.xml来发布SNAPSHOT工件,以便通过mvn archetype:generate找到它?

谢谢!

1 个答案:

答案 0 :(得分:0)

在您的settings.xml中添加原型存储库:

   <repository>
      <id>archetype</id>
      <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
    </repository>