全部, 我无法安装具有新DLUX GUI功能的自定义捆绑包。以下是我已经完成的步骤,
" mvn archetype:generate -DarchetypeGroupId = org.opendaylight.dlux -DarchetypeArtifactId = dlux-app -DarchetypeVersion = 0.7.0-SNAPSHOT "
如果不修改任何内容,请执行" mvn clean install"这个项目
然后尝试使用
安装新构建的软件包" bundle:install mvn:com.sample.dlux / sampleapp / 1.0-SNAPSHOT "
控制台出错,
捆绑ID: 执行命令时出错:安装包时出错: 无法安装捆绑包mvn:com.sample.dlux / sampleapp / 1.0-SNAPSHOT
日志文件错误
引起:java.io.IOException:解析工件错误com.sample.dlux:sampleapp:jar:1.0-SNAPSHOT:找不到工件com.sample.dlux:sampleapp:jar:1.0-SNAPSHOT in defaultlocal(file :/home/user1/distribution-karaf-0.6.1-Carbon/system/) 在org.ops4j.pax.url.mvn.internal.AetherBasedResolver.resolve(AetherBasedResolver.java:661) 在org.ops4j.pax.url.mvn.internal.AetherBasedResolver.resolve(AetherBasedResolver.java:598) 在org.ops4j.pax.url.mvn.internal.AetherBasedResolver.resolve(AetherBasedResolver.java:576) 在org.ops4j.pax.url.mvn.internal.AetherBasedResolver.resolve(AetherBasedResolver.java:550) 在org.ops4j.pax.url.mvn.internal.Connection.getInputStream(Connection.java:123) 在org.eclipse.osgi.internal.baseadaptor.BundleInstall.begin(BundleInstall.java:56)
的pom.xml
<project>
<modelVersion>4.0.0</modelVersion>
<packaging>pom</packaging>
<groupId>com.sample.dlux</groupId>
<artifactId>sampleapps</artifactId>
<version>1.0-SNAPSHOT</version>
<prerequisites>
<maven>3.0</maven>
</prerequisites>
<properties>
<osgi.core.version>5.0.0</osgi.core.version>
<apache.felix.compendium>1.4.0</apache.felix.compendium>
<dlux.loader.version>0.7.0-SNAPSHOT</dlux.loader.version>
</properties>
<modules>
<module>sampleapp-module</module>
<module>sampleapp-bundle</module>
</modules>
</project>
sampleapp-bundle - pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>sampleapps</artifactId>
<groupId>com.sample.dlux</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>sampleapps-bundle</artifactId>
<packaging>bundle</packaging>
<dependencies>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.core</artifactId>
<version>${osgi.core.version}</version>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.compendium</artifactId>
<version>${osgi.core.version}</version>
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.osgi.compendium</artifactId>
<version>${apache.felix.compendium}</version>
</dependency>
<dependency>
<groupId>org.opendaylight.dlux</groupId>
<artifactId>loader</artifactId>
<version>${dlux.loader.version}</version>
</dependency>
<dependency>
<groupId>com.sample.dlux</groupId>
<artifactId>sampleapps-module</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<directory>target/generated-resources</directory>
</resource>
<resource>
<directory>src/main/resources</directory>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.6</version>
<executions>
<!--loader Resources-->
<execution>
<id>unpack-loader-resources</id>
<goals>
<goal>unpack-dependencies</goal>
</goals>
<phase>generate-resources</phase>
<configuration>
<outputDirectory>${project.build.directory}/generated-resources</outputDirectory>
<groupId>com.sample.dlux</groupId>
<includeArtifactIds>sampleapps-module</includeArtifactIds>
<excludes>META-INF\/**,*/node\/**,*/node_modules\/**</excludes>
<excludeTransitive>true</excludeTransitive>
<ignorePermissions>false</ignorePermissions>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<instructions>
<Import-Package>org.osgi.service.http,
org.osgi.framework;version="1.0.0",
org.opendaylight.dlux.loader
</Import-Package>
<Export-Package></Export-Package>
</instructions>
</configuration>
</plugin>
</plugins>
</build>
我可以知道我哪里出错吗?。
提前致谢,
答案 0 :(得分:0)
&#34;找不到工件com.sample.dlux:sampleapp:jar:1.0-SNAPSHOT&#34;意味着bundle的工件(jar)在本地maven存储库中不可用。
尝试手动验证jar存在于.m2文件夹中(检查artifactId,groupId和版本是否正确)。