2
我正在使用Maven的exec:java爲我的項目之一運行jline(下面附帶的當前POM)。該項目曾經是一個單一的組件,所以所有的依賴都與exec:java插件定義在同一個POM中。這工作得很好,所有的依賴關係都被拾起,並在運行'mvn exec:java'時放在類路徑中。然而,我現在已經將項目分成幾個模塊,並希望在exec:java運行時從每個模塊獲取依賴關係,但我無法弄清楚如何配置它。建議將不勝感激!獲取Maven exec:使用項目模塊依賴關係的java插件
感謝, 尼克
<?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>
<name>Lensfield</name>
<groupId>org.lensfield</groupId>
<artifactId>lensfield-pom</artifactId>
<version>0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.1</version>
<executions>
<execution>
<goals>
<goal>java</goal>
</goals>
</execution>
</executions>
<configuration>
<includeProjectDependencies>true</includeProjectDependencies>
<includePluginDependencies>true</includePluginDependencies>
<executableDependency>
<groupId>jline</groupId>
<artifactId>jline</artifactId>
</executableDependency>
<mainClass>jline.ConsoleRunner</mainClass>
<arguments>
<argument>clojure.lang.Repl</argument>
</arguments>
</configuration>
<dependencies>
<dependency>
<groupId>jline</groupId>
<artifactId>jline</artifactId>
<version>0.9.94</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
<modules>
<module>lensfield-share</module>
<module>lensfield-build</module>
<module>lensfield-webapp</module>
</modules>
</project>
輝煌 - 非常感謝! – eldoctoro 2009-09-30 12:21:50