小牛只包括一些课程
我的项目中有多个类,但是对于一个特定的罐子,我不想将所有类放入罐子中。
<profile>
<id>test</id>
<build>
<finalName>THRechner-test</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.2</version>
<configuration>
<includes>
<include>my.koque.threchner.Einheiten</include>
</includes>
</configuration>
</plugin>
</plugins>
</build>
</profile>
然后,我运行以下命令:mvn Clean Package -ptest
,但是该类未放入JAR中。在没有包含行的情况下运行命令确实将所有文件都放入JAR中。
如何将一个班级加入罐子中?
I have multiple classes in my project, but for a specific jar I don't want to put all classes into the jar.
<profile>
<id>test</id>
<build>
<finalName>THRechner-test</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.2</version>
<configuration>
<includes>
<include>my.koque.threchner.Einheiten</include>
</includes>
</configuration>
</plugin>
</plugins>
</build>
</profile>
Then I run the following command: mvn clean package -Ptest
, but the class is not put into the jar. Running the command without the include lines does put all files into the jar.
How can I just include one class into the jar?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您必须像这样配置JAR插件:
You must configure the jar plugin like this :