有人告诉我,install
目标应该意味着我生成的 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>org.zone.commandit</groupId>
<artifactId>CommandIt</artifactId>
<version>0.2</version>
<name>CommandIt</name>
<repositories>
<repository>
<id>bukkit-repo</id>
<url>http://repo.bukkit.org/content/groups/public</url>
</repository>
<repository>
<id>milkbowl-repo</id>
<url>http://ci.herocraftonline.com/plugin/repository/everything/</url>
</repository>
</repositories>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.0.2</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>bukkit</artifactId>
<version>1.5.2-R1.0</version>
<type>jar</type>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-io</artifactId>
<version>1.3.2</version>
</dependency>
<dependency>
<groupId>net.milkbowl.vault</groupId>
<artifactId>Vault</artifactId>
<version>1.2.26-SNAPSHOT</version>
<type>jar</type>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>se.krka.kahlua</groupId>
<artifactId>kahlua-cldc11</artifactId>
<version>5.1_2.1.0</version>
</dependency>
<dependency>
<groupId>se.krka.kahlua</groupId>
<artifactId>kahlua-core</artifactId>
<version>5.1_2.1.0</version>
</dependency>
<dependency>
<groupId>se.krka.kahlua</groupId>
<artifactId>kahlua-interpreter</artifactId>
<version>5.1_2.1.0</version>
</dependency>
<dependency>
<groupId>se.krka.kahlua</groupId>
<artifactId>kahlua-j2se</artifactId>
<version>5.1_2.1.0</version>
</dependency>
</dependencies>
</project>
由此,我期望一个带有 commons-io 和 kahlua 库(安装在本地存储库中)的 CommandIt-0.2.jar 文件。不应包含bukkit 和 Vault 依赖项,因为它们是在运行时环境中提供的。
但是,在使用 7zip 检查项目 jar 文件时,我发现只有 META-INF 和我自己的源代码。我究竟做错了什么?