Uploaded image for project: 'Felix'
  1. Felix
  2. FELIX-5327

SCR Plugin: FileNotFoundException in multi-module Maven reactor build in 2nd module

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: scr bnd plugin 1.5.0
    • Fix Version/s: None
    • Component/s: SCR Tooling
    • Labels:
      None

      Description

      In a multi-module Maven build the scr bnd plugin tries to write the bind methods into the wrong file. Instead of <current maven module directory>/target/classes/... it tries to use <root maven module directory>/target/classes/....
      The funny thing is that this only happens with the 2nd Maven module containing components, for the first Maven module it works correctly.
      So it seems that the scr bnd plugin is not always using the correct base path.

      The exception when this occurs looks like this

      [ERROR] Bundle <some bundle>:<some version> : Got unexpected exception while analyzing:org.apache.felix.scrplugin.SCRDescriptorException: Unable to add methods to <Fully qualified class name of SCR Component>
      	at org.apache.felix.scrplugin.helper.ClassModifier.addMethods(ClassModifier.java:114)
      	at org.apache.felix.scrplugin.SCRDescriptorGenerator.generateMethods(SCRDescriptorGenerator.java:274)
      	at org.apache.felix.scrplugin.SCRDescriptorGenerator.execute(SCRDescriptorGenerator.java:201)
      	at org.apache.felix.scrplugin.bnd.SCRDescriptorBndPlugin.analyzeJar(SCRDescriptorBndPlugin.java:178)
      	at aQute.bnd.osgi.Analyzer.doPlugins(Analyzer.java:656)
      	at aQute.bnd.osgi.Analyzer.analyze(Analyzer.java:209)
      	at aQute.bnd.osgi.Builder.analyze(Builder.java:385)
      	at aQute.bnd.osgi.Analyzer.calcManifest(Analyzer.java:687)
      	at aQute.bnd.osgi.Builder.build(Builder.java:105)
      	at org.apache.felix.bundleplugin.BundlePlugin.buildOSGiBundle(BundlePlugin.java:972)
      	at org.apache.felix.bundleplugin.BundlePlugin.execute(BundlePlugin.java:470)
      	at org.apache.felix.bundleplugin.BundlePlugin.execute(BundlePlugin.java:387)
      	at org.apache.felix.bundleplugin.BundlePlugin.execute(BundlePlugin.java:378)
      	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
      	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
      	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:116)
      	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
      	at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
      	at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
      	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
      	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
      	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
      	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:862)
      	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:286)
      	at org.apache.maven.cli.MavenCli.main(MavenCli.java:197)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:497)
      	at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
      	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
      	at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
      	at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
      Caused by: java.io.FileNotFoundException: <directory of root pom.xml>/target/classes/<some class containing a SCR component> (No such file or directory)
      	at java.io.FileInputStream.open0(Native Method)
      	at java.io.FileInputStream.open(FileInputStream.java:195)
      	at java.io.FileInputStream.<init>(FileInputStream.java:138)
      	at java.io.FileInputStream.<init>(FileInputStream.java:93)
      	at org.apache.felix.scrplugin.helper.ClassModifier.addMethods(ClassModifier.java:65)
      	... 34 more
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              kwin Konrad Windszus
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: