Monday, 26 August 2013

Maven 3 - Empty Jar File

Maven 3 - Empty Jar File

So I have a project that contains common classes and interfaces used in a
variety of sub projects. I have been using maven to build it as a jar
which is then included as a dependency in other maven projects.
For some reason, it is currently building jar files with no class files
only a META-INF folder. This is breaking the builds of my projects that
have this listed as a dependency. It is also outputting the following
warning:
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ MyProject ---
[WARNING] JAR will be empty - no content was marked for inclusion!
I don't understand why it thinks there is nothing to include. I thought by
default it included everything. Here is the relevant pom.xml
<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.domain.app</groupId>
<artifactId>MyApp</artifactId>
<packaging>jar</packaging>
<version>1.2.1</version>
<name>MyApp</name>
<url>http://www.mydomain.com</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
.....
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
</plugin>
</plugins>
</build>
</project>

No comments:

Post a Comment