"mvn test" or "mvn package" error - Failed to clean uo temp dirs caused by secret.key

57 views
Skip to first unread message

sneha shejwal

unread,
Nov 21, 2016, 5:52:40 PM11/21/16
to Jenkins Developers
Hi All,

I am modifying existing Jenkins plugin as per my specific requirement.

I got the plugin code (zip file) from github. When I try to run commands "mvn test", "mvn package" or "mvn clean package" (from the folder where I have unzipped the plugin code), I am getting below errors:

[INFO] --- maven-surefire-plugin:2.18.1:test (default-test) @ delivery-pipeline-plugin ---
[WARNING] useSystemClassloader setting has no effect when not forking
[INFO] Surefire report directory: C:\Users\sshejwal\Downloads\delivery-pipeline-plugin-master\target\surefire-reports
Running InjectedTest
Tests run: 21, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 45.788 sec <<< FAILURE! - in InjectedTest
org.jvnet.hudson.test.JellyTestSuiteBuilder$JellyTestSuite(org.jvnet.hudson.test.junit.FailedTest)  Time elapsed: 0.002 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)
....
....
Caused by: java.nio.file.FileSystemException: C:\Users\sshejwal\AppData\Local\Temp\hudson7679380230230411283test\secret.key: The process cannot access the file because it is being used by another process.


I even tried to cover the all maven life-cycle phases (https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html):
validate - passed
compile - passed
test - failed with above same errors
package - failed

Can you please guide me what am I missing or doing wrong here?

Thanks,
Sneha

Jesse Glick

unread,
Nov 21, 2016, 6:07:40 PM11/21/16
to Jenkins Dev
On Mon, Nov 21, 2016 at 11:52 PM, sneha shejwal <shejwa...@gmail.com> wrote:
> Can you please guide me what am I missing or doing wrong here?

Make sure you are using the latest 2.x parent POM, which should by
default pull in a current version of `jenkins-test-harness`.

sneha shejwal

unread,
Nov 21, 2016, 7:20:39 PM11/21/16
to Jenkins Developers
Hi Jesse,

Thank you so much for the reply. I changed the <parent> POM version to latest which is 2.2 and tried to run "mvn test". It failed with different errors:

Generating C:\Users\sshejwal\Downloads\delivery-pipeline-plugin-master\target\site\apidocs\help-doc.html...
2 warnings
[WARNING] Javadoc Warnings
[WARNING] C:\Users\sshejwal\Downloads\delivery-pipeline-plugin-master\src\main\java\se\diabol\jenkins\pipeline\domain\results\TestResult.java:21: error: package hudson.tasks.test does not exist
[WARNING] import hudson.tasks.test.AbstractTestResultAction;
[WARNING] ^
[WARNING] C:\Users\sshejwal\Downloads\delivery-pipeline-plugin-master\src\main\java\se\diabol\jenkins\pipeline\util\ProjectUtil.java:63: warning - Tag @see: can't find getAllDownstreamProjects(hudson.model.AbstractProject, java.util.Map) in se.diabol.jenkins.pipeline.util.ProjectUtil
[INFO]
[INFO] --- maven-resources-plugin:2.7:resources (default-resources) @ delivery-pipeline-plugin ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 49 resources
[INFO]
[INFO] --- maven-compiler-plugin:2.4:compile (default-compile) @ delivery-pipeline-plugin ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- animal-sniffer:1.2:check (animal-sniffer) @ delivery-pipeline-plugin ---
[INFO] Checking unresolved references to org.jvnet.animal-sniffer:java1.6:1.0
[ERROR] Undefined reference: hudson/tasks/test/AbstractTestResultAction in C:\Users\sshejwal\Downloads\delivery-pipeline-plugin-master\target\classes\se\diabol\jenkins\pipeline\domain\results\TestResult.class
[ERROR] Undefined reference: hudson/tasks/test/AbstractTestResultAction.getDisplayName()Ljava/lang/String; in C:\Users\sshejwal\Downloads\delivery-pipeline-plugin-master\target\classes\se\diabol\jenkins\pipeline\domain\results\TestResult.class
[ERROR] Undefined reference: hudson/tasks/test/AbstractTestResultAction.getUrlName()Ljava/lang/String; in C:\Users\sshejwal\Downloads\delivery-pipeline-plugin-master\target\classes\se\diabol\jenkins\pipeline\domain\results\TestResult.class
[ERROR] Undefined reference: hudson/tasks/test/AbstractTestResultAction.getFailCount()I in C:\Users\sshejwal\Downloads\delivery-pipeline-plugin-master\target\classes\se\diabol\jenkins\pipeline\domain\results\TestResult.class
[ERROR] Undefined reference: hudson/tasks/test/AbstractTestResultAction.getSkipCount()I in C:\Users\sshejwal\Downloads\delivery-pipeline-plugin-master\target\classes\se\diabol\jenkins\pipeline\domain\results\TestResult.class
[ERROR] Undefined reference: hudson/tasks/test/AbstractTestResultAction.getTotalCount()I in C:\Users\sshejwal\Downloads\delivery-pipeline-plugin-master\target\classes\se\diabol\jenkins\pipeline\domain\results\TestResult.class
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 36.746 s
[INFO] Finished at: 2016-11-21T16:05:47-08:00
[INFO] Final Memory: 106M/1153M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.jvnet:animal-sniffer:1.2:check (animal-sniffer) on project delivery-pipeline-plugin: Signature errors found. Verify them and put @IgnoreJRERequirement on them. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:


Do you have any idea about these? Also when I tried to run "mvn compile" the command throws the same above errors. I am not sure if the warnings matter, as ProjectUtil.java has method definition for "getAllDownstreamProjects". So not sure why it's complaining about not finding this method.

Thanks,
Sneha

Jesse Glick

unread,
Nov 22, 2016, 10:52:01 AM11/22/16
to Jenkins Dev
On Tue, Nov 22, 2016 at 1:20 AM, sneha shejwal <shejwa...@gmail.com> wrote:
> I changed the <parent> POM version to
> latest which is 2.2

As of this writing the latest is 2.19.

> [ERROR] Undefined reference: hudson/tasks/test/AbstractTestResultAction in
> C:\Users\sshejwal\Downloads\delivery-pipeline-plugin-master\target\classes\se\diabol\jenkins\pipeline\domain\results\TestResult.class

Did you specify a `jenkins.version` in your POM to select a particular
baseline, as you must do when using the 2.x parent? Seems like you are
now building against a newer Jenkins release after the split of the
`junit` plugin, and you are failing to declare a dependency on that
plugin.

sneha shejwal

unread,
Nov 22, 2016, 1:31:05 PM11/22/16
to Jenkins Developers
Hi Jesse,

Thank for correcting me about the version. The POM.xml doesn't have the parameter "jenkins.vesrion". I will try updating the POm with these version and give it a try. 

Thanks,
Sneha

Baptiste Mathus

unread,
Nov 23, 2016, 4:43:25 PM11/23/16
to Jenkins Developers
For future reference, also do NOT use any version of the plugin parent pom that is not 2.5+. 

If you use something <2.5, you're most probably going to hit INFRA-588.

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-dev+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/d40fede0-dbc0-412a-a24d-8402573745f7%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages