【问题标题】:I want to change the path of my target folder in maven我想在 Maven 中更改目标文件夹的路径
【发布时间】:2018-07-18 21:56:32
【问题描述】:

我想在 maven 中更改目标文件夹的路径。我正在使用 C:/plugins,但是当我更新我的 Maven 项目时,我得到一个内部错误发生在:“更新 Maven 项目”期间。路径必须包含项目和资源名称:/ProjectName

【问题讨论】:

  • C:/plugins
  • 听起来不是个好主意...
  • 你为什么要这样做?你想解决什么样的问题?
  • 我正在创建一个 jar,每次我必须在其他地方复制它。所以我想在 pom.xml 文件中更改我的目标文件夹路径。

标签: java maven maven-3 pom.xml


【解决方案1】:
<build>
    <directory>/your/directory</directory>
</build>

改变你的 pom.xml。

【讨论】:

  • 我正在使用相同的方式,但是当我更新我的 maven 项目时...我得到一个内部错误发生在:“更新 Maven 项目”。路径必须包含项目和资源名称:/projectName
【解决方案2】:

您应该使用配置文件。

<profiles>
    <profile>
        <id>otherOutputDir</id>
        <build>
            <directory>yourDirectory</directory>
        </build>
    </profile>
</profiles>

【讨论】:

  • 我已经构建了标签。那么我应该在哪里添加配置文件标签?
  • 它是一个层次结构,您可以在配置文件中放置构建标签。
猜你喜欢
  • 2022-01-25
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多