Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
325 views
in Technique[技术] by (71.8m points)

java - Blueprint maven plugin RuntimeException

I don't have any blueprint annotations in my code, but when I try to build my bundle using maven I get

[ERROR] Failed to execute goal org.apache.aries.blueprint:blueprint-maven-plugin:1.1.0:blueprint-generate
 (default) on project data-collection-terminal-updates: Error building
 commands help: RuntimeException - [Help 1]
 org.apache.maven.lifecycle.LifecycleExecutionException: Failed to
 execute goal
 org.apache.aries.blueprint:blueprint-maven-plugin:1.1.0:blueprint-generate
 (default) on project data-collection-terminal-updates: Error building
 commands help
         at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
         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:108)
         at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:76)
         at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
         at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:116)
         at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:361)
         at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
         at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
         at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:213)
         at org.apache.maven.cli.MavenCli.main(MavenCli.java:157)
         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: org.apache.maven.plugin.MojoExecutionException: Error
 building commands help
         at org.apache.aries.blueprint.plugin.GenerateMojo.execute(GenerateMojo.java:80)
         at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:133)
         at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
         ... 19 more Caused by: java.lang.RuntimeException
         at org.apache.xbean.asm5.MethodVisitor.visitParameter(Unknown Source)
         at org.apache.xbean.asm5.ClassReader.b(Unknown Source)
         at org.apache.xbean.asm5.ClassReader.accept(Unknown Source)
         at org.apache.xbean.asm5.ClassReader.accept(Unknown Source)
         at org.apache.xbean.finder.AbstractFinder.readClassDef(AbstractFinder.java:581)
         at org.apache.xbean.finder.AbstractFinder.readClassDef(AbstractFinder.java:576)
         at org.apache.xbean.finder.AbstractFinder.readClassDef(AbstractFinder.java:562)
         at org.apache.xbean.finder.ClassFinder.<init(ClassFinder.java:122)
         at org.apache.aries.blueprint.plugin.GenerateMojo.createProjectScopeFinder(GenerateMojo.java:96)
         at org.apache.aries.blueprint.plugin.GenerateMojo.execute(GenerateMojo.java:70)
         ... 21 more

Could someone, please, explain, what's the problem here? I tried to google, but didn't find anything.


update: pom.xml

<modelVersion>4.0.0</modelVersion>

<groupId>ru.bia.prisma</groupId>
<artifactId>data-collection-terminal-updates</artifactId>
<version>1.0.0</version>
<repositories>
    <repository>
        <id>repository.springsource.com.release</id>
        <name>SpringSource OBR - Release</name>
        <url>http://repository.springsource.com/maven/bundles/release</url>
    </repository>
    <repository>
        <id>repository.springsource.com.external</id>
        <name>SpringSource OBR - External</name>
        <url>http://repository.springsource.com/maven/bundles/external</url>
    </repository>
</repositories>
<name>Server core for DCT updates</name>
<packaging>bundle</packaging>

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<dependencies>
    <dependency>
        <groupId>org.glassfish.jersey.core</groupId>
        <artifactId>jersey-client</artifactId>
        <version>2.23.1</version>
    </dependency>
    <dependency>
        <groupId>org.glassfish.jersey.core</groupId>
        <artifactId>jersey-server</artifactId>
        <version>2.23.1</version>
    </dependency>
    <dependency>
        <groupId>org.glassfish.jersey.core</groupId>
        <artifactId>jersey-common</artifactId>
        <version>2.23.1</version>
    </dependency>
    <dependency>
        <groupId>org.glassfish.jersey.containers</groupId>
        <artifactId>jersey-container-servlet</artifactId>
        <version>2.23.1</version>
    </dependency>
    <dependency>
        <groupId>com.google.code.gson</groupId>
        <artifactId>gson</artifactId>
        <version>2.7</version>
    </dependency>
    <dependency>
        <groupId>commons-fileupload</groupId>
        <artifactId>commons-fileupload</artifactId>
        <version>1.3.2</version>
    </dependency>
    <dependency>
        <groupId>commons-io</groupId>
        <artifactId>commons-io</artifactId>
        <version>2.4</version>
    </dependency>
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>javax.servlet-api</artifactId>
        <version>3.1.0</version>
    </dependency>
    <dependency>
        <groupId>org.osgi</groupId>
        <artifactId>org.osgi.core</artifactId>
        <version>4.3.1</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-core</artifactId>
        <version>5.2.0.Final</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>org.osgi</groupId>
        <artifactId>org.osgi.enterprise</artifactId>
        <version>4.2.0</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>org.liquibase</groupId>
        <artifactId>liquibase-core</artifactId>
        <version>3.5.1</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>org.postgresql</groupId>
        <artifactId>postgresql</artifactId>
        <version>9.4-1206-jdbc41</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>org.ops4j.pax.cdi</groupId>
        <artifactId>pax-cdi-api</artifactId>
        <version>0.12.0</version>
    </dependency>
    <dependency>
        <groupId>javax.transaction</groupId>
        <artifactId>javax.transaction-api</artifactId>
        <version>1.2</version>
    </dependency>
    <dependency>
        <groupId>com.fasterxml.jackson.jaxrs</groupId>
        <artifactId>jackson-jaxrs-json-provider</artifactId>
        <version>2.8.1</version>
    </dependency>
    <dependency>
        <groupId>javax.inject</groupId>
        <artifactId>com.springsource.javax.inject</artifactId>
        <version>1.0.0</version>
    </dependency>
    <dependency>
        <groupId>org.hibernate.javax.persistence</groupId>
        <artifactId>hibernate-jpa-2.1-api</artifactId>
        <version>1.0.0.Final</version>
    </dependency>
    <dependency>
        <groupId>org.apache.aries.blueprint</groupId>
        <artifactId>org.apache.aries.blueprint.annotation.api</artifactId>
        <version>1.0.1</version>
    </dependency>
    <dependency>
        <groupId>org.apache.xbean</groupId>
        <artifactId>xbean-bundleutils</artifactId>
        <version>4.5</version>
    </dependency>
    <dependency>
        <groupId>org.apache.xbean</groupId>
        <artifactId>xbean-finder-shaded</artifactId>
        <version>4.5</version>
    </dependency>

    <!--<dependency>-->
        <!--<groupId>ru.bia.ldap</groupId>-->
        <!--<artifactId>LDAPConnector</artifactId>-->
        <!--<version>1.0</version>-->
    <!--</dependency>-->
    <!--<dependency>-->
        <!--<groupId>joda-time</groupId>-->
        <!--<artifactId>joda-time</artifactId>-->
        <!--<version>2.9.4</version>-->
    <!--</dependency>-->
    <!--<dependency>-->
    <!--<groupId>org.hibernate</groupId>-->
    <!--<artifactId>hibernate-jpamodelgen</artifactId>-->
    <!--<version>5.2.0.Final</version>-->
    <!--</dependency>-->
</dependencies>

<build>
    <outputDirectory>target/classes</outputDirectory>

    <resources>
        <resource>
            <directory>src/main/resources</directory>
            <excludes>
                <exclude>web/config/**</exclude>
                <exclude>web/config/**/*</exclude>
            </excludes>
        </resource>
    </resources>

    <plugins>
        <plugin>
            <groupId>org.apache.aries.blueprint</groupId>
            <artifactId>blueprint-maven-plugin</artifactId>
            <version>1.1.0</version>
            <configuration>
                <scanPaths>
                    <scanPath>ru.bia.prisma.data_collection_terminal_updates</scanPath>
                </scanPaths>
            </configuration>
            <executions>
                <execution>
                    <goals>
                        <goal>blueprint-generate</goal>
                    </goals>
                    <phase>process-classes</phase>
                </execution>
            </executions>
        </plugin>

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
  

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

This still occurs with blueprint-maven-plugin version 1.4.0. As noted by the comment by @henning-luther in the comments on the question above (which is hard to see) this was bug https://issues.apache.org/jira/browse/XBEAN-276 = https://issues.apache.org/jira/browse/XBEAN-286 in Xbean (not blueprint-maven-plugin), and can be fixed like this:

  <plugin>
    <groupId>org.apache.aries.blueprint</groupId>
    <artifactId>blueprint-maven-plugin</artifactId>
    <version>1.4.0</version>
    <configuration>
      <scanPaths>
        <scanPath>org.opendaylight</scanPath>
      </scanPaths>
    </configuration>
    <dependencies>
      <dependency>
        <!-- https://stackoverflow.com/questions/38825386/blueprint-maven-plugin-runtimeexception -->
        <groupId>org.apache.xbean</groupId>
        <artifactId>xbean-finder-shaded</artifactId>
        <version>4.5</version>
      </dependency>
    </dependencies>
    <executions>
      <execution>
        <goals>
          <goal>blueprint-generate</goal>
        </goals>
      </execution>
    </executions>
  </plugin>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...