I need to use the plugin maven assembly from wrap one class of my application in a jar. when i use maven, the plugin assembly package all class in my package in target jar. how to specify the class i want to packaged in my jar.
Asked
Active
Viewed 234 times
-3
-
2Please post your project directory layout and your POM file. – nwinkler Mar 27 '13 at 10:55
1 Answers
2
Do you have to use the maven assembly plugin? If you want to generate a jar file you could use the maven jar plugin instead.
It would be something like that:
<project>
...
<build>
<plugins>
...
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
<configuration>
<includes>
<include>com/company/project/package/SomeClass.class</include>
<include>com/company/project/anotherpackage/AnotherClass.class</include>
</includes>
</configuration>
</plugin>
...
</plugins>
</build>
...
</project>
The plugin can be executed in a common mvn package
execution.

Filipe Fedalto
- 2,540
- 1
- 18
- 21
-
thank you for answer. the issue is same when i use the maven assembly. the archive Jar contains all class in my package. – Brahim ELOUARDINI Mar 27 '13 at 10:51