私は自分の Maven プロジェクトを Netbeans で書きました。自分のプロジェクト (dao、service..) のテストを書きました。すべてのテストは正しいですが、プロジェクトをビルドまたはテストすると、コンパイルするテストがないと maven に表示されます。maven-surefire-plugin を使用しているので、pom.xml に含めます。
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.10</version>
<dependencies>
<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire-junit47</artifactId>
<version>2.10</version>
</dependency>
</dependencies>
<configuration>
<testFailureIgnore>true</testFailureIgnore>
<reportsDirectory>${project.build.directory}/surefire-reports</reportsDirectory>
</configuration>
私はsurefire-pluginに何か問題があると思います..
それは:
Scanning for projects...
------------------------------------------------------------------------
Building Employeers 1.0.0-BUILD-SNAPSHOT
------------------------------------------------------------------------
[aspectj:compile]
[resources:resources]
[debug] execute contextualize
Using 'UTF-8' encoding to copy filtered resources.
Copying 4 resources
[compiler:compile]
Nothing to compile - all classes are up to date
[aspectj:test-compile]
[resources:testResources]
[debug] execute contextualize
Using 'UTF-8' encoding to copy filtered resources.
Copying 1 resource
[compiler:testCompile]
Nothing to compile - all classes are up to date
[surefire:test]
Surefire report directory: C:\Users\Администратор\Documents\NetBeansProjects\Employeers\target\surefire-reports
Using configured provider org.apache.maven.surefire.junitcore.JUnitCoreProvider
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Error: An unexpected error occurred while trying to open file C:\Users\?????????????\Documents\NetBeansProjects\Employeers\target\surefire\surefirebooter472050683580306804.jar
Results :
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
[war:war]
Packaging webapp
Assembling webapp [Employeers] in [C:\Users\Администратор\Documents\NetBeansProjects\Employeers\target\Employeers-1.0.0-BUILD-SNAPSHOT]
Processing war project
Copying webapp resources [C:\Users\Администратор\Documents\NetBeansProjects\Employeers\src\main\webapp]
Webapp assembled in [590 msecs]
Building war: C:\Users\Администратор\Documents\NetBeansProjects\Employeers\target\Employees.war
Warning: selected war files include a WEB-INF/web.xml which will be ignored
(webxml attribute is missing from war task, or ignoreWebxml attribute is specified as 'true')
------------------------------------------------------------------------
BUILD SUCCESS
------------------------------------------------------------------------
Total time: 5.258s
Finished at: Fri Jul 27 19:47:07 EEST 2012
Final Memory: 6M/16M
------------------------------------------------------------------------