【问题标题】:must specify an absolute path maven必须指定绝对路径 maven
【发布时间】:2014-06-28 13:11:59
【问题描述】:

我的 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:appengine-local-runtime:jar 的“dependencies.dependency.systemPath”必须指定绝对路径,但为 $(eclipse.location)/plugins/com.google.appengine。 eclipse.sdkbundle_1.9.6/appengine-java-sdk-1.9.6/lib/impl/appengine-local-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

【问题讨论】:

  • 你不会失败&lt;activeByDefault&gt;true&gt;&lt;/activeByDefault&gt;这看起来不对。
  • 我建议不要使用 systemPath。您最好开始使用存储库管理器并将您的工件放在那里。

标签: eclipse maven settings


【解决方案1】:

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

${eclipse.location}

【讨论】:

  • 谢谢。盯着这个东西看了好久,没看到。
猜你喜欢
  • 2014-02-28
  • 2015-01-14
  • 2016-03-16
  • 2016-09-29
  • 2022-12-15
  • 2020-03-06
  • 2018-02-04
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多