2012-03-02 12 views
-1

他のプロジェクトの出力としてmavenとexternal jarsを使用しています。 プロジェクトを作成して1つのjarを作成すると、依存関係は追加されません。私は依存関係を追加したい。Eclipse Indigoにjarフォルダの依存関係は含まれていません

<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>Generic.Demo</groupId> 
     <artifactId>Generic.Demo</artifactId> 
     <version>0.0.1-SNAPSHOT</version> 
     <dependencies> 
     <dependency> 
      <groupId>org.seleniumhq.selenium</groupId> 
      <artifactId>selenium-java</artifactId> 
      <version>2.18.0</version> 
     </dependency> 
     <dependency> 
      <groupId>org.testng</groupId> 
      <artifactId>testng</artifactId> 
      <version>6.4</version> 
      <type>jar</type> 
      <scope>compile</scope> 
     </dependency> 
     <dependency> 
      <groupId>javax.mail</groupId> 
      <artifactId>mail</artifactId> 
      <version>1.4.4</version> 
      <type>jar</type> 
      <scope>compile</scope> 
     </dependency> 
     <dependency> 
      <groupId>com.thoughtworks.xstream</groupId> 
      <artifactId>xstream</artifactId> 
      <version>1.4.2</version> 
      <type>jar</type> 
      <scope>compile</scope> 
     </dependency> 
     <dependency> 
      <groupId>net.sourceforge.jexcelapi</groupId> 
      <artifactId>jxl</artifactId> 
      <version>2.6.12</version> 
      <type>jar</type> 
      <scope>compile</scope> 
     </dependency> 
     <dependency> 
      <groupId>com.google.guava</groupId> 
      <artifactId>guava</artifactId> 
      <version>11.0.2</version> 
      <type>jar</type> 
      <scope>compile</scope> 
     </dependency> 
     </dependencies> 
     <dependencyManagement> 
     <dependencies> 
     </dependencies> 
     </dependencyManagement> 
     <modules></modules> 
    </project> 

これは助けてください

を追加するビルド/プラグインのセクションがありません。..ように私のpom.xmlファイルがどのように見えるかです。

ありがとうございます。あなたのpom.xmlに内蔵された記述子jar-with-dependencies

+0

次に、build/pluginsセクションを追加します。 –

+0

そのような質問をする前に、Mavenについて少し読む必要があります。 http://sonatype.com/Support/Booksの無料の書籍から始めましょう。Maven by Exampleを見てください。 –

+0

こんにちは@GuillaumePolet ..ありがとうございます –

答えて

2

使用Mavenのアセンブリのプラグインは、ビルド/プラグイン]セクションに次のプラグインを追加します。

<plugin> 
    <artifactId>maven-assembly-plugin</artifactId> 
    <version>2.3</version> 
    <configuration> 
     <descriptorRefs> 
     <descriptorRef>jar-with-dependencies</descriptorRef> 
     </descriptorRefs> 
    </configuration> 
    <executions> 
    <execution> 
    <id>build-package</id> 
    <phase>package</phase> 
    <goals> 
     <goal>single</goal> 
    </goals> 
    </execution> 
</executions> 
</plugin> 

はすべてのための彼らのウェブサイトを見てくださいカリカリの細部。

+0

ギョーム・ポレットに返信ありがとうございます。使用する場所とそのディスクリプタの使い方を説明してください。 –

+0

こんにちは@ギヨームポレ。あなたが説明したようにしてみましたが、結果は同じです。 –

+0

目標をフェーズに結びつけましたか?私は自分の答えを編集し、その例を加えました。次に 'mvn package'を実行して、あなたが望むものを得るべきです –

関連する問題