I'm using maven-assembly-plugin
to create a output jar from my maven project. The relevant protions of my pom.xml
look like this:
.
.
.
<dependencies>
<dependency>
.
.
.
</dependency>
.
.
.
</dependencies>
<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
.
.
.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<archive>
<manifest>
<mainClass>my.package.TheApp</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
</plugin>
.
.
.
</plugins>
</build>
.
.
.
When I run `mvn clean install assembly:single`` the resulting jar file does contain the dependencies, but it does not contain my project files. Running the jar with
java -jar TheApp-0.1.2-SNAPSHOT-jar-with-dependencies.jar
I get the message Error: Could not find or load main class my.package.TheApp
. So how can I include my project files? (I thought of setting useProjectArtifact
, but according to the maven-assembly-plugin doco this property is by default true
.)