gpt4 book ai didi

java - 某些文件的 maven-assembly-plugin

转载 作者:行者123 更新时间:2023-11-30 06:38:52 27 4
gpt4 key购买 nike

我有一个多模块项目,这是父 pom。

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.atoms</groupId>
<artifactId>atoms-parent</artifactId>
<packaging>pom</packaging>
<version>1.0</version>
<url/>
<modules>
<module>atoms-persistence</module>
<module>atoms-reglas</module>
<module>atoms-webservice</module>
</modules>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>

<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptors>
<descriptor>assemble.xml</descriptor>
</descriptors>
</configuration>
</plugin>
</plugins>
</build>
</project>

在 atoms-persitence 项目中,我有以下文件:

com.atoms.vo.*

com.atoms.service.*

com.atoms.dao.*

在 atoms-reglas 中我有:

com.atoms.rules.*

我怎样才能使用程序集插件制作一个只有以下类的 jar:

com.atoms.vo.* 和 com.atoms.rules.* ?

最佳答案

按照这些思路尝试一些事情:

<assembly>
<id>atoms</id>
<formats>
<format>jar</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<fileSets>
<fileSet>
<directory>${basedir}/target/classes
</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>com/atoms/vo.**</include>
<include>com/atoms/rules/**</include>
</includes>
</fileSet>
</fileSets>
</assembly>

关于java - 某些文件的 maven-assembly-plugin,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1784077/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com