0
アプリケーション(war/jar)のパッケージ化の一部として、アプリケーションのすべての構成をzipファイルとしてパッケージ化したいと考えています。これを簡単に達成するための規約やプラグインがありますか?ビルドプロセス中にzipとしてファイルをパッケージ化するためにmavenを使用するには?
アプリケーション(war/jar)のパッケージ化の一部として、アプリケーションのすべての構成をzipファイルとしてパッケージ化したいと考えています。これを簡単に達成するための規約やプラグインがありますか?ビルドプロセス中にzipとしてファイルをパッケージ化するためにmavenを使用するには?
パッケージ化するファイルの詳細を含むassembly.xmlを作成します。次に、pom.xmlに以下のようにassembly.xmlファイルを設定します。
assembly.xml
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0 http://maven.apache.org/xsd/assembly-2.0.0.xsd">
<id>project-name</id>
<formats>
<format>
zip
</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<fileSets>
<fileSet>
<outputDirectory>project/config</outputDirectory>
<directory>${project.basedir}/src/main/resources/config</directory>
<!--To include single file into the zip -->
<includes>
<include>singlefile.conf</include>
</includes>
</fileSet>
</fileSets>
</assembly>
のpom.xml
<build>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<descriptors>
<descriptor>assembly.xml</descriptor>
</descriptors>
</configuration>
<executions>
<execution>
<id>create-archive</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
が、私は見てみましょうすることをお勧め:https://github.com/khmarbaise/multienv-maven-プラグイン/ – khmarbaise