Karaf(バージョン3.0.3)にマルチモジュールを含むプロジェクトがあり、Xero API(請求ゲートウェイ)に1つの依存関係を追加する必要がありました-https ://github.com/XeroAPI/Xero-Java
私はfelix apacheを通じてOSGI実装を使用しています。モジュールでは、すべての依存関係をXeroに追加しました。これらはpom bellowにあります。
Pom.xml
<dependency>
<groupId>com.github.xeroapi</groupId>
<artifactId>xero-java</artifactId>
<version>${xero-java.version}</version>
</dependency>
<dependency>
<groupId>com.github.xeroapi</groupId>
<artifactId>xeroapi-schemas</artifactId>
<version>${xero-schemas.version}</version>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>${jaxb-api.version}</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-core</artifactId>
<version>${jaxb-core.version}</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>${jaxb-impl.version}</version>
</dependency>
<dependency>
<groupId>javax.activation</groupId>
<artifactId>activation</artifactId>
<version>${javax-activation.version}</version>
</dependency>
<dependency>
<groupId>org.threeten</groupId>
<artifactId>threetenbp</artifactId>
<version>${threetenbp.version}</version>
</dependency>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<instructions>
<Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
<Import-Package>!com.google.api.client.http,*</Import-Package>
<Embed-Dependency>com.google.api.client.http</Embed-Dependency>
</instructions>
</configuration>
</plugin>
すべての実装がデプロイおよびコンパイルされましたが、karafの実行中に次のエラーが発生しました。
ログデカンタ
2019-07-19 15:44:19,812 | エラー| lixDispatchQueue | FeatureDeploymentListener | 22-org.apache.karaf.deployer.features-3.0.3 | 機能をインストールできませんjava.lang.Exception:機能でバンドルmvn:com.xtpo.im/im-bll-impl/0.2-SNAPSHOTを開始できませんでしたbe-invoice-mgmt-0.2-SNAPSHOT:バンドルで未解決の制約com.xtpo.im.im-bll-impl [368]:368.0を解決できません:要件がありません[368.0] osgi.wiring.package; (osgi.wiring.package = com.google.api.client.http)org.apache.karaf.features.internal.FeaturesServiceImpl.startBundle(FeaturesServiceImpl.java:504)[21:org.apache.karaf.features.core :3.0.3] at org.apache.karaf.features.internal.FeaturesServiceImpl.installFeatures(FeaturesServiceImpl.java:459)[21:org.apache.karaf.features.core:3.0.3] at Proxya6f8789a_dbdc_4181_b0eb_837248e8cb78.installFeatures.core:3.0.3] )[:apache.felix.framework-4.2.1.jar:] at java.lang.Thread.run(Thread.java:748)[:1.8.0_211]原因:org.osgi.framework.BundleException:バンドルcomの未解決の制約.xtpo.im.im-bll-impl [368]:368.0を解決できません:要件がありません[368.0] osgi.wiring.package; (osgi.wiring.package = com.google.api.client.http)org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:3974)[org.apache.felix.framework-4.2.1.jar :] org.apache.felix.framework.Felix.startBundle(Felix.java:2037)[org.apache.felix.framework-4.2.1.jar:] at org.apache.felix.framework.BundleImpl.start( BundleImpl.java:955)[org.apache.felix.framework-4.2.1.jar:] org.apache.felix.framework.BundleImpl.start(BundleImpl.java:942)[org.apache.felix.framework- 4.2.1.jar:] org.apache.karaf.features.internal.FeaturesServiceImpl.startBundle(FeaturesServiceImpl.java:501)[21:org。
問題はcom.google.api.client.httpです。誰かがこの問題の解決を手伝ってくれる?
ファイル機能では、次の依存関係があります。
features.xml
<!--Xero dependencies-->
<bundle>wrap:mvn:com.github.xeroapi/xero-java/${xero-java.version}</bundle>
<bundle>wrap:mvn:com.github.xeroapi/xeroapi-schemas/${xero-schemas.version}</bundle>
<bundle>wrap:mvn:javax.xml.bind/jaxb-api/${jaxb-api.version}</bundle>
<bundle>wrap:mvn:com.sun.xml.bind/jaxb-impl/${jaxb-impl.version}</bundle>
<bundle>wrap:mvn:javax.activation/activation/${javax-activation.version}</bundle>
<bundle>wrap:mvn:org.threeten/threetenbp/${threetenbp.version}</bundle>
皆さんありがとう
Felixはパッケージを解決できませんcom.google.api.client.http
。パッケージを含むバンドルをデプロイするか、独自のバンドルに埋め込む必要があります。パッケージは、Mavenアーティファクトcom.google.http-client:google-http-clientから入手できます。
maven-bundle-pluginを設定して、コンパイルスコープの依存関係を埋め込み、上記にリンクされたgoogle http-clientアーティファクトに依存関係を追加できます。
<dependency>
<groupId>com.google.http-client</groupId>
<artifactId>google-http-client</artifactId>
<version>1.30.2</version>
</dependency>
バージョンの調整が必要になる場合があります。アーティファクトはOSGiバンドルとしてパッケージ化されているので、アーティファクトをダウンロードして、独自のバンドルと一緒に(組み込みではなく)karafにデプロイすることもできます。
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加