外树使用Maven构建。是否可以?

编程入门 行业动态 更新时间:2024-10-23 13:23:11
本文介绍了外树使用Maven构建。是否可以?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我开始学习包装几个发行版(目前Cygwin和Debian的)。

I start learning packaging for several distros (currently Cygwin and Debian).

他们的要求来构建系统,让外树构建(同义词外源构建)

They have requirement to build system to allow out-of-tree build (synonym out-of-source build):

wiki.debian/UpstreamGuide#Out-of-Tree_Builds

要与工作围绕哑巴打造系统为例 cygport 推荐使用 lndir (从 xutils 项目):

To work-around "dumb" build system for example cygport recommend use lndir (from xutils project):

lndir ${S} ${B} cd {B} ...build-commands...

我读 MVN(1)手册页,但不会发现任何挪用。接下来,我只是尝试:

I read mvn(1) man page but doesn't found anything appropriated. Next I just try:

$ mvn archetype:generate -DgroupId=com.mycompany.app -DartifactId=my-app -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false ... $ pwd /maven/simple $ ls my-app $ mvn -f my-app/pom.xml compile ... [INFO] --- maven-compiler-plugin:2.0.2:compile (default-compile) @ my-app --- [INFO] Compiling 1 source file to /maven/simple/my-app/target/classes

正如你所看到的目标在源根目录层级中创建,而我寻找一个方法来避免这个目录。

As you can see target directory created in source root hierarchy while I look for a way to avoid this.

有可能的外树用Maven构建?怎么样?

Is it possible out-of-tree build with maven? And how?

推荐答案

这可能是具有这样的简单

It might be as simple as having a

<build> <directory>/your/build/directory</directory> </build>

在你的pom.xml。 /你/编译/目录不必在源树,并可以使用常用的参数化 $ {...} 语法。

in your pom.xml. /your/build/directory need not be in the source tree and can be parameterized using the usual ${...} syntax.

干杯,

更多推荐

外树使用Maven构建。是否可以?

本文发布于:2023-11-29 17:26:50,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1647087.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Maven

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!