maven如何解决间接依赖?

时间:2017-05-09 15:16:05

标签: maven maven-assembly-plugin maven-release-plugin

我们正在开发一个带有maven A的Jar,jar将依赖于pom.xml中的其他一些Jar B

但是当我在一个带有依赖A的项目中(int pom.xml) 它没有直接下载B,A包中有什么东西忘了吗?

pom是:

    <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>com.xxx.xxx</groupId>
<artifactId>xxx-sdk</artifactId>
<version>0.8.1.fix2</version>
<description>xxx xxx-sdk</description>
<packaging>jar</packaging>

<dependencies>
    <dependency>
        <groupId>com.xxx.xxx</groupId>
        <artifactId>xxx-sdk-xxxx</artifactId>
        <version>2.0.5</version>
    </dependency>

    <!--guava -->
    <dependency>
        <groupId>com.google.guava</groupId>
        <artifactId>guava</artifactId>
        <version>18.0</version>
    </dependency>

</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-jar-plugin</artifactId>
            <version>2.2</version>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>2.0.2</version>
            <configuration>
                <source>1.6</source>
                <target>1.6</target>
                <encoding>UTF-8</encoding>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>2.5</version>
            <configuration>
                <includes>
                    <include>**/*Test*.java</include>
                </includes>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <version>2.0.2</version>
            <executions>
                <execution>
                    <id>attach-sources</id>
                    <goals>
                        <goal>jar</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>

0 个答案:

没有答案