我有一个小问题与maven.当我运行命令mvn包我得到以下警告:
为什么这样我做错了什么?
这是我的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>
解决方法
我希望你有很好的理由不要遵循
standard directory layout,否则考虑重新安排文件夹:这将使你的生活更容易(以及同事). 我的猜测是没有编辑过.在这种情况下:删除maven-compiler-plugin的配置应该是足够的.