0

I've used maven-one-jar plugin , exported runnable jars and used them.
Can I export a test-one-jar containing the junit test classes along with the other dependencies using this plugin?

What changes should I make in the pom(.xml) configuration?

4

1 回答 1

0

创建 test-jar 的最佳解决方案是简单地使用 maven-jar-plugin,如下所示:

<project>
  ...
  <build>
    <plugins>
      ...
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <version>2.4</version>
        <executions>
          <execution>
            <goals>
              <goal>test-jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      ...
    </plugins>
  </build>
  ...
</project>
于 2013-07-01T19:50:21.853 回答