2012-04-26 5 views
0

現在、以下は現在私の依存関係をとり、新しく作成したlibディレクトリに配置しています。mvnアセンブリで

<dependencySets> 
    <dependencySet> 
     <outputDirectory>lib</outputDirectory> 
     <scope>runtime</scope> 
    </dependencySet> 
</dependencySets> 

質問:どのように1ファイルを除外するように変更できますか?

次は動作しません:

<dependencySets> 
    <dependencySet> 
     <outputDirectory>lib</outputDirectory> 
     <scope>runtime</scope> 
     <excludes> 
      <exclude>my_program-0.0.1-SNAPSHOT.jar</exclude> 
     </excludes> 
    </dependencySet> 
</dependencySets> 
+0

http://maven.apache.org/plugins/maven-assembly-plugin/examples/single/including-and-excluding-artifacts.html –

答えて

1

は、規則を使用してみてください:

<exclude>groupId:artifactId</exclude> 

ですから、たとえば持っていた場合:

 <dependency> 
     <groupId>org.springframework</groupId> 
     <artifactId>spring-jdbc</artifactId> 
     <version>3.0.5.RELEASE</version> 
    </dependency> 

それを除外するには:

<exclude>org.springframework:spring-jdbc</exclude> 
+0

「あなたが構築しているもの」を記述する一般的な方法はありますか?言い換えると、私がビルドしているjarファイルは 'lib'に置かれることはありませんが、常に' bin 'にあるはずです – JAM

+0

あなたはプロジェクトプロパティを使うことができます:$ {project.groupId}:$ {project.artifactId} – Farid

+0

優れています。ありがとう – JAM

関連する問題