尝试在 Maven 中构建具有嵌入式依赖项的 OSGi 包。似乎无法从 BND 类路径中排除传递依赖项

发布于 2024-12-04 17:28:43 字数 21930 浏览 1 评论 0原文

基本上,我的 Web 服务必须可部署为单个 OSGi jar 包。因此:

  1. bundle 必须包含所有编译和运行时 Maven 依赖项。
  2. 它还必须包含依赖于这些依赖项的所有非可选依赖项(即传递依赖项)。

我正在尝试使用 maven-bundle-plugin 来完成此任务。我使用 Embed-Dependency 获取捆绑包中的所有编译和运行时依赖项,并使用 Embed-Transitive 嵌入所有传递依赖项。然后我想出了如何使用 exceptDependency 从 BND 类路径中排除 Maven 依赖项(它们被移动到清单中的 Private-Package 中),但对于我来说,我无法弄清楚如何让它排除传递依赖项。无论我做什么,传递依赖项似乎仍然显示在清单中的导入包列表中。

更糟糕的是,它似乎吸收了所有依赖项,包括可选的依赖项,所以我得到了很多我不使用的额外东西,比如 ibatis 和 jfree。然而,当我将 ;optical=false 添加到依赖项模式时,我收到一条警告,指出没有依赖项与该模式匹配。

我开始尝试一一排除依赖项,但经过一小时的追踪依赖项后,我决定必须有一种更好的方法。

这是我的 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>direct-parent</artifactId>
    <groupId>com.edo.direct</groupId>
    <version>1.0-SNAPSHOT</version>
    <relativePath>../direct-parent</relativePath>
</parent>

<artifactId>direct-registration</artifactId>
<packaging>bundle</packaging>

<repositories>
    <repository>
        <id>wso2</id>
        <url>http://dist.wso2.org/maven2/</url>
    </repository>
</repositories>

