【问题标题】:maven The expression ${name} is deprecated. Please use ${project.name} insteadmaven 表达式 ${name} 已弃用。请改用 ${project.name}
【发布时间】:2022-11-09 20:43:18
【问题描述】:

在检测此错误消息的来源及其解决方案时遇到一些问题,很抱歉很难将 pom 作为公司的东西分享

The expression ${name} is deprecated. Please use ${project.name} instead. It is highly recommended to fix these problems because they threaten the stability of your build. For this reason, future Maven versions might no longer support building such malformed projects.

【问题讨论】:

  • 在你的 pom 或 partens 的某个地方,正在使用的表达式已经被弃用了很长时间,应该被替换......问题是为什么它仍然被使用......
  • 问题更多的是使用什么样的表达式......不知道我在寻找哪个表达式,哪个 xml 标签? @khmarbaise

标签: java maven


【解决方案1】:

进入 maven-jar-plugin 我有这个问题,改变了

<Service-Component>${name}</Service-Component>

<Service-Component>${project.name}</Service-Component>

更多背景信息

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-jar-plugin</artifactId>
            <version>3.2.2</version>
            <configuration>
                <excludes>
                    <exclude>**/*.java,**/*Test.class,**/*TestCase.class,**/.keep</exclude>
                </excludes>
                <archive>
                    <manifestEntries>
                        <version>my-project-name-${project.version}</version>
                        <Service-Component>${project.name}</Service-Component>
                    </manifestEntries>
                </archive>
            </configuration>
        </plugin>

【讨论】:

    猜你喜欢
    • 2014-12-25
    • 1970-01-01
    • 2014-04-13
    • 2016-06-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-12-01
    相关资源
    最近更新 更多