必须指定绝对路径maven

时间:2014-06-28 13:11:59

标签: eclipse maven settings

我在settings.xml中有以下内容

<profile>
  <id>default</id>
  <activation>
    <activeByDefault>true></activeByDefault>
  </activation>
  <properties>
    <eclipse.location>/Applications/eclipse</eclipse.location>
  </properties>
</profile>

但是我的项目中的pom.xml中的这行仍然出现错误:

        <systemPath>$(eclipse.location)/plugins/com.google.appengine.eclipse.sdkbundle_${appengine.target.version}/appengine-java-sdk-${appengine.target.version}/lib/impl/appengine-local-runtime.jar</systemPath>

项目构建错误:com.google.appengine的'dependencies.dependency.systemPath':appengine-local-runtime:jar必须指定绝对路径,但是$(eclipse.location)/plugins/com.google.appengine。 eclipse.sdkbundle_1.9.6 /应用服务引擎的Java-SDK-1.9.6 / LIB / IMPL /应用服务引擎和本地runtime.jar

从mvn clean的输出中我可以看到settings.xml文件被读取。

 [DEBUG] Reading global settings from /usr/local/apache-maven/apache-maven-3.2.1/conf/settings.xml
 [DEBUG] Reading user settings from /Users/xxx/.m2/settings.xml
 [DEBUG] Using local repository at /Users/xxx/.m2/repository

但是我得到了与上面相同的错误:

[ERROR]     'dependencies.dependency.systemPath' for com.google.appengine:appengine-local-runtime:jar must specify an absolute path but is $(eclipse.location)/plugins/com.google.appengine.eclipse.sdkbundle_1.9.6/appengine-java-sdk-1.9.6/lib/impl/appengine-local-runtime.jar @ line 274, column 16

1 个答案:

答案 0 :(得分:1)

您应该使用花括号而不是括号来引用属性:

${eclipse.location}