首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Maven找不到AEM原型

Maven找不到AEM原型
EN

Stack Overflow用户
提问于 2019-05-24 19:02:00
回答 3查看 5.5K关注 0票数 3

我从这个问题开始已经很久了.我正在通过Adobe项目工作,我无法传递这个命令,而且大部分工作都是由它构建的。

代码语言:javascript
复制
mvn archetype:generate \
  -DarchetypeGroupId=com.adobe.granite.archetypes \
  -DarchetypeArtifactId=aem-project-archetype \
  -DarchetypeVersion=18

我已经在VPN和off上尝试过了,使用了所有可能的代理吐露,但是仍然得到了相同的错误

代码语言:javascript
复制
Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:3.1.0:generate (default-cli) on project standalone-pom: The desired archetype does not exist (com.adobe.granite.archetypes:aem-project-archetype:18)

多次删除和重新安装。不同的网络和代理也透露了Mac。

mvn -v返回

代码语言:javascript
复制
Maven home: /Users/dmills/Applications/apache-maven-3.6.1
Java version: 1.8.0_212, vendor: Oracle Corporation, runtime: /Library/Java/JavaVirtualMachines/jdk1.8.0_212.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.14.5", arch: "x86_64", family: "mac"

得到这个错误

代码语言:javascript
复制
Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:3.1.0:generate (default-cli) on project standalone-pom: The desired archetype does not exist (com.adobe.granite.archetypes:aem-project-archetype:18)

建设失败了,我不知道现在该去哪里

EN

回答 3

Stack Overflow用户

回答已采纳

发布于 2019-05-24 21:26:32

错误指示没有配置包含要使用的原型的Maven存储库。默认Maven安装不知道包含原型的Adobe存储库。您必须配置存储库。

通常,您应该为您的AEM项目使用以下存储库:

代码语言:javascript
复制
http://repo.adobe.com/nexus/content/groups/public

这个存储库包含您想要使用的原型:

https://repo.adobe.com/nexus/content/groups/public/com/adobe/granite/archetypes/aem-project-archetype/18/

根据文档(请参阅下面的链接),这将是一个最小的Maven settings.xml,允许您使用AEM原型:

代码语言:javascript
复制
<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">

  <profiles>
    <profile>
      <id>adobe-public</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
      <properties>
        <releaseRepository-Id>adobe-public-releases</releaseRepository-Id>
        <releaseRepository-Name>Adobe Public Releases</releaseRepository-Name>
        <releaseRepository-URL>http://repo.adobe.com/nexus/content/groups/public</releaseRepository-URL>
      </properties>
      <repositories>
        <repository>
          <id>adobe-public-releases</id>
          <name>Adobe Basel Public Repository</name>
          <url>http://repo.adobe.com/nexus/content/groups/public</url>
          <releases>
            <enabled>true</enabled>
            <updatePolicy>never</updatePolicy>
          </releases>
          <snapshots>
            <enabled>false</enabled>
          </snapshots>
        </repository>
      </repositories>
      <pluginRepositories>
        <pluginRepository>
          <id>adobe-public-releases</id>
          <name>Adobe Basel Public Repository</name>
          <url>http://repo.adobe.com/nexus/content/groups/public</url>
          <releases>
            <enabled>true</enabled>
            <updatePolicy>never</updatePolicy>
          </releases>
          <snapshots>
            <enabled>false</enabled>
          </snapshots>
        </pluginRepository>
      </pluginRepositories>
    </profile>
  </profiles>
</settings> 

注意:我将activeByDefault设置为true作为adobe-public配置文件。这样,您就不需要在命令行上传递-Padobe-public来激活配置文件。

现在,如果您运行以下命令,您应该能够使用原型:

代码语言:javascript
复制
mvn archetype:generate \
  -DarchetypeGroupId=com.adobe.granite.archetypes \
  -DarchetypeArtifactId=aem-project-archetype \
  -DarchetypeVersion=18

链接

https://helpx.adobe.com/experience-manager/kb/SetUpTheAdobeMavenRepository.html

票数 4
EN

Stack Overflow用户

发布于 2019-05-26 16:05:42

在Adobe中,缺少了“设置”xml标记:

代码语言:javascript
复制
<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">

 <profiles>
     <profile>

      .....

     </profile>
   </profiles>
</settings> 
票数 0
EN

Stack Overflow用户

发布于 2019-05-29 06:39:23

只需更新settings.xml文件夹中的m2文件即可。如果您使用archtype 13和6.4,请查看下面的链接

arch13.html

另外,在配置文件标签中,请将更新为'https‘而不是http。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/56298294

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档