<build>
    <plugins>

        <plugin>
            <groupId>org.apache.felix</groupId>
            <artifactId>maven-bundle-plugin</artifactId>
            <version>2.3.5</version>
            <extensions>true</extensions>
            <executions>
                <execution>
                    <phase>package</phase>
                    <goals>
                        <goal>bundle</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                <excludeDependencies>*;scope=compile|runtime</excludeDependencies>
                <ignoreMissingArtifacts>true</ignoreMissingArtifacts>
                <instructions>
                    <Bundle-Vendor>edo Interactive</Bundle-Vendor>
                    <Bundle-SymbolicName>com.edo.direct.service</Bundle-SymbolicName>
                    <Export-Package>
                        com.edo.service;-split-package:=merge-first
                    </Export-Package>
                    <Embed-Dependency>*;scope=compile|runtime</Embed-Dependency>
                    <Embed-Transitive>true</Embed-Transitive>
                    <Import-Package>
                        *
                    </Import-Package>
                    <Private-Package>
                        com.edo*;-split-package:=merge-first,
                    </Private-Package>
                    <Include-Resource>
                        {maven-resources}
                    </Include-Resource>
                    <Bundle-ClassPath>.,{maven-dependencies}</Bundle-ClassPath>
                </instructions>
            </configuration>
        </plugin>

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>2.9</version>
            <configuration>
                <includes>
                    <include>**/*Test.java</include>
                </includes>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>build-helper-maven-plugin</artifactId>
            <version>1.5</version>
            <executions>
                <execution>
                    <id>add-source</id>
                    <phase>generate-sources</phase>
                    <goals>
                        <goal>add-source</goal>
                    </goals>
                    <configuration>
                        <sources>
                            <source>src/main/groovy</source>
                        </sources>
                    </configuration>
                </execution>
                <execution>
                    <id>add-test-source</id>
                    <phase>generate-test-sources</phase>
                    <goals>
                        <goal>add-test-source</goal>
                    </goals>
                    <configuration>
                        <sources>
                            <source>src/test/groovy</source>
                        </sources>
                    </configuration>
                </execution>
            </executions>
        </plugin>
        <plugin>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>2.3.1</version>
            <configuration>
                <compilerId>groovy-eclipse-compiler</compilerId>
                <verbose>true</verbose>
                <source>1.6</source>
                <target>1.6</target>
            </configuration>
            <dependencies>
                <dependency>
                    <groupId>org.codehaus.groovy</groupId>
                    <artifactId>groovy-eclipse-batch</artifactId>
                    <version>1.8.0-03</version>
                </dependency>
                <dependency>
                    <groupId>org.codehaus.groovy</groupId>
                    <artifactId>groovy-eclipse-compiler</artifactId>
                    <version>2.5.1</version>
                    <exclusions>
                        <exclusion>
                            <groupId>org.codehaus.groovy</groupId>
                            <artifactId>groovy-eclipse-batch</artifactId>
                        </exclusion>
                    </exclusions>
                </dependency>
            </dependencies>
        </plugin>
    </plugins>
    <pluginManagement>
        <plugins>
            <!--This plugin's configuration is used to store Eclipse m2e settings
                only. It has no influence on the Maven build itself. -->
            <plugin>
                <groupId>org.eclipse.m2e</groupId>
                <artifactId>lifecycle-mapping</artifactId>
                <version>1.0.0</version>
                <configuration>
                    <lifecycleMappingMetadata>
                        <pluginExecutions>
                            <pluginExecution>
                                <pluginExecutionFilter>
                                    <groupId>org.codehaus.mojo</groupId>
                                    <artifactId>build-helper-maven-plugin</artifactId>
                                    <versionRange>[1.5,)</versionRange>
                                    <goals>
                                        <goal>add-source</goal>
                                        <goal>add-test-source</goal>
                                    </goals>
                                </pluginExecutionFilter>
                                <action>
                                    <execute />
                                </action>
                            </pluginExecution>
                            <pluginExecution>
                                <pluginExecutionFilter>
                                    <groupId>org.apache.maven.plugins</groupId>
                                    <artifactId>maven-compiler-plugin</artifactId>
                                    <versionRange>[2.3.1,)</versionRange>
                                    <goals>
                                        <goal>testCompile</goal>
                                        <goal>compile</goal>
                                    </goals>
                                </pluginExecutionFilter>
                                <action>
                                    <execute />
                                </action>
                            </pluginExecution>
                            <pluginExecution>
                                <pluginExecutionFilter>
                                    <groupId>org.codehaus.groovy</groupId>
                                    <artifactId>groovy-eclipse-compiler</artifactId>
                                    <versionRange>[2.5.1,)</versionRange>
                                    <goals>
                                        <goal>testCompile</goal>
                                        <goal>compile</goal>
                                    </goals>
                                </pluginExecutionFilter>
                                <action>
                                    <execute />
                                </action>
                            </pluginExecution>
                        </pluginExecutions>
                    </lifecycleMappingMetadata>
                </configuration>
            </plugin>
        </plugins>
    </pluginManagement>
</build>

<name>direct-registration</name>
<url>http://maven.apache.org</url>

<properties>
    <gmaven.version>1.3</gmaven.version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<dependencies>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.9</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.apache.axis2.wso2</groupId>
        <artifactId>axis2</artifactId>
        <version>1.6.0.wso2v4</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>org.apache.axis2</groupId>
        <artifactId>axis2-kernel</artifactId>
        <version>1.6-wso2v4</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>org.apache.axis2</groupId>
        <artifactId>axis2</artifactId>
        <version>1.6.0</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>org.apache.axis2</groupId>
        <artifactId>axis2-kernel</artifactId>
        <version>1.6.0</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>org.apache.axis2</groupId>
        <artifactId>axis2-spring</artifactId>
        <version>1.6.0</version>
        <scope>compile</scope>
        <optional>false</optional>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-core</artifactId>
        <version>3.0.5.RELEASE</version>
        <scope>compile</scope>
        <optional>false</optional>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-beans</artifactId>
        <version>3.0.5.RELEASE</version>
        <scope>compile</scope>
        <optional>false</optional>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-orm</artifactId>
        <version>3.0.5.RELEASE</version>
        <scope>compile</scope>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-web</artifactId>
        <version>3.0.5.RELEASE</version>
        <scope>compile</scope>
        <optional>false</optional>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-context</artifactId>
        <version>3.0.5.RELEASE</version>
        <scope>compile</scope>
        <optional>false</optional>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-webmvc</artifactId>
        <version>3.0.5.RELEASE</version>
        <scope>runtime</scope>
        <optional>false</optional>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-asm</artifactId>
        <version>3.0.5.RELEASE</version>
        <scope>runtime</scope>
        <optional>false</optional>
    </dependency>

    <dependency>
        <groupId>org.springframework.security</groupId>
        <artifactId>spring-security-config</artifactId>
        <version>3.0.5.RELEASE</version>
        <scope>runtime</scope>
        <optional>false</optional>
    </dependency>
    <dependency>
        <groupId>org.springframework.security</groupId>
        <artifactId>spring-security-web</artifactId>
        <version>3.0.5.RELEASE</version>
        <scope>compile</scope>
        <optional>false</optional>
    </dependency>
    <dependency>
        <groupId>org.springframework.security</groupId>
        <artifactId>spring-security-ldap</artifactId>
        <version>3.0.5.RELEASE</version>
        <scope>runtime</scope>
        <optional>false</optional>
    </dependency>

    <dependency>
        <groupId>org.grails</groupId>
        <artifactId>grails-spring</artifactId>
        <version>1.3.7</version>
        <scope>compile</scope>
        <optional>false</optional>
    </dependency>

    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-validator</artifactId>
        <version>4.2.0.Final</version>
        <scope>runtime</scope>
        <optional>false</optional>
    </dependency>
    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-core</artifactId>
        <version>3.6.5.Final</version>
        <scope>compile</scope>
        <optional>false</optional>
    </dependency>
    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-ehcache</artifactId>
        <version>3.6.5.Final</version>
        <scope>runtime</scope>
        <optional>false</optional>
    </dependency>
    <dependency>
        <groupId>org.hibernate.javax.persistence</groupId>
        <artifactId>hibernate-jpa-2.0-api</artifactId>
        <version>1.0.0.Final</version>
        <scope>compile</scope>
        <optional>false</optional>
    </dependency>

    <dependency>
        <groupId>postgresql</groupId>
        <artifactId>postgresql</artifactId>
        <version>9.0-801.jdbc4</version>
        <scope>runtime</scope>
        <optional>false</optional>
    </dependency>
    <dependency>
        <groupId>javassist</groupId>
        <artifactId>javassist</artifactId>
        <version>3.12.1.GA</version>
        <scope>runtime</scope>
        <optional>false</optional>
    </dependency>
    <dependency>
        <groupId>cglib</groupId>
        <artifactId>cglib</artifactId>
        <version>2.2.2</version>
        <scope>runtime</scope>
        <optional>false</optional>
    </dependency>
    <dependency>
        <groupId>net.sf.ehcache</groupId>
        <artifactId>ehcache-core</artifactId>
        <version>2.4.3</version>
        <scope>runtime</scope>
        <optional>false</optional>
    </dependency>

    <dependency>
        <groupId>com.google.collections</groupId>
        <artifactId>google-collections</artifactId>
        <version>1.0</version>
        <scope>compile</scope>
        <optional>false</optional>
    </dependency>
    <dependency>
        <groupId>commons-lang</groupId>
        <artifactId>commons-lang</artifactId>
        <version>2.6</version>
        <scope>compile</scope>
        <optional>false</optional>
    </dependency>
    <dependency>
        <groupId>commons-io</groupId>
        <artifactId>commons-io</artifactId>
        <version>2.0.1</version>
        <scope>compile</scope>
        <optional>false</optional>
    </dependency>
    <dependency>
        <groupId>commons-codec</groupId>
        <artifactId>commons-codec</artifactId>
        <version>1.5</version>
        <scope>compile</scope>
        <optional>false</optional>
    </dependency>
    <dependency>
        <groupId>joda-time</groupId>
        <artifactId>joda-time</artifactId>
        <version>1.6.2</version>
        <scope>compile</scope>
        <optional>false</optional>
    </dependency>

    <dependency>
        <groupId>commons-logging</groupId>
        <artifactId>commons-logging</artifactId>
        <version>1.1.1</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>1.5.10</version>
        <scope>compile</scope>
        <optional>false</optional>
    </dependency>
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-log4j12</artifactId>
        <version>1.5.10</version>
        <scope>runtime</scope>
        <optional>false</optional>
    </dependency>
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>jcl-over-slf4j</artifactId>
        <version>1.5.10</version>
        <scope>runtime</scope>
        <optional>false</optional>
    </dependency>
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>jul-to-slf4j</artifactId>
        <version>1.5.10</version>
        <scope>runtime</scope>
        <optional>false</optional>
    </dependency>
    <dependency>
        <groupId>log4j</groupId>
        <artifactId>log4j</artifactId>
        <version>1.2.16</version>
        <scope>provided</scope>
    </dependency>

    <dependency>
        <groupId>org.apache.geronimo.specs</groupId>
        <artifactId>geronimo-osgi-locator</artifactId>
        <version>1.1</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>org.apache.geronimo.specs</groupId>
        <artifactId>geronimo-jaxrs_1.1_spec</artifactId>
        <version>1.0</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>servlet-api</artifactId>
        <version>2.5</version>
        <scope>provided</scope>
    </dependency>

    <!-- Project Dependencies -->
    <dependency>
        <groupId>${project.groupId}</groupId>
        <artifactId>direct-common</artifactId>
        <version>${project.version}</version>
    </dependency>
</dependencies>
</project>

Basically, my web service must be deployable as a single OSGi jar bundle. Therefore:

  1. The bundle must contain all compile and runtime maven dependencies.
  2. It must also contain all non-optional dependencies that depend on those dependencies (i.e., the transitive dependencies).

I'm attempting to use the maven-bundle-plugin to accomplish this. I've used Embed-Dependency to get all my compile and runtime dependencies in the bundle, and I've used Embed-Transitive to embed all the transitive dependencies. I then figured out how to use excludeDependencies to exclude Maven dependencies from the BND classpath (they are moved to Private-Package in the Manifest), but for the life of me I can't figure out how to get it to exclude the transitive dependencies. No matter what I do, the transitive dependencies still seem to show up in the Import-Package list in the Manifest.

Worse, it seems to suck in ALL dependencies including optional ones so I get lots of extra stuff I don't use like ibatis and jfree. Yet, when I add ;optional=false to the dependency pattern, I get a warning that no dependencies matched the pattern.

I started trying to exclude dependencies one by one but after an hour of chasing down dependencies I decided there had to be a better way.

This is the current incarnation of my pom.xml. Can anyone help me resolve this?

<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>direct-parent</artifactId>
    <groupId>com.edo.direct</groupId>
    <version>1.0-SNAPSHOT</version>
    <relativePath>../direct-parent</relativePath>
</parent>

<artifactId>direct-registration</artifactId>
<packaging>bundle</packaging>

<repositories>
    <repository>
        <id>wso2</id>
        <url>http://dist.wso2.org/maven2/</url>
    </repository>
</repositories>

<build>
    <plugins>

        <plugin>
            <groupId>org.apache.felix</groupId>
            <artifactId>maven-bundle-plugin</artifactId>
            <version>2.3.5</version>
            <extensions>true</extensions>
            <executions>
                <execution>
                    <phase>package</phase>
                    <goals>
                        <goal>bundle</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                <excludeDependencies>*;scope=compile|runtime</excludeDependencies>
                <ignoreMissingArtifacts>true</ignoreMissingArtifacts>
                <instructions>
                    <Bundle-Vendor>edo Interactive</Bundle-Vendor>
                    <Bundle-SymbolicName>com.edo.direct.service</Bundle-SymbolicName>
                    <Export-Package>
                        com.edo.service;-split-package:=merge-first
                    </Export-Package>
                    <Embed-Dependency>*;scope=compile|runtime</Embed-Dependency>
                    <Embed-Transitive>true</Embed-Transitive>
                    <Import-Package>
                        *
                    </Import-Package>
                    <Private-Package>
                        com.edo*;-split-package:=merge-first,
                    </Private-Package>
                    <Include-Resource>
                        {maven-resources}
                    </Include-Resource>
                    <Bundle-ClassPath>.,{maven-dependencies}</Bundle-ClassPath>
                </instructions>
            </configuration>
        </plugin>

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>2.9</version>
            <configuration>
                <includes>
                    <include>**/*Test.java</include>
                </includes>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>build-helper-maven-plugin</artifactId>
            <version>1.5</version>
            <executions>
                <execution>
                    <id>add-source</id>
                    <phase>generate-sources</phase>
                    <goals>
                        <goal>add-source</goal>
                    </goals>
                    <configuration>
                        <sources>
                            <source>src/main/groovy</source>
                        </sources>
                    </configuration>
                </execution>
                <execution>
                    <id>add-test-source</id>
                    <phase>generate-test-sources</phase>
                    <goals>
                        <goal>add-test-source</goal>
                    </goals>
                    <configuration>
                        <sources>
                            <source>src/test/groovy</source>
                        </sources>
                    </configuration>
                </execution>
            </executions>
        </plugin>
        <plugin>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>2.3.1</version>
            <configuration>
                <compilerId>groovy-eclipse-compiler</compilerId>
                <verbose>true</verbose>
                <source>1.6</source>
                <target>1.6</target>
            </configuration>
            <dependencies>
                <dependency>
                    <groupId>org.codehaus.groovy</groupId>
                    <artifactId>groovy-eclipse-batch</artifactId>
                    <version>1.8.0-03</version>
                </dependency>
                <dependency>
                    <groupId>org.codehaus.groovy</groupId>
                    <artifactId>groovy-eclipse-compiler</artifactId>
                    <version>2.5.1</version>
                    <exclusions>
                        <exclusion>
                            <groupId>org.codehaus.groovy</groupId>
                            <artifactId>groovy-eclipse-batch</artifactId>
                        </exclusion>
                    </exclusions>
                </dependency>
            </dependencies>
        </plugin>
    </plugins>
    <pluginManagement>
        <plugins>
            <!--This plugin's configuration is used to store Eclipse m2e settings
                only. It has no influence on the Maven build itself. -->
            <plugin>
                <groupId>org.eclipse.m2e</groupId>
                <artifactId>lifecycle-mapping</artifactId>
                <version>1.0.0</version>
                <configuration>
                    <lifecycleMappingMetadata>
                        <pluginExecutions>
                            <pluginExecution>
                                <pluginExecutionFilter>
                                    <groupId>org.codehaus.mojo</groupId>
                                    <artifactId>build-helper-maven-plugin</artifactId>
                                    <versionRange>[1.5,)</versionRange>
                                    <goals>
                                        <goal>add-source</goal>
                                        <goal>add-test-source</goal>
                                    </goals>
                                </pluginExecutionFilter>
                                <action>
                                    <execute />
                                </action>
                            </pluginExecution>
                            <pluginExecution>
                                <pluginExecutionFilter>
                                    <groupId>org.apache.maven.plugins</groupId>
                                    <artifactId>maven-compiler-plugin</artifactId>
                                    <versionRange>[2.3.1,)</versionRange>
                                    <goals>
                                        <goal>testCompile</goal>
                                        <goal>compile</goal>
                                    </goals>
                                </pluginExecutionFilter>
                                <action>
                                    <execute />
                                </action>
                            </pluginExecution>
                            <pluginExecution>
                                <pluginExecutionFilter>
                                    <groupId>org.codehaus.groovy</groupId>
                                    <artifactId>groovy-eclipse-compiler</artifactId>
                                    <versionRange>[2.5.1,)</versionRange>
                                    <goals>
                                        <goal>testCompile</goal>
                                        <goal>compile</goal>
                                    </goals>
                                </pluginExecutionFilter>
                                <action>
                                    <execute />
                                </action>
                            </pluginExecution>
                        </pluginExecutions>
                    </lifecycleMappingMetadata>
                </configuration>
            </plugin>
        </plugins>
    </pluginManagement>
</build>

<name>direct-registration</name>
<url>http://maven.apache.org</url>

<properties>
    <gmaven.version>1.3</gmaven.version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<dependencies>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.9</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.apache.axis2.wso2</groupId>
        <artifactId>axis2</artifactId>
        <version>1.6.0.wso2v4</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>org.apache.axis2</groupId>
        <artifactId>axis2-kernel</artifactId>
        <version>1.6-wso2v4</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>org.apache.axis2</groupId>
        <artifactId>axis2</artifactId>
        <version>1.6.0</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>org.apache.axis2</groupId>
        <artifactId>axis2-kernel</artifactId>
        <version>1.6.0</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>org.apache.axis2</groupId>
        <artifactId>axis2-spring</artifactId>
        <version>1.6.0</version>
        <scope>compile</scope>
        <optional>false</optional>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-core</artifactId>
        <version>3.0.5.RELEASE</version>
        <scope>compile</scope>
        <optional>false</optional>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-beans</artifactId>
        <version>3.0.5.RELEASE</version>
        <scope>compile</scope>
        <optional>false</optional>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-orm</artifactId>
        <version>3.0.5.RELEASE</version>
        <scope>compile</scope>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-web</artifactId>
        <version>3.0.5.RELEASE</version>
        <scope>compile</scope>
        <optional>false</optional>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-context</artifactId>
        <version>3.0.5.RELEASE</version>
        <scope>compile</scope>
        <optional>false</optional>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-webmvc</artifactId>
        <version>3.0.5.RELEASE</version>
        <scope>runtime</scope>
        <optional>false</optional>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-asm</artifactId>
        <version>3.0.5.RELEASE</version>
        <scope>runtime</scope>
        <optional>false</optional>
    </dependency>

    <dependency>
        <groupId>org.springframework.security</groupId>
        <artifactId>spring-security-config</artifactId>
        <version>3.0.5.RELEASE</version>
        <scope>runtime</scope>
        <optional>false</optional>
    </dependency>
    <dependency>
        <groupId>org.springframework.security</groupId>
        <artifactId>spring-security-web</artifactId>
        <version>3.0.5.RELEASE</version>
        <scope>compile</scope>
        <optional>false</optional>
    </dependency>
    <dependency>
        <groupId>org.springframework.security</groupId>
        <artifactId>spring-security-ldap</artifactId>
        <version>3.0.5.RELEASE</version>
        <scope>runtime</scope>
        <optional>false</optional>
    </dependency>

    <dependency>
        <groupId>org.grails</groupId>
        <artifactId>grails-spring</artifactId>
        <version>1.3.7</version>
        <scope>compile</scope>
        <optional>false</optional>
    </dependency>

    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-validator</artifactId>
        <version>4.2.0.Final</version>
        <scope>runtime</scope>
        <optional>false</optional>
    </dependency>
    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-core</artifactId>
        <version>3.6.5.Final</version>
        <scope>compile</scope>
        <optional>false</optional>
    </dependency>
    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-ehcache</artifactId>
        <version>3.6.5.Final</version>
        <scope>runtime</scope>
        <optional>false</optional>
    </dependency>
    <dependency>
        <groupId>org.hibernate.javax.persistence</groupId>
        <artifactId>hibernate-jpa-2.0-api</artifactId>
        <version>1.0.0.Final</version>
        <scope>compile</scope>
        <optional>false</optional>
    </dependency>

    <dependency>
        <groupId>postgresql</groupId>
        <artifactId>postgresql</artifactId>
        <version>9.0-801.jdbc4</version>
        <scope>runtime</scope>
        <optional>false</optional>
    </dependency>
    <dependency>
        <groupId>javassist</groupId>
        <artifactId>javassist</artifactId>
        <version>3.12.1.GA</version>
        <scope>runtime</scope>
        <optional>false</optional>
    </dependency>
    <dependency>
        <groupId>cglib</groupId>
        <artifactId>cglib</artifactId>
        <version>2.2.2</version>
        <scope>runtime</scope>
        <optional>false</optional>
    </dependency>
    <dependency>
        <groupId>net.sf.ehcache</groupId>
        <artifactId>ehcache-core</artifactId>
        <version>2.4.3</version>
        <scope>runtime</scope>
        <optional>false</optional>
    </dependency>

    <dependency>
        <groupId>com.google.collections</groupId>
        <artifactId>google-collections</artifactId>
        <version>1.0</version>
        <scope>compile</scope>
        <optional>false</optional>
    </dependency>
    <dependency>
        <groupId>commons-lang</groupId>
        <artifactId>commons-lang</artifactId>
        <version>2.6</version>
        <scope>compile</scope>
        <optional>false</optional>
    </dependency>
    <dependency>
        <groupId>commons-io</groupId>
        <artifactId>commons-io</artifactId>
        <version>2.0.1</version>
        <scope>compile</scope>
        <optional>false</optional>
    </dependency>
    <dependency>
        <groupId>commons-codec</groupId>
        <artifactId>commons-codec</artifactId>
        <version>1.5</version>
        <scope>compile</scope>
        <optional>false</optional>
    </dependency>
    <dependency>
        <groupId>joda-time</groupId>
        <artifactId>joda-time</artifactId>
        <version>1.6.2</version>
        <scope>compile</scope>
        <optional>false</optional>
    </dependency>

    <dependency>
        <groupId>commons-logging</groupId>
        <artifactId>commons-logging</artifactId>
        <version>1.1.1</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>1.5.10</version>
        <scope>compile</scope>
        <optional>false</optional>
    </dependency>
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-log4j12</artifactId>
        <version>1.5.10</version>
        <scope>runtime</scope>
        <optional>false</optional>
    </dependency>
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>jcl-over-slf4j</artifactId>
        <version>1.5.10</version>
        <scope>runtime</scope>
        <optional>false</optional>
    </dependency>
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>jul-to-slf4j</artifactId>
        <version>1.5.10</version>
        <scope>runtime</scope>
        <optional>false</optional>
    </dependency>
    <dependency>
        <groupId>log4j</groupId>
        <artifactId>log4j</artifactId>
        <version>1.2.16</version>
        <scope>provided</scope>
    </dependency>

    <dependency>
        <groupId>org.apache.geronimo.specs</groupId>
        <artifactId>geronimo-osgi-locator</artifactId>
        <version>1.1</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>org.apache.geronimo.specs</groupId>
        <artifactId>geronimo-jaxrs_1.1_spec</artifactId>
        <version>1.0</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>servlet-api</artifactId>
        <version>2.5</version>
        <scope>provided</scope>
    </dependency>

    <!-- Project Dependencies -->
    <dependency>
        <groupId>${project.groupId}</groupId>
        <artifactId>direct-common</artifactId>
        <version>${project.version}</version>
    </dependency>
</dependencies>
</project>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

烈酒灼喉 2024-12-11 17:28:43

我遇到了类似的问题,我使用 tycho build,但我的捆绑包之一是使用 BND 构建的。请参阅 http://code。 google.com/p/choncms/source/browse/trunk/chon-platform/bnd-libs/pom.xml,在 Import-Package 中,我使用 !* 排除所有依赖项,除非明确需要的是 提及。

I had similar problem, I use tycho build, but one of my bundles is built with BND. See http://code.google.com/p/choncms/source/browse/trunk/chon-platform/bnd-libs/pom.xml, in Import-Package I'm using !* to exclude all dependencies except what is necessary is explicitly mentioned.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文