Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/mercurial/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Maven无法找到AEM原型_Maven_Aem - Fatal编程技术网

Maven无法找到AEM原型

Maven无法找到AEM原型,maven,aem,Maven,Aem,我已经开始研究这个问题很久了。。。我正在处理AdobeWKND项目,我无法通过这个命令,大部分工作都是用它来完成的 mvn archetype:generate \ -DarchetypeGroupId=com.adobe.granite.archetypes \ -DarchetypeArtifactId=aem-project-archetype \ -DarchetypeVersion=18 我在VPN上尝试过,也尝试过关闭,使用了所有可能的代理配置,但仍然得到相同的错误 F

我已经开始研究这个问题很久了。。。我正在处理AdobeWKND项目,我无法通过这个命令,大部分工作都是用它来完成的

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)

构建失败,我现在不知道该去哪里了。错误表明没有配置包含要使用的原型的Maven存储库。默认Maven安装不知道包含原型的Adobe存储库。您必须配置存储库

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

http://repo.adobe.com/nexus/content/groups/public
此存储库包含要使用的原型:

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

<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> 
mvn archetype:generate \
  -DarchetypeGroupId=com.adobe.granite.archetypes \
  -DarchetypeArtifactId=aem-project-archetype \
  -DarchetypeVersion=18
链接


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

.....

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


在配置文件标签中,请将adobe repo url更新为“https”,而不是http。

就是这样。谢谢将activeByDefault设置为true使其对我有效。谢谢但是-Padobe公共属性将如何工作?这会是mvn原型的一部分吗:generate命令?我已经盯着它太久了,放弃了它,但现在我正在再试一次。我每次也会遇到构建失败。“入门”第1章第2步说明中说明了“创建Maven原型”,但使用命令、PowerShell和Git Bash失败。在命令中,我从C:\>运行这个命令,并尝试从另一个新创建的目录运行,但总是失败。安装了所有先决条件(Maven、Java等)。