Sử dụng maven-lắp ráp-pluginMaven. Làm thế nào để bao gồm thư mục cụ thể hoặc tập tin khi lắp ráp dự án tùy thuộc vào nó là dev xây dựng hoặc sản xuất?
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.1</version>
<configuration>
<descriptors>
<descriptor>descriptor.xml</descriptor>
</descriptors>
<finalName>xxx-impl-${pom.version}</finalName>
<outputDirectory>target/assembly</outputDirectory>
<workDirectory>target/assembly/work</workDirectory>
</configuration>
trong tập tin descriptor.xml chúng ta có thể xác định
<fileSets>
<fileSet>
<directory>src/install</directory>
<outputDirectory>/</outputDirectory>
</fileSet>
</fileSets>
Có thể bao gồm tập tin cụ thể từ các thư mục này hoặc thư mục con tùy thuộc vào Hồ sơ? Hoặc một số cách khác ...
Như thế này:
<profiles>
<profile>
<id>dev</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<build>
<resources>
<resource>
<directory>src/install/dev</directory>
<includes>
<include>**/*</include>
</includes>
</resource>
</resources>
</build>
</profile>
<profile>
<id>prod</id>
<build>
<resources>
<resource>
<directory>src/install/prod</directory>
<includes>
<include>**/*</include>
</includes>
</resource>
</resources>
</build>
</profile>
</profiles>
Nhưng nó đặt nguồn lực trong jar khi đóng gói. Nhưng chúng ta cần phải đặt nó trong zip khi lắp ráp như tôi đã đề cập ở trên :( Cảm ơn
Cảm ơn !!!!!!!!!!!!!!! – whatswrong