在PlayN中,如何从Maven排除目录? [英] In PlayN, how do you exclude a directory from being compiled by Maven?
本文介绍了在PlayN中,如何从Maven排除目录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想使用maven从命令行构建我的游戏的html版本.但是,当我为core
文件夹运行package
命令时:
I want to build the html version of my game from the command line using maven. However, when I run the package
command for the core
folder:
mvn clean package -pl core,html
由于在源路径中进行了一些单元测试,因此出现以下错误:
I get the following errors because of some unit tests in my source path:
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /home/klenwell/projects/mygame/playn/mygame/core/src/main/java/mygame/playn/tests/unit/UserDataTest.java:[3,23] package org.junit does not exist
[ERROR] /home/klenwell/projects/mygame/playn/mygame/core/src/main/java/mygame/playn/tests/unit/UserDataTest.java:[7,16] package org.junit does not exist
...
如何将包含这些测试文件的目录排除在编译范围之外?
How can I exclude the directory with these test files from being included in the compilation?
推荐答案
将以下代码段添加到我的核心pom.xml
文件的plugins
部分中,将测试从编译中排除,并允许构建成功:
Adding the following block to the plugins
section of my core pom.xml
file excluded tests from compilation and allowed the build to succeed:
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<excludes>
<exclude>**/*Test*.java</exclude>
</excludes>
</configuration>
</plugin>
这篇关于在PlayN中,如何从Maven排除目录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文