在Maven的,我可以指定我当前的项目之上的相对路径? [英] In Maven, can I specify a relative path above my current project?

查看:1682
本文介绍了在Maven的,我可以指定我当前的项目之上的相对路径?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我学习Maven的动态,同时与大集项目,以建立这样一个项目的工作。

I'm learning maven on the fly while doing work on a project with a large set of projects to build.

目前在主构建一条线使用绝对路径指定一个目录,它是Subversion版本库的一部分,但上面是目录。

Currently a line in the main build uses an absolute path to specify a directory that is part of the subversion repository but "above" it's directory.

在:C:/工作/项目/月食,其中项目是签入目录中,pom.xml的是在C:/work/project/src/subproject/pom.xml

as in: "C:/work/project/eclipse" where "project" is the checked-in directory, and the pom.xml is in "C:/work/project/src/subproject/pom.xml"

我想使该行的相对地址来代替。

I'd like to make that line a relative address instead.

我试过,指定../../ Eclipse的......,就把似乎并没有工作。

I tried specifying "../../Eclipse....", put that didn't seem to work.

这也可能是因为同一个变量正在使用的一个分次项目的POM文件。

It could also be because that same variable is being used by a sub-sub-project's pom file.

任何意见(除了重写整个混乱,我只是不知道有足够的了解行家做还)?

Any advice (aside from rewrite the whole mess, which I just don't know enough about maven to do yet)?

推荐答案

与Maven,事情的对于包含的pom.xml (这是重新由 $ {} BASEDIR psented $ p $ 属性,称为基本目录)。然而,有一些情况下,你可以有指定相对路径:

With Maven, things are relative to the directory containing the pom.xml (which is represented by the ${basedir} property and is called the base directory). There are however some situations where you could have to specify a relative path:


  • 如果一个<父> relativePath> 元素使用&LT聚甲醛是不能直接给定模块上方(请参见这个例子

  • 如果模块不嵌套(即,如果您使用平面布局)在使用相对路径的各种<模块> 元素(如在的this例如)。

  • if a <parent> pom is not directly above a given module using a <relativePath> element (see this example)
  • if modules are not nested (i.e. if you use a flat layout) using a relative path in the various <module> elements (like in this example).

拥有所有的说,我不知道要明白你的情况到底是或者你所描述的。

Having all that said, I'm not sure to understand what your situation exactly is or what you are describing.

也许你应该表现出你的POM中的相关部分,如果这是可能的。

Maybe you should show the relevant parts of your POM if this is possible.

这篇关于在Maven的,我可以指定我当前的项目之上的相对路径?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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