本文介绍了在pom.xml中的属性名称中斜杠的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个问题,我无法解决.

I have a problem, what I cannot solve.

我想用Tycho/Maven构建我的eclipse cdo服务器,而且我想拥有从eclipse之外启动我的cdo-server.product的能力.

I want to build my eclipse cdo server with Tycho/Maven and also I want to have the prossibility to start my cdo-server.product out of eclipse.

它设置的cdo服务器如下: http://wiki.eclipse.org/Setting_up_a_CDO_Server

The cdo server it set up like this: http://wiki.eclipse.org/Setting_up_a_CDO_Server

没有我的问题:如果我选择:

No there is my problem:If I choose:

-Dnet4j.config="${resource_loc:/cdo.server/config}"

我可以从eclipse之外启动它,但是如果我想启动内置的CDO-Server.app,则找不到该文件夹​​.

I can start it out of eclipse, but if I want to start the built CDO-Server.app it cannot find this folder.

如果我选择:

-Dnet4j.config="../../../../../../../../../../cdo.server/config"

我可以启动内置的CDO-Server.app,但无法启动eclipse.

I can start the built CDO-Server.app, but I can't start it ou of eclipse.

这都是合乎逻辑的,但是现在我决定将$ {resource_loc:/cdo.server/config}作为pom.xml文件中的一个属性.但是,如果我这样写:

This is all logical, but now I decided to make ${resource_loc:/cdo.server/config} as a property in my pom.xml file.But if I write it like this:

<properties>
<resource_loc:/cdo.server/config>../../../../../../../../../../cdo.server/config</resource_loc:/cdo.server/config>
</properties>

我得到一个例外,由于标签中的斜线,这不是可解析的POM.

I get the exception, that this is not a parseable POM because of the slash in the tag.

如果我要这样:

<properties>
    <resource_loc:>
        <cdo.server>
           <config>../../../../../../../../../../cdo.server/config</config>
    </cdo.server>
    </resource_loc:>
</properties>

它也不是可解析的POM.可以使用$ {resource_loc:/cdo.server/config}作为属性吗?

It also is not a parseable POM. Is there any possibility to use ${resource_loc:/cdo.server/config} as a property?

推荐答案

属性定义中的问题是属性名称中的斜杠.

The problem in your property definition are the slashes in the name of the property.

以下内容将无法解析pom.xml:

The following will fail parsing the pom.xml:

<resource_loc:/cdo.server/config>yx</resource_loc:/cdo.server/config>

或 WhatEverValue

or WhatEverValue

如果您尝试使用/代替实体名称中的斜杠,它也将不起作用.

It will also not working if you try to use / as a replacement for the slash in the entity name.

这篇关于在pom.xml中的属性名称中斜杠的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-21 14:00