Axis2
  1. Axis2
  2. AXIS2-5206

axis2-aar-maven-plugin fails to build aar while using m2e in workspace resolution mode

    Details

    • Type: Improvement Improvement
    • Status: Reopened
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 1.5.6, 1.6.1
    • Fix Version/s: 1.7.0, 1.6.3
    • Component/s: Tools
    • Labels:
      None

      Description

      First time posting an issue request. Apologies if I'm doing it wrong...

      When building in Eclipse using m2e in workspace resolution mode, the axis2-aar-maven-plugin is not prepared for a "dependency" which isn't an assembly but is instead a folder containing the compiled classes from within the local workspace. I propose that if the incoming dependency happens to be a directory that it get packaged up and copied to the destination instead of blowing up with an exception.

      (there is no place to attach a patch, so I'll include a code snippet illustrating my idea)

      Modifying this function in AbstractAarMojo.java will give the intended result:

      private void copyFileIfModified(File source, File destination)
      throws IOException {
      // TO DO: Remove this method and use the method in WarFileUtils when Maven 2 changes
      // to plexus-utils 1.2.
      if (destination.lastModified() < source.lastModified()) {
      if (source.isDirectory()) {
      JarArchiver jarArchiver = new JarArchiver();
      try

      { jarArchiver.setDestFile( destination ); jarArchiver.addDirectory( source.getCanonicalFile() ); jarArchiver.createArchive(); }

      catch (ArchiverException e)

      { // wrap ArchiverException in IOException throw new IOException(e); }

      } else

      { FileUtils.copyFile(source.getCanonicalFile(), destination); // preserve timestamp destination.setLastModified(source.lastModified()); }

      }
      }

      1. ASF.LICENSE.NOT.GRANTED--screenshot-1.jpg
        87 kB
        Chris Gamache
      2. AbstractAarMojo.java.patch
        2 kB
        Chris Gamache

        Activity

        Hide
        Sagara Gunathunga added a comment -

        Still I haven't look into this issue deeply, can you provide exact steps to reproduce this issue on Eclipse? BTW you can attach your patch to this JIRA issue (select More Action drop down then attach files) .

        Show
        Sagara Gunathunga added a comment - Still I haven't look into this issue deeply, can you provide exact steps to reproduce this issue on Eclipse? BTW you can attach your patch to this JIRA issue (select More Action drop down then attach files) .
        Hide
        Chris Gamache added a comment -

        Notice that the "Resolve Workspace artifacts" checkbox is checked. Debug is checked to view the inevitable stack trace.

        Show
        Chris Gamache added a comment - Notice that the "Resolve Workspace artifacts" checkbox is checked. Debug is checked to view the inevitable stack trace.
        Hide
        Chris Gamache added a comment -

        Steps to reproduce:

        1. Install Eclipse (tested on Helios and Indigo)
        2. Install m2e from update site http://download.eclipse.org/technology/m2e/releases/
        3. Create Maven project for your axis2 web service, fill it out with services.xml (We'll call this Project A)
        4. Put the axis2-aar-maven-plugin in the pom.xml file
        5. Create another Maven project in the workspace with jar packaging (this will be your dependency-- Project B)
        6. Make Project A depend on Project B by adding Project B's groupId, artifactId, and version in the dependencies section in pom.xml file for Project A
        7. Right click Project A -> Run -> Maven Build...
        8. Configure then Run panel as you see in the screenshot.
        9. Run

        Show
        Chris Gamache added a comment - Steps to reproduce: 1. Install Eclipse (tested on Helios and Indigo) 2. Install m2e from update site http://download.eclipse.org/technology/m2e/releases/ 3. Create Maven project for your axis2 web service, fill it out with services.xml (We'll call this Project A) 4. Put the axis2-aar-maven-plugin in the pom.xml file 5. Create another Maven project in the workspace with jar packaging (this will be your dependency-- Project B) 6. Make Project A depend on Project B by adding Project B's groupId, artifactId, and version in the dependencies section in pom.xml file for Project A 7. Right click Project A -> Run -> Maven Build... 8. Configure then Run panel as you see in the screenshot. 9. Run
        Hide
        Sagara Gunathunga added a comment -

        Thanks for details. I will look into this and review your patch.

        Show
        Sagara Gunathunga added a comment - Thanks for details. I will look into this and review your patch.
        Hide
        Sagara Gunathunga added a comment -

        Fixed in r1210082.

        Show
        Sagara Gunathunga added a comment - Fixed in r1210082.
        Hide
        Hudson added a comment -

        Integrated in Axis2 #1154 (See https://builds.apache.org/job/Axis2/1154/)
        Applied the patch for AXIS2-5206.

        sagara :
        Files :

        • /axis/axis2/java/core/trunk/modules/tool/axis2-aar-maven-plugin/src/main/java/org/apache/axis2/maven2/aar/AbstractAarMojo.java
        Show
        Hudson added a comment - Integrated in Axis2 #1154 (See https://builds.apache.org/job/Axis2/1154/ ) Applied the patch for AXIS2-5206 . sagara : Files : /axis/axis2/java/core/trunk/modules/tool/axis2-aar-maven-plugin/src/main/java/org/apache/axis2/maven2/aar/AbstractAarMojo.java
        Hide
        Sagara Gunathunga added a comment -

        Applying given patch cause compilation failures in build server but build locally without any issue. Need to check this separately.

        Stack trace :
        org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.1:compile (default-compile) on project axis2-aar-maven-plugin: Compilation failure
        <https://builds.apache.org/job/Axis2/ws/axis2/modules/tool/axis2-aar-maven-plugin/src/main/java/org/apache/axis2/maven2/aar/AbstractAarMojo.java>:[259,46] cannot find symbol
        symbol : constructor IOException(org.codehaus.plexus.archiver.ArchiverException)
        location: class java.io.IOException

        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:213)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
        at org.jvnet.hudson.maven3.launcher.Maven3Launcher.main(Maven3Launcher.java:79)
        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:592)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:329)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:239)
        at org.jvnet.hudson.maven3.agent.Maven3Main.launch(Maven3Main.java:158)
        at hudson.maven.Maven3Builder.call(Maven3Builder.java:122)
        at hudson.maven.Maven3Builder.call(Maven3Builder.java:74)
        at hudson.remoting.UserRequest.perform(UserRequest.java:118)
        at hudson.remoting.UserRequest.perform(UserRequest.java:48)
        at hudson.remoting.Request$2.run(Request.java:287)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:417)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
        at java.util.concurrent.FutureTask.run(FutureTask.java:123)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:651)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:676)
        at java.lang.Thread.run(Thread.java:595)
        Caused by: org.apache.maven.plugin.CompilationFailureException: Compilation failure
        <https://builds.apache.org/job/Axis2/ws/axis2/modules/tool/axis2-aar-maven-plugin/src/main/java/org/apache/axis2/maven2/aar/AbstractAarMojo.java>:[259,46] cannot find symbol
        symbol : constructor IOException(org.codehaus.plexus.archiver.ArchiverException)
        location: class java.io.IOException

        Show
        Sagara Gunathunga added a comment - Applying given patch cause compilation failures in build server but build locally without any issue. Need to check this separately. Stack trace : org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.1:compile (default-compile) on project axis2-aar-maven-plugin: Compilation failure < https://builds.apache.org/job/Axis2/ws/axis2/modules/tool/axis2-aar-maven-plugin/src/main/java/org/apache/axis2/maven2/aar/AbstractAarMojo.java >: [259,46] cannot find symbol symbol : constructor IOException(org.codehaus.plexus.archiver.ArchiverException) location: class java.io.IOException at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:213) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59) at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156) at org.jvnet.hudson.maven3.launcher.Maven3Launcher.main(Maven3Launcher.java:79) 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:592) at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:329) at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:239) at org.jvnet.hudson.maven3.agent.Maven3Main.launch(Maven3Main.java:158) at hudson.maven.Maven3Builder.call(Maven3Builder.java:122) at hudson.maven.Maven3Builder.call(Maven3Builder.java:74) at hudson.remoting.UserRequest.perform(UserRequest.java:118) at hudson.remoting.UserRequest.perform(UserRequest.java:48) at hudson.remoting.Request$2.run(Request.java:287) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:417) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269) at java.util.concurrent.FutureTask.run(FutureTask.java:123) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:651) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:676) at java.lang.Thread.run(Thread.java:595) Caused by: org.apache.maven.plugin.CompilationFailureException: Compilation failure < https://builds.apache.org/job/Axis2/ws/axis2/modules/tool/axis2-aar-maven-plugin/src/main/java/org/apache/axis2/maven2/aar/AbstractAarMojo.java >: [259,46] cannot find symbol symbol : constructor IOException(org.codehaus.plexus.archiver.ArchiverException) location: class java.io.IOException
        Hide
        Sagara Gunathunga added a comment -

        Moved to next release.

        Show
        Sagara Gunathunga added a comment - Moved to next release.

          People

          • Assignee:
            Unassigned
            Reporter:
            Chris Gamache
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:

              Development