我不想修改名为部署插件的 Jenkins -Plugin。如果我maven安装插件, InjectedTest 会遇到FileSystemException:
C:\用户\泡沫\应用程序数据\本地\ TEMP \ hudson2805772493654455072test \ secret.key: Der Prozess kann nicht auf die Datei zugreifen,da sie von einem anderen Prozess verwendet wird。
英文:
C:\ Users \ froth \ AppData \ Local \ Temp \ hudson2805772493654455072test \ secret.key:进程无法访问该文件,因为正在使用该文件 另一个过程。
我认为这只是VM或Windows7的读/写问题。有谁知道如何解决这个问题?
PS :以下是 StackTrace :
T E S T S
-------------------------------------------------------
Running hudson.plugins.deploy.glassfish.GlassFish2xAdapterTest
Running hudson.plugins.deploy.glassfish.GlassFish3xAdapterTest
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.229 sec - in hudson.plugins.deploy.glassfish.GlassFish2xAdapterTest
Running hudson.plugins.deploy.glassfish.GlassFishAdapterTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.012 sec - in hudson.plugins.deploy.glassfish.GlassFishAdapterTest
Running hudson.plugins.deploy.PasswordProtectedAdapterCargoTest
Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.251 sec - in hudson.plugins.deploy.glassfish.GlassFish3xAdapterTest
Running hudson.plugins.deploy.tomcat.Tomcat7xAdapterTest
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.004 sec - in hudson.plugins.deploy.tomcat.Tomcat7xAdapterTest
Running InjectedTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.251 sec - in hudson.plugins.deploy.PasswordProtectedAdapterCargoTest
Tests run: 8, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 12.069 sec <<< FAILURE! - in InjectedTest
org.jvnet.hudson.test.JellyTestSuiteBuilder$JellyTestSuite(org.jvnet.hudson.test.junit.FailedTest) Time elapsed: 0.005 sec <<< ERROR!
java.io.IOException: Failed to clean up temp dirs
at org.jvnet.hudson.test.TemporaryDirectoryAllocator.dispose(TemporaryDirectoryAllocator.java:86)
at org.jvnet.hudson.test.TestEnvironment.dispose(TestEnvironment.java:81)
at org.jvnet.hudson.test.HudsonTestCase.tearDown(HudsonTestCase.java:414)
at org.jvnet.hudson.test.JellyTestSuiteBuilder$JellyTestSuite.tearDown(JellyTestSuiteBuilder.java:138)
at org.jvnet.hudson.test.junit.GroupedTest.run(GroupedTest.java:53)
at junit.framework.TestSuite.runTest(TestSuite.java:255)
at junit.framework.TestSuite.run(TestSuite.java:250)
at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:84)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:264)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:124)
at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:200)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
Caused by: java.nio.file.FileSystemException: C:\Users\froth\AppData\Local\Temp\hudson2805772493654455072test\secret.key: Der Prozess kann nicht auf die Datei zugreifen, da sie von einem anderen Prozess verwendet wird.
答案 0 :(得分:5)
我在Windows 7上遇到了同样的问题,并通过进一步的分析打开了https://issues.jenkins-ci.org/browse/JENKINS-21977。
但是,作为临时解决方法,您可以通过将以下内容添加到pom.xml来禁用注入的测试:
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<excludes>
<exclude>InjectedTest.java</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>
答案 1 :(得分:0)
作为时间解决方案(从上一个答案中已打开的问题link中的第一个评论)将父pom的版本更改为1.539确实解决了编译问题;它与我完美配合,无需跳过测试。