我有一个死的简单的pom:
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>com.sandbox</groupId>
<name>Sandbox</name>
<artifactId>Sandbox</artifactId>
<version>7.0</version>
<packaging>ear</packaging>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
...
</dependencies>
</project>
当包装标记为“jar”时,它将获得src / main / resources中的所有资源。但如果包装标记为“耳朵”,则它不会在包装中获得任何这些资源。我想这样做的原因是因为我想将glassfish-resources.xml文件放在我耳朵的META-INF目录中。 This is a valid place to put the file.