【发布时间】:2018-08-21 08:27:39
【问题描述】:
我有一个包含 html、js、css 和 conf 文件的静态项目,如下所示:
project
- static
- conf
conf-int.json
conf-rec.json
conf-prd.json
-js
-html
-images
- pom.xml
- assemblyDescriptor.xml
这是我的程序集描述符:
<id>zip</id>
<baseDirectory>/</baseDirectory>
<formats>
<format>zip</format>
</formats>
<fileSets>
<fileSet>
<directory>static/conf/</directory>
</fileSet>
</fileSets>
</assembly>
这是我在 pom.xml 中的构建配置文件
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.6</version>
<configuration>
<appendAssemblyId>false</appendAssemblyId>
<descriptors>
<descriptor>zip.xml</descriptor>
</descriptors>
</configuration>
<executions>
<execution>
<id>trigger-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
我想使用与我拥有的不同环境相对应的 conf-int.json 或 conf-rec.json 或 conf-prd.json 生成我的 zip。如果它是一个java项目,我会使用带有profil和/或分类器的profil maven。但我不知道如何使用 maven-assembly 为每个环境生成一个 zip 文件。你能给我一些建议吗?
【问题讨论】:
标签: maven-3 development-environment production-environment maven-assembly-plugin