生成与Maven的目录结构Maven项目的源代码code罐子? [英] Generating a jar with the source code of the Maven project with the Maven directory structure?
问题描述
我有我用Maven构建成战争的Web应用程序。但我想生成具有正确的Maven目录结构Maven项目的JAR。我试过<一个href=\"http://www.sonatype.com/people/2010/01/how-to-create-two-jars-from-one-project-and-why-you-shouldnt/\"相对=nofollow>这个但它扔掉Maven的目录结构中(src /主/ Java等)。我的目标是分发这个罐子给其他人,使他们能够解压并运行月食MVN:日食,并开始他们的新Web项目
I have a web application that I build with Maven into a war. But I want to generate a JAR with the maven project with the correct maven directory structure. I tried this but it throws away the Maven directory structure (src/main/java, etc.). My goal is to distribute this jar to other people so they can unpack and run mvn eclipse:eclipse and start working on their new web project.
推荐答案
为什么不使用的 Maven的组装插件 ..
Why not using the existing descriptor of maven-assembly-plugin..
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.3</version>
<configuration>
<descriptorRefs>
<descriptorRef>src</descriptorRef>
</descriptorRefs>
</configuratio
这篇关于生成与Maven的目录结构Maven项目的源代码code罐子?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!