如何解决这些 Maven 2 警告?

发布于 2024-10-29 01:16:01 字数 1806 浏览 2 评论 0原文

我正在使用 Maven 2.2 和 Grails 1.2.1。当尝试运行“集成测试”目标时,我收到一些神秘的警告,我不知道如何解决...

davea-mbp2:socialmediaproxy davea$ mvn Integration-test
[信息] 扫描项目...
[警告]
[警告] 为socialmediaproxy构建有效模型时遇到了一些问题:socialmediaproxy:war:0.1
[警告] org.apache.maven.plugins:maven-compiler-plugin 的“build.plugins.plugin.version”丢失。 @第125行,第15列
[警告] net.sf.ehcache:ehcache-core:jar 缺少“dependency.dependency.exclusions.exclusion.groupId”。 @第33行,第22列
[警告] net.sf.ehcache:ehcache-core:jar 缺少“dependency.dependency.exclusions.exclusion.groupId”。 @第36行第22列
[警告] net.sf.ehcache:ehcache-core:jar 缺少“dependency.dependency.exclusions.exclusion.groupId”。 @第41行第22列
[警告]
[警告] 强烈建议修复这些问题,因为它们会威胁到您构建的稳定性。
[警告]
[警告] 因此,未来的 Maven 版本可能不再支持构建此类格式错误的项目。
[警告]

这是我的 pom.xml 中警告所指的部分...

<!-- Grails defaults to Ehache for the second-level Hibernate cache. -->
    <dependency>
      <groupId>org.hibernate</groupId>
      <artifactId>hibernate-ehcache</artifactId>
      <version>3.3.1.GA</version>
    </dependency>

    <dependency>
      <groupId>net.sf.ehcache</groupId>
      <artifactId>ehcache-core</artifactId>
      <version>1.7.1</version>
  <exclusions>
      <exclusion> <!-- line 33 -->
          <artifactId>jms</artifactId>
      </exclusion>
      <exclusion> <!-- line 36 -->
          <artifactId>servlet-api</artifactId>
      </exclusion>

      <!-- We have JCL-over-SLF4J instead. -->
      <exclusion>
          <artifactId>commons-logging</artifactId>
      </exclusion>
  </exclusions>
    </dependency>

我有什么想法可以解决这些问题吗?谢谢,-戴夫

I'm using Maven 2.2 with Grails 1.2.1. When trying to run the "integration-test" target, I get some cryptic warnings, which I can't figure out how to resolve ...

davea-mbp2:socialmediaproxy davea$ mvn integration-test

[INFO] Scanning for projects...

[WARNING]

[WARNING] Some problems were encountered while building the effective model for socialmediaproxy:socialmediaproxy:war:0.1

[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. @ line 125, column 15

[WARNING] 'dependencies.dependency.exclusions.exclusion.groupId' for net.sf.ehcache:ehcache-core:jar is missing. @ line 33, column 22

[WARNING] 'dependencies.dependency.exclusions.exclusion.groupId' for net.sf.ehcache:ehcache-core:jar is missing. @ line 36, column 22

[WARNING] 'dependencies.dependency.exclusions.exclusion.groupId' for net.sf.ehcache:ehcache-core:jar is missing. @ line 41, column 22

[WARNING]

[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.

[WARNING]

[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.

[WARNING]

Here is the part of my pom.xml the warnings are referring to ...

<!-- Grails defaults to Ehache for the second-level Hibernate cache. -->
    <dependency>
      <groupId>org.hibernate</groupId>
      <artifactId>hibernate-ehcache</artifactId>
      <version>3.3.1.GA</version>
    </dependency>

    <dependency>
      <groupId>net.sf.ehcache</groupId>
      <artifactId>ehcache-core</artifactId>
      <version>1.7.1</version>
  <exclusions>
      <exclusion> <!-- line 33 -->
          <artifactId>jms</artifactId>
      </exclusion>
      <exclusion> <!-- line 36 -->
          <artifactId>servlet-api</artifactId>
      </exclusion>

      <!-- We have JCL-over-SLF4J instead. -->
      <exclusion>
          <artifactId>commons-logging</artifactId>
      </exclusion>
  </exclusions>
    </dependency>

Any ideas how i can solve these? Thanks, - Dave

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

阿楠 2024-11-05 01:16:01

只是 pom.xml 排除中的配置错误 - 您需要添加 groupId 条目。我不知道它们到底需要什么(可能是 javax.jms),但只需根据需要替换修复程序。

<dependency>
      <groupId>net.sf.ehcache</groupId>
      <artifactId>ehcache-core</artifactId>
      <version>1.7.1</version>
  <exclusions>
      <exclusion> <!-- line 33 -->
          <groupId>fixme</groupId>
          <artifactId>jms</artifactId>
      </exclusion>
      <exclusion> <!-- line 36 -->
          <groupId>fixme</groupId>
          <artifactId>servlet-api</artifactId>
      </exclusion>

      <!-- We have JCL-over-SLF4J instead. -->
      <exclusion>
          <groupId>fixme</groupId>
          <artifactId>commons-logging</artifactId>
      </exclusion>
  </exclusions>
    </dependency>

Just a misconfiguration in your pom.xml exclusions - you need to add the groupId entries. I don't know exactly what they need to be (possibly javax.jms) but just replace the fixme as necessary.

<dependency>
      <groupId>net.sf.ehcache</groupId>
      <artifactId>ehcache-core</artifactId>
      <version>1.7.1</version>
  <exclusions>
      <exclusion> <!-- line 33 -->
          <groupId>fixme</groupId>
          <artifactId>jms</artifactId>
      </exclusion>
      <exclusion> <!-- line 36 -->
          <groupId>fixme</groupId>
          <artifactId>servlet-api</artifactId>
      </exclusion>

      <!-- We have JCL-over-SLF4J instead. -->
      <exclusion>
          <groupId>fixme</groupId>
          <artifactId>commons-logging</artifactId>
      </exclusion>
  </exclusions>
    </dependency>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文