Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-5044

FileNotFoundException in hudson.maven.ExecutedMojo

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved (View Workflow)
    • Critical
    • Resolution: Fixed
    • maven-plugin
    • None
    • Maven 2.2.1, Hudson 1.336, Java 1.6, Linux/WinXP

    Description

      I have a multimodule maven project, where one sub-module is my ues-build-helper maven-plugin.

      When I build this project from command line, it is OK. But when I run the same build from Hudson, I obtain following exception in build-log and the build fails.

      java.io.FileNotFoundException: /home/devel/workspace/hudson/jobs/ues.platform-compile/workspace/maven/ues-build-helper/target/classes (Is a directory)
      at java.io.FileInputStream.open(Native Method)
      at java.io.FileInputStream.<init>(FileInputStream.java:106)
      at hudson.maven.ExecutedMojo.<init>(ExecutedMojo.java:94)
      at hudson.maven.MavenModuleSetBuild$Builder.postExecute(MavenModuleSetBuild.java:745)
      at hudson.maven.MavenBuilder$Adapter.postExecute(MavenBuilder.java:287)
      at hudson.maven.agent.PluginManagerInterceptor$1MojoIntercepterImpl.callPost(PluginManagerInterceptor.java:170)
      at hudson.maven.agent.PluginManagerInterceptor.executeMojo(PluginManagerInterceptor.java:183)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
      at org.apache.maven.lifecycle.LifecycleExecutorInterceptor.execute(LifecycleExecutorInterceptor.java:65)
      at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
      at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
      at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)

      The solution is simple, the class hudson.maven.ExecutedMojo have to catch the FileNotFoundException on row 94 - I attach the modified source code for this class. After this patch the build procceds in the same way as from command line and the warning is logged and could be ignored.

      Attachments

        Issue Links

          Activity

            Code changed in jenkins
            User: Christoph Kutzinski
            Path:
            changelog.html
            maven-plugin/pom.xml
            maven-plugin/src/main/java/hudson/maven/ExecutedMojo.java
            maven-plugin/src/test/java/hudson/maven/ExecutedMojoTest.java
            http://jenkins-ci.org/commit/jenkins/68f5a0d23ab4a5631df15b521b8eb71a2a74cc49
            Log:
            [FIXED JENKINS-5044] catch FileNotFoundException if mojos are executed from a classes directory instead from a jar

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Christoph Kutzinski Path: changelog.html maven-plugin/pom.xml maven-plugin/src/main/java/hudson/maven/ExecutedMojo.java maven-plugin/src/test/java/hudson/maven/ExecutedMojoTest.java http://jenkins-ci.org/commit/jenkins/68f5a0d23ab4a5631df15b521b8eb71a2a74cc49 Log: [FIXED JENKINS-5044] catch FileNotFoundException if mojos are executed from a classes directory instead from a jar
            kutzi kutzi added a comment -

            Thanks for your patch. Applied it.
            Sorry that it took so long

            kutzi kutzi added a comment - Thanks for your patch. Applied it. Sorry that it took so long
            dogfood dogfood added a comment -

            Integrated in jenkins_main_trunk #805
            [FIXED JENKINS-5044] catch FileNotFoundException if mojos are executed from a classes directory instead from a jar

            Christoph Kutzinski : 68f5a0d23ab4a5631df15b521b8eb71a2a74cc49
            Files :

            • maven-plugin/src/main/java/hudson/maven/ExecutedMojo.java
            • maven-plugin/src/test/java/hudson/maven/ExecutedMojoTest.java
            • changelog.html
            • maven-plugin/pom.xml
            dogfood dogfood added a comment - Integrated in jenkins_main_trunk #805 [FIXED JENKINS-5044] catch FileNotFoundException if mojos are executed from a classes directory instead from a jar Christoph Kutzinski : 68f5a0d23ab4a5631df15b521b8eb71a2a74cc49 Files : maven-plugin/src/main/java/hudson/maven/ExecutedMojo.java maven-plugin/src/test/java/hudson/maven/ExecutedMojoTest.java changelog.html maven-plugin/pom.xml

            Code changed in jenkins
            User: Christoph Kutzinski
            Path:
            changelog.html
            maven-plugin/pom.xml
            maven-plugin/src/main/java/hudson/maven/ExecutedMojo.java
            maven-plugin/src/test/java/hudson/maven/ExecutedMojoTest.java
            http://jenkins-ci.org/commit/jenkins/68f5a0d23ab4a5631df15b521b8eb71a2a74cc49
            Log:
            [FIXED JENKINS-5044] catch FileNotFoundException if mojos are executed from a classes directory instead from a jar

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Christoph Kutzinski Path: changelog.html maven-plugin/pom.xml maven-plugin/src/main/java/hudson/maven/ExecutedMojo.java maven-plugin/src/test/java/hudson/maven/ExecutedMojoTest.java http://jenkins-ci.org/commit/jenkins/68f5a0d23ab4a5631df15b521b8eb71a2a74cc49 Log: [FIXED JENKINS-5044] catch FileNotFoundException if mojos are executed from a classes directory instead from a jar

            Code changed in jenkins
            User: Christoph Kutzinski
            Path:
            changelog.html
            maven-plugin/pom.xml
            maven-plugin/src/main/java/hudson/maven/ExecutedMojo.java
            maven-plugin/src/test/java/hudson/maven/ExecutedMojoTest.java
            http://jenkins-ci.org/commit/jenkins/68f5a0d23ab4a5631df15b521b8eb71a2a74cc49
            Log:
            [FIXED JENKINS-5044] catch FileNotFoundException if mojos are executed from a classes directory instead from a jar

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Christoph Kutzinski Path: changelog.html maven-plugin/pom.xml maven-plugin/src/main/java/hudson/maven/ExecutedMojo.java maven-plugin/src/test/java/hudson/maven/ExecutedMojoTest.java http://jenkins-ci.org/commit/jenkins/68f5a0d23ab4a5631df15b521b8eb71a2a74cc49 Log: [FIXED JENKINS-5044] catch FileNotFoundException if mojos are executed from a classes directory instead from a jar

            Code changed in jenkins
            User: Christoph Kutzinski
            Path:
            pom.xml
            src/main/java/hudson/maven/ExecutedMojo.java
            src/test/java/hudson/maven/ExecutedMojoTest.java
            http://jenkins-ci.org/commit/maven-plugin/10b68f64fdd3d71b717e913219723a1823f1b390
            Log:
            [FIXED JENKINS-5044] catch FileNotFoundException if mojos are executed from a classes directory instead from a jar
            Originally-Committed-As: 68f5a0d23ab4a5631df15b521b8eb71a2a74cc49

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Christoph Kutzinski Path: pom.xml src/main/java/hudson/maven/ExecutedMojo.java src/test/java/hudson/maven/ExecutedMojoTest.java http://jenkins-ci.org/commit/maven-plugin/10b68f64fdd3d71b717e913219723a1823f1b390 Log: [FIXED JENKINS-5044] catch FileNotFoundException if mojos are executed from a classes directory instead from a jar Originally-Committed-As: 68f5a0d23ab4a5631df15b521b8eb71a2a74cc49

            People

              kutzi kutzi
              uni162 uni162
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: