我将 Maven 用于我的开发目的。我有一个要求,我想在我的项目 jar 中包含一些第三方 jar,并排除 pom.xml 文件中指定的其他 jar。下面是我的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>
<groupId>com.ckdm</groupId>
<artifactId>Exporter</artifactId>
<version>atlas2.1</version>
<packaging>jar</packaging>
<name>Exporter</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<aspectj.version>1.6.10</aspectj.version>
<org.springframework.version>3.0.5.RELEASE</org.springframework.version>
</properties>
<build>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.4</version>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>com.ckdm</groupId>
<artifactId>CubeCreator</artifactId>
<version>atlas2.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.guavus</groupId>
<artifactId>ConcurrentFlows</artifactId>
<version>atlas2.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>ps</groupId>
<artifactId>thriftGenerated</artifactId>
<version>atlas2.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>apache</groupId>
<artifactId>libthrift</artifactId>
<version>0.5.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-core</artifactId>
<version>0.20.203.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>1.7.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.16</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.6.4</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-access</artifactId>
<version>1.0.1</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.0.1</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
<version>1.0.1</version>
</dependency>
</dependencies>
</project>
我在某处读到,指定的范围不包括项目 jar 中的 jar。我在哪里弄错了,它不能包含任何罐子?