我尝试过使用apachekaraf食谱中的特性xml方法来安装apachehadoop客户端。但是我不能使用featurexml安装。我可以在karaf中添加featurerepo,但是不能安装featurexml中描述的包。
Error executing command: Can't install feature hdfs2/0.0.0:
Could not start bundle mvn:org.apache.cxf/cxf-core/3.0.0 in feature(s) cxf-core-3.0.0: Uses constraint violation. Unable to r
esolve bundle revision org.apache.cxf.cxf-core [86.0] because it is exposed to package 'org.codehaus.stax2' from bundle revis
ions stax2-api [79.0] and stax2-api [67.0] via two dependency chains.
Chain 1:
org.apache.cxf.cxf-core [86.0]
import: (&(osgi.wiring.package=org.codehaus.stax2)(version>=3.1.0)(!(version>=4.0.0)))
|
export: osgi.wiring.package=org.codehaus.stax2
stax2-api [79.0]
Chain 2:
org.apache.cxf.cxf-core [86.0]
import: (&(osgi.wiring.package=com.ctc.wstx.stax)(version>=4.3.0)(!(version>=5.0.0)))
|
export: osgi.wiring.package=com.ctc.wstx.stax; uses:=org.codehaus.stax2
woodstox-core-asl [80.0]
import: (&(osgi.wiring.package=org.codehaus.stax2)(version>=3.1.4))
|
export: osgi.wiring.package=org.codehaus.stax2
stax2-api [67.0]
feature.xml无效
<!DOCTYPE features>
<features name="sample-${project.version}">
<repository>mvn:org.apache.cxf.karaf/apache-cxf/3.0.0/xml/features</repository>
<feature name='xml-specs-api' version='${project.version}'
resolver='(obr)' start-level='10'>
<bundle dependency='true'>mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.activation-api-1.1/</bundle>
<bundle dependency='true'>mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.stax-api-1.0/</bundle>
<bundle dependency='true'>mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.jaxb-api-2.2/</bundle>
<bundle>mvn:org.codehaus.woodstox/stax2-api/</bundle>
<bundle>mvn:org.codehaus.woodstox/woodstox-core-asl/</bundle>
<bundle>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.jaxb-impl/</bundle>
</feature>
<feature name='hdfs2' version='${project.version}' resolver='(obr)'
start-level='50'>
<feature>xml-specs-api</feature>
<feature>cxf-jaxrs</feature>
<bundle dependency='true'>mvn:commons-lang/commons-lang/2.6</bundle>
<bundle dependency='true'>mvn:com.google.guava/guava/16.0.1</bundle>
<bundle dependency='true'>mvn:com.google.protobuf/protobuf-java/</bundle>
<bundle dependency='true'>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.guice/</bundle>
<bundle dependency='true'>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.jsch/</bundle>
<bundle dependency='true'>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.paranamer/</bundle>
<bundle dependency='true'>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.avro/1.7.3_1</bundle>
<bundle dependency='true'>mvn:org.apache.commons/commons-compress/</bundle>
<bundle dependency='true'>mvn:org.apache.commons/commons-math3/3.1.1</bundle>
<bundle dependency='true'>mvn:commons-cli/commons-cli/1.2</bundle>
<bundle dependency='true'>mvn:commons-configuration/commons-configuration/</bundle>
<bundle dependency='true'>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.commons-httpclient/</bundle>
<bundle dependency='true'>mvn:io.netty/netty/3.9.2.Final</bundle>
<bundle dependency='true'>mvn:org.codehaus.jackson/jackson-core-asl/1.9.12</bundle>
<bundle dependency='true'>mvn:org.codehaus.jackson/jackson-mapper-asl/1.9.12</bundle>
<bundle dependency="true">mvn:org.codehaus.jackson/jackson-jaxrs/1.9.12</bundle>
<bundle dependency="true">mvn:org.codehaus.jackson/jackson-xc/1.9.12</bundle>
<bundle dependency='true'>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.snappy-java</bundle>
<bundle dependency='true'>mvn:commons-codec/commons-codec/</bundle>
<bundle dependency='true'>mvn:commons-collections/commons-collections/3.2.1</bundle>
<bundle dependency='true'>mvn:commons-io/commons-io/</bundle>
<bundle dependency='true'>mvn:commons-net/commons-net</bundle>
<bundle dependency='true'>mvn:org.apache.zookeeper/zookeeper/3.4.8</bundle>
<bundle dependency='true'>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.xmlenc/0.52_1</bundle>
<bundle dependency='true'>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.xerces/</bundle>
<bundle dependency='true'>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.xmlresolver/</bundle>
<bundle>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.hadoop-client/</bundle>
</feature>
</features>
pom.xm(它的一部分)
<packaging>pom</packaging>
<properties>
<cxf.version>2.7.11</cxf.version>
<camel.version>2.15.2</camel.version>
<jms.version>3.0.4</jms.version>
<cellar.version>3.0.3</cellar.version>
<activemq.version>5.12.0</activemq.version>
<http.version>3.0.4</http.version>
<pax-http.version>3.2.3</pax-http.version>
<pax-jetty.version>8.1.17.v20150415</pax-jetty.version>
<spring.version>3.2.11.RELEASE_1</spring.version>
</properties>
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
<id>filter</id>
<phase>generate-resources</phase>
<goals>
<goal>resources</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<executions>
<execution>
<id>attach-artifacts</id>
<phase>package</phase>
<goals>
<goal>attach-artifact</goal>
</goals>
<configuration>
<artifacts>
<artifact>
<file>target/classes/features.xml</file>
<type>xml</type>
<classifier>features</classifier>
</artifact>
</artifacts>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>validate</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.karaf.tooling</groupId>
<artifactId>features-maven-plugin</artifactId>
<version>${cxf.karaf.version}</version>
<configuration>
<file>${project.build.directory}/classes/features.xml</file>
<karafConfig>${project.build.directory}/classes/bundles.properties</karafConfig>
<jreVersion>jre-1.6</jreVersion>
</configuration>
<executions>
<execution>
<id>validate</id>
<phase>process-resources</phase>
<goals>
<goal>validate</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
1条答案
按热度按时间jvidinwx1#
您需要更改features.xml文件,如下所示。
mvn:org.codehaus.woodstox/stax2-api/3.1.4