我对maven有一个小问题。当我运行命令 mvn package 时,我收到以下警告:
[警告] JAR 将是空的 - 没有内容被标记为包含!
构建成功,但生成的 jar 文件为空,如警告所示。
为什么会这样,我做错了什么?
这是我的 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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>framework</groupId>
<artifactId>framework</artifactId>
<version>1.0</version>
<packaging>jar</packaging>
<name>framework</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
My dependencies
</dependencies>
<build>
<directory>target</directory>
<outputDirectory>target/classes</outputDirectory>
<finalName>${project.artifactId}-${project.version}</finalName>
<testOutputDirectory>target/test-classes</testOutputDirectory>
<sourceDirectory>src</sourceDirectory>
<scriptSourceDirectory>src</scriptSourceDirectory>
<testSourceDirectory>src</testSourceDirectory>
<testResources>
<testResource>
<directory>test</directory>
</testResource>
</testResources>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<includes>
<include>src</include>
</includes>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
<configuration>
<outputDirectory>lib</outputDirectory>
</configuration>
</plugin>
</plugins>
</build>