如果您正在構建一個zip包進行安裝,您可以使用maven安裝捆綁包,並且不在項目中包含依賴項,爲您的SCM添加額外的空間。
爲此,您可以使用maven-assembly-plugin插件。
例如包括這在你的pom.xml:
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<appendAssemblyId>false</appendAssemblyId>
<descriptors>
<descriptor>src/main/assembly/zip.xml</descriptor>
</descriptors>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
然後在你zip.xml您可以創建一個彙編文件是這樣的:
<?xml version='1.0' encoding='UTF-8'?>
<assembly
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
<id>zip</id>
<formats>
<format>zip</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<fileSets>
<fileSet>
<directory>${basedir}/src/main/content/jcr_root</directory>
<outputDirectory>jcr_root</outputDirectory>
<excludes>
<exclude>**/.DS_Store</exclude>
</excludes>
<filtered>false</filtered>
</fileSet>
</fileSets>
<dependencySets>
<dependencySet>
<outputDirectory>jcr_root/apps/myapp/install</outputDirectory>
<useProjectArtifact>false</useProjectArtifact>
<scope>compile</scope>
<includes>
<include>com.my.groupid:my-maven-artifact-id</include>
</includes>
<useStrictFiltering>true</useStrictFiltering>
</dependencySet>
</dependencySets>
</assembly>
您可以調整依賴集並根據需要設置文件集。顯然,我製作了一個AEM應用程序名稱和maven artifact。