【问题标题】:What is ${session.executionRootDirectory} and how to set it什么是 ${session.executionRootDirectory} 以及如何设置它
【发布时间】:2017-10-13 09:23:45
【问题描述】:

我在我的系统中使用 dl4j 示例。这是一个包含各种模块的 Maven 项目。里面有几个pom文件。在父 pom 文件中,我注意到我收到一条错误消息:

无法解析符号“session.executionRootDirectory”

.

我不记得改变这一行(或这个 pom 文件)。产生问题的行是这一行:

<configFile>${session.executionRootDirectory}/contrib/formatter.xml</configFile>

在文件 parent pom file 第 90 行。

我的问题是,${session.executionRootDirectory} 似乎是我的系统无法识别的变量,我应该设置它吗?是否应该通过其他方式设置? 欢迎了解 ${session.executionRootDirectory} 是什么以及如何设置它。

我的系统是win7,我用的是Intellij Idea。

问题似乎可以通过将变量替换为它指向的文件路径的实际值(即 formatter.xml)来解决,但我想知道为什么使用该变量不起作用。

【问题讨论】:

  • 这是一个 Maven 属性检查:maven.apache.org/examples/…
  • 在 maven 指令中,它指的是一个 Settings.xml 文件。该文件应该在哪里?
  • 我认为在 .m2/settings.xml 中。也可以设置具体路径,见文档:maven.apache.org/settings.html
  • 你不想写一个答案让我选择它作为解决方案吗?
  • 当然,如果需要,请随时对其进行编辑以添加详细信息。谢谢!

标签: java maven deeplearning4j


【解决方案1】:

${...} 之间的值是 Maven 属性。详细解释可以阅读文档here

必须在settings.xml 文件中配置值。

此文件可能存在于:

  • Maven 安装:${maven.home}/conf/settings.xml
  • 用户安装:${user.home}/.m2/settings.xml

有关settings.xml的更多详细信息,请查看Maven documentation

【讨论】:

  • 对不起,看来这最终并没有解决我的问题,所以我不能接受作为答案。
【解决方案2】:

不,它在您的项目路径中:

dl4j-examples/contrib/formatter.xml

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-11-01
    • 1970-01-01
    • 2021-10-27
    • 1970-01-01
    相关资源
    最近更新 更多