1

如何正确复制 maven2 的行为?

<build>
    <sourceDirectory>src/java</sourceDirectory>
    <resources>
        <resource>
            <directory>src/etc/</directory>
            <include>atlassian-plugin.xml</include>
            <include>**/*.vm</include>
        </resource>
    </resources>
    <unitTestSourceDirectory>test/java</unitTestSourceDirectory>
    <unitTest>
        <includes>
            <include>**/*Test.java</include>
            <include>**/Test*.java</include>
        </includes>
        <excludes>
            <exclude>**/Abstract*.java</exclude>
        </excludes>
        <resources>
            <resource>
                <directory>test/etc</directory>
            </resource>
        </resources>
    </unitTest>
</build>
4

1 回答 1

2

它会是这样的:

<build>
  <sourceDirectory>src/java</sourceDirectory>
  <resources>
    <resource>
      <directory>src/etc/</directory>
      <includes>
        <include>atlassian-plugin.xml</include>
        <include>**/*.vm</include>
      </includes>
    </resource>
  </resources>
  <testSourceDirectory>test/java</testSourceDirectory>
  <testResources>
    <testResource>
      <directory>test/etc</directory>
    </testResource>
  </testResources>
  <pluginManagement>
    <plugins>
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <includes>
            <include>**/*Test.java</include>
            <include>**/Test*.java</include>
          </includes>
          <excludes>
            <exclude>**/Abstract*.java</exclude>
          </excludes>
        </configuration>
      </plugin>
    </plugins>
  </pluginManagement>
</build>
于 2012-04-24T08:39:56.333 回答