生成与Maven的目录结构Maven项目的源代码code罐子? [英] Generating a jar with the source code of the Maven project with the Maven directory structure?

查看:184
本文介绍了生成与Maven的目录结构Maven项目的源代码code罐子?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有我用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屋!

登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