Maven无法找到AEM原型

时间:2019-05-24 19:02:00

标签: maven aem

我在这个问题上已经走了很长时间了……我正在研究Adobe wknd项目,但我无法通过此命令,并且大部分工作都是基于

mvn archetype:generate \
  -DarchetypeGroupId=com.adobe.granite.archetypes \
  -DarchetypeArtifactId=aem-project-archetype \
  -DarchetypeVersion=18

我已经在VPN上进行了尝试,并且关闭了所有可能的代理配置,并且仍然收到

的相同错误
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 OS。

mvn -v返回

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"

遇到此错误

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)

构建失败,我不知道现在要去哪里

3 个答案:

答案 0 :(得分:1)

该错误表明未配置任何包含要使用的原型的Maven存储库。默认的Maven安装不知道包含原型的Adobe存储库。您必须配置存储库。

通常,对于AEM项目,应使用以下存储库:

Column0

此存储库包含您要使用的原型:

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

根据文档(请参阅下面的链接),这将是最小的Maven http://repo.adobe.com/nexus/content/groups/public ,可让您使用AEM Maven原型:

settings.xml

注意:我为<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

链接

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

答案 1 :(得分:0)

在Adobe个人资料中,缺少“设置” xml标签:

<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> 

答案 2 :(得分:0)

只需更新m2文件夹中的settings.xml文件。如果您使用的是原型13和6.4,请查看以下链接

https://helpx.adobe.com/experience-manager/using/maven_arch13.html

还要在个人资料标签中,将adobe存储库网址更新为“ https”,而不是http。