Я использую ServiceMix 3.5 У меня есть несколько ServiceAssemblies, каждый для ServiceUnit. Единицы обслуживания имеют в общем множество библиотек, поэтому я отмечаю их в maven pom с областью «предоставлено». Общая библиотека содержит все библиотеки, которые я хочу, чтобы сервисные единицы делились. я построил в соответствии со следующими Maven pom.xml годов, но эффект просто исключение:Как интегрировать общие библиотеки servicemix с помощью jbi-maven-plugin?
java.lang.ClassNotFoundException: org.apache.commons.dbcp.BasicDataSource в org.apache.xbean загрузчика классов. spring.context.FileSystemXmlApplicationContext
Что я могу сделать (возможно, с помощью JBI-Maven-плагин) для того, чтобы мои единицы услуг, чтобы использовать банку из общей библиотеки?
разделяемых библиотек блок обслуживания ПОМ:
<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>
<groupId>aaa.bbb</groupId>
<artifactId>SHARED_SU</artifactId>
<packaging>jbi-service-unit</packaging>
<version>0.0.1-SNAPSHOT</version>
<parent>
<groupId>aaa.bbb</groupId>
<artifactId>theParent</artifactId>
<version>1.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<build>
<defaultGoal>install</defaultGoal>
<plugins/>
</build>
<properties><componentName>servicemix-camel</componentName></properties>
<dependencies>
...
</dependencies>
</project>
Общий блок библиотеки службы ПОМ:
<?xml version="1.0" encoding="UTF-8"?>
<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>aaa.bbb</groupId>
<artifactId>SHARED_SA</artifactId>
<packaging>jbi-shared-library</packaging>
<version>0.0.1-SNAPSHOT</version>
<parent>
<groupId>aaa.bbb</groupId>
<artifactId>theParent</artifactId>
<version>1.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<dependencies>
<dependency>
<groupId>aaa.bbb</groupId>
<artifactId>SHARED_SU</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.servicemix.tooling</groupId>
<artifactId>jbi-maven-plugin</artifactId>
<version>3.2.3</version>
<extensions>true</extensions>
<configuration>
<type>service-assembly</type>
<classLoaderDelegation>parent-first</classLoaderDelegation>
</configuration>
</plugin>
</plugins>
</build>
</project>
Pom сервисного блока, который необходимо использовать совместно используемые библиотеки:
<?xml version="1.0" encoding="UTF-8"?>
<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>
<groupId>aaa.bbb</groupId>
<artifactId>theServiceUnit</artifactId>
<packaging>jbi-service-unit</packaging>
<version>0.0.1-SNAPSHOT</version>
<parent>
<groupId>aaa.bbb</groupId>
<artifactId>theParent</artifactId>
<version>1.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<build>
<defaultGoal>install</defaultGoal>
<plugins>
<plugin>
<groupId>org.apache.servicemix.tooling</groupId>
<artifactId>jbi-maven-plugin</artifactId>
<version>3.2.3</version>
<extensions>true</extensions>
</plugin>
</plugins>
</build>
<dependencies>
... <!-- all "PROVIDED" in scope-->
<properties>
<componentName>servicemix-camel</componentName>
</properties>
</project>
Pom узла службы блока
<?xml version="1.0" encoding="UTF-8"?>
<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>aaa.bbb</groupId>
<artifactId>theServiceAssembly</artifactId>
<packaging>jbi-service-assembly</packaging>
<version>0.0.1-SNAPSHOT</version>
<parent>
<groupId>aaa.bbb</groupId>
<artifactId>theParent</artifactId>
<version>1.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<dependencies>
<dependency>
<groupId>aaa.bbb</groupId>
<artifactId>theServiceUnit</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.servicemix.tooling</groupId>
<artifactId>jbi-maven-plugin</artifactId>
<version>3.2.3</version>
<extensions>true</extensions>
<configuration>
<type>service-assembly</type>
</configuration>
</plugin>
</plugins>
</build>
</project>