use of io.quarkus.bootstrap.model.ApplicationModel in project camel-quarkus by apache.
the class XchangeProcessor method indexDependenciesAndResources.
@BuildStep
void indexDependenciesAndResources(BuildProducer<IndexDependencyBuildItem> indexedDependency, BuildProducer<NativeImageResourceBuildItem> nativeImageResource, CurateOutcomeBuildItem curateOutcome) {
ApplicationModel applicationModel = curateOutcome.getApplicationModel();
for (ResolvedDependency dependency : applicationModel.getDependencies()) {
if (dependency.getGroupId().equals("org.knowm.xchange")) {
// Index any org.knowm.xchange dependencies present on the classpath as they contain the APIs for interacting with each crypto exchange
String artifactId = dependency.getArtifactId();
indexedDependency.produce(new IndexDependencyBuildItem(dependency.getGroupId(), artifactId));
// Include crypto exchange metadata resources
String[] split = artifactId.split("-");
if (split.length > 1) {
String cryptoExchange = split[split.length - 1];
nativeImageResource.produce(new NativeImageResourceBuildItem(cryptoExchange + ".json"));
}
}
}
indexedDependency.produce(new IndexDependencyBuildItem("org.jboss.spec.javax.ws.rs", "jboss-jaxrs-api_2.1_spec"));
}
Aggregations