简体   繁体   English

所需的原型不存在

[英]The desired archetype does not exist

When calling Maven to generate an archetype following the instructions at https://confluence.sakaiproject.org/display/BOOT/Sakai+Spring+MVC+Maven+Archetype , Maven complains about the archetype being inexistent, even though the file is located in the given archetype respository: https://source.sakaiproject.org/maven2/org/sakaiproject/maven-archetype/sakai-spring-maven-archetype/1.2/sakai-spring-maven-archetype-1.2.pom .当按照https://confluence.sakaiproject.org/display/BOOT/Sakai+Spring+MVC+Maven+Archetype 中的说明调用 Maven 生成原型时,Maven 会抱怨原型不存在,即使文件位于给定的原型库: https ://source.sakaiproject.org/maven2/org/sakaiproject/maven-archetype/sakai-spring-maven-archetype/1.2/sakai-spring-maven-archetype-1.2.pom。

Maven version is: Maven 版本是:

>mvn -version
Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)

This is what happens - it looks like the -DarchetypeRepository parameter is ignored:这就是发生的事情 - 看起来-DarchetypeRepository参数被忽略:

> mvn archetype:generate -DarchetypeGroupId=org.sakaiproject.maven-archetype
     -DarchetypeArtifactId=sakai-spring-maven-archetype
     -DarchetypeVersion=1.2
     -DarchetypeRepository=https://source.sakaiproject.org/maven2
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------< org.apache.maven:standalone-pom >-------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] >>> maven-archetype-plugin:3.1.2:generate (default-cli) > generate-sources @ standalone-pom >>>
[INFO]
[INFO] <<< maven-archetype-plugin:3.1.2:generate (default-cli) < generate-sources @ standalone-pom <<<
[INFO]
[INFO]
[INFO] --- maven-archetype-plugin:3.1.2:generate (default-cli) @ standalone-pom ---
[INFO] Generating project in Interactive mode
[WARNING] Archetype not found in any catalog. Falling back to central repository.
[WARNING] Add a repository with id 'archetype' in your settings.xml if archetype's repository is elsewhere.
[WARNING] The POM for org.sakaiproject.maven-archetype:sakai-spring-maven-archetype:jar:1.2 is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  4.395 s
[INFO] Finished at: 2020-01-11T12:24:20+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:3.1.2:generate (default-cli) on project standalone-pom: The desired archetype does not exist (org.sakaiproject.maven-archetype:sakai-spring-maven-archetype:1.2) -> [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

Turns out that Maven 3 changed the way archetype repositories are integrated.事实证明,Maven 3 改变了原型存储库的集成方式。 The -DarchetypeRepository parameter is not there anymore. -DarchetypeRepository参数不再存在。 Instead, archteype repositories need to be added to settings.xml :相反,需要将 archteype 存储库添加到settings.xml

<profiles>
    <profile>
      <!-- the profile id is arbitrary --> 
      <id>sakai</id>
      <repositories>
        <repository>
          <!-- the repository id has to be named: archetype -->
          <id>archetype</id>
          <name>Repository for Sakai archetypes</name>
          <url>https://source.sakaiproject.org/maven2/</url>
          <releases>
            <enabled>true</enabled>
            <checksumPolicy>fail</checksumPolicy>
          </releases>
          <snapshots>
            <enabled>true</enabled>
            <checksumPolicy>warn</checksumPolicy>
          </snapshots>
        </repository>
      </repositories>
    </profile>
</profiles>

<!-- The profile needs to be added to activeProfiles in order to be taken into account -->
<activeProfiles>
    <activeProfile>sakai</activeProfile>
</activeProfiles>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 myeclipse2014 create maven项目:所需的原型不存在 - myeclipse2014 create maven project :The desired archetype does not exist maven错误:所需的原型不存在(org.phpmaven:php5-web-archetype:2.0-SNAPSHOT) - maven error: The desired archetype does not exist (org.phpmaven:php5-web-archetype:2.0-SNAPSHOT) 所需的原型不存在-org.apache.maven.archetype.quickstart:1.0 - The desired archetype does not exist— org.apache.maven.archetype.quickstart:1.0 使用 bintray 中的原型时,Maven 报告“所需的原型不存在” - Maven reports 'The desired archetype does not exist' when using archetype from bintray UnknownArchetype:所需的原型不存在(org.apache.maven.archetypes:maven-archetype-quickstart) - UnknownArchetype: The desired archetype does not exist (org.apache.maven.archetypes:maven-archetype-quickstart) Maven 快速入门原型不存在 - Maven Quickstart Archetype does not exist OpenJFX Maven 原型不存在? - OpenJFX Maven archetype does not exist? 未能执行目标生成 - 所需的原型不存在(org:flink-walkthrough-datastream-java) - Failed to execute goal generate - desired archetype does not exists (org:flink-walkthrough-datastream-java) 如何调试“插件&#39;org.apache.maven.plugins:maven-archetype-plugin&#39;不存在或找不到有效版本”? - How to debug "The plugin 'org.apache.maven.plugins:maven-archetype-plugin' does not exist or no valid version could be found"? 在创建新的Maven项目时找不到所需的原型 - Cant find desired archetype when creating new Maven project
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM