Blueprint maven plugin RuntimeException

时光总嘲笑我的痴心妄想 提交于 2019-12-20 04:25:31

问题


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>
            <artifactId>maven-resources-plugin</artifactId>
            <version>3.0.1</version>
        </plugin>
        <plugin>
            <groupId>com.github.eirslett</groupId>
            <artifactId>frontend-maven-plugin</artifactId>
            <version>1.0</version>

            <configuration>
                <workingDirectory>src/main/resources/web/config</workingDirectory>
                <nodeVersion>v6.3.1</nodeVersion>
                <npmVersion>2.15.8</npmVersion>
            </configuration>

            <executions>
                <execution>
                    <id>gulp build</id>
                    <goals>
                        <goal>install-node-and-npm</goal>
                        <goal>gulp</goal>
                    </goals>
                    <phase>generate-resources</phase>
                </execution>
            </executions>
        </plugin>
        <plugin>
            <groupId>org.apache.felix</groupId>
            <artifactId>maven-bundle-plugin</artifactId>
            <version>3.0.1</version>
            <extensions>true</extensions>
            <configuration>
                <instructions>
                    <Bundle-Name>DataCollectionTerminalUpdates</Bundle-Name>
                    <Bundle-Version>1.0.0</Bundle-Version>
                    <Import-Package>
                        org.osgi.framework,
                        org.postgresql,
                        org.apache.commons.fileupload,
                        org.apache.commons.fileupload.disk,
                        org.apache.commons.fileupload.servlet,
                        javax.servlet,
                        javax.servlet.http,
                        waffle.windows.auth;resolution:=optional,
                        waffle.windows.auth.impl;resolution:=optional,
                        com.sun.jna;resolution:=optional,
                        com.sun.jna.platform.win32;resolution:=optional,
                        com.sun.jna.ptr;resolution:=optional,
                        com.sun.jna.win32;resolution:=optional,
                        javax.persistence,
                        org.hibernate.proxy,
                        javassist.util.proxy,
                        org.codehaus.jackson.xc,
                        <!--ru.bia.ldap.service,-->
                        *
                    </Import-Package>
                    <Bundle-Activator>ru.bia.prisma.data_collection_terminal_updates.osgi.Activator
                    </Bundle-Activator>
                    <Bundle-ClassPath>., META-INF</Bundle-ClassPath>
                    <Meta-Persistence>META-INF/persistence.xml</Meta-Persistence>
                    <Web-ContextPath>dct-updates</Web-ContextPath>
                    <_wab>src/main/resources/web/build</_wab>
                </instructions>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.5.1</version>
            <configuration>
                <source>1.8</source>
                <target>1.8</target>
            </configuration>
        </plugin>
    </plugins>
</build>


回答1:


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>


来源:https://stackoverflow.com/questions/38825386/blueprint-maven-plugin-runtimeexception

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!