用命令行创建AEM项目

现在Eclipse已经有AEM的插件了,可以直接在Eclipse里面New project创建AEM项目。 但是,还是把命令行创建AEM项目的方法po上来,以供参考,欢迎大神指正。


1. 用以下内容替换Maven的settings.xml

<?xml version="1.0" encoding="UTF-8"?>

<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 http://maven.apache.org/xsd/settings-1.0.0.xsd">
  
  <!-- 修改为你本地的Maven仓库路径 -->
  <localRepository>C:/Repositories/Maven</localRepository>   
  
  <profiles>
	<profile>
	    <id>adobe-public</id>
	    <activation>
	        <activeByDefault>false</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 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 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>
  
  <activeProfiles>
    <activeProfile>adobe-public</activeProfile>
  </activeProfiles>
</settings>

2. 在cmd出入以下命令

mvn archetype:generate -DarchetypeRepository=https://repo.adobe.com/nexus/content/groups/public/ -DarchetypeGroupId=com.day.jcr.vault -DarchetypeArtifactId=multimodule-content-package-archetype -DarchetypeVersion=1.0.2 -DgroupId=my-group-id -DartifactId=myproject -Dversion=1.0-SNAPSHOT -Dpackage=com.mycompany.myproject -DappsFolderName=myproject -DartifactName="My Project" -DcqVersion="5.6.1" -DpackageGroup="My Company"

这里是创建一个项目名称为myproject的项目。

执行命令如果报错:the desired archetype does not exist (multimodule-content-package-archetype),需要将https://repo.adobe.com/nexus/content/groups/public/com/day/jcr/vault/multimodule-content-package-archetype/1.0.2/目录下的multimodule-content-package-archetype-1.0.2.jar下载并放到配置的本地仓库对应的目录下。


3. 重新执行2的命令

控制台提示输入(Y::), 输入y,回车

Build Success。 项目创建成功。


另附在Eclipse中创建AEM项目的教程,原贴:http://www.adobeaemclub.com/how-to-set-up-aem-projects-using-eclipse-plugin/



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值