当前位置: 首页 > 知识库问答 >
问题:

“Dependencies.Dependency.version”缺少错误,但版本在父级中管理

赵雅懿
2023-03-14

父POM:

  <groupId>com.sw.system4</groupId>
  <artifactId>system4-parent</artifactId>
  <version>${system4.version}</version>
  <packaging>pom</packaging>
  <name>System 4 Parent Project</name>
  <modules>
    <module>system4-data</module>
     ...others...
  </modules>
  <properties>
    <system4.version>0.0.1-SNAPSHOT</system4.version>
    <spring.version>3.2.3.RELEASE</spring.version>
    ... others...
  </properties>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-core</artifactId>
        <version>${spring.version}</version>
        <scope>runtime</scope>
      </dependency>
    ... lots of others ...
    </dependencies>
  </dependencyManagement>

子POM:

  <parent>
    <groupId>com.sw.system4</groupId>
    <artifactId>system4-parent</artifactId>
    <version>0.0.1-SNAPSHOT</version>
  </parent>
  <artifactId>system4-data</artifactId>
  <dependencies>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-core</artifactId>
        <scope>runtime</scope>
    </dependency>
    ... lots of others...
  </dependencies>

当我构建时,我得到以下输出:

[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR]   The project com.sw.system4:system4-data:0.0.1-SNAPSHOT (C:\work\eclips
e_workspaces\systemiv\system4-parent\system4-data\pom.xml) has 8 errors

[ERROR]     'dependencies.dependency.version' for org.springframework:spring-cor
e:jar is missing. @ line 16, column 16

... others omitted for clarity ...

共有1个答案

毛成济
2023-03-14

我想你可以试试:

>

  • 将版本的文字值放入子pom中

    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-core</artifactId>
      <version>3.2.3.RELEASE</version>
      <scope>runtime</scope>
    </dependency>
    

    清除通常位于C:\users\user.m2\repository的.m2缓存。我会说我在Maven工作时经常这样做。特别是在提交之前,这样我就可以更有信心地运行配置项。您不必每次都使用nuke文件夹,有时只需要您的项目包和.cache文件夹就足够了。

    <parent>
      <groupId>com.mycompany.app</groupId>
      <artifactId>my-app</artifactId>
      <version>1</version>
     <relativePath>../parent/pom.xml</relativePath>
    </parent>
    

  •  类似资料:
    • 当我运行npm运行json: server时,我得到了这个错误。 npm错误!缺少脚本:json: 当我打开日志文件时,它是这样说的: 0信息,如果它以ok结束1详细cli['C:\Program Files\nodejs\node.exe',1详细cli'C:\用户\IanP\AppData\漫游\npm\node_modules\npm\bin\npm-cli.js',1详细cli'run',

    • 我试图在服务器端运行我的Angular应用程序,但我遇到了以下错误: npm错误!缺少脚本:Build:Universal

    • 我最近在我的Macbook Pro上升级到了Java7。我下载了JDK(而不是JRE)。 但是,当尝试运行构建时,一个maven编译器插件失败了,它声称我安装了一个JRE: 我很困惑,因为我显然已经安装了JDK。我的不要做任何有趣的事情: 这似乎是无害的,所以我怀疑我的命令行env有问题,并编写了一个简单的测试: 如果我正确理解了这个错误,那么它建议使用Java7编译器运行Java5? 我不确定这

    • 我想在HW的整数中找到奇数。所以CountOddigtis(56781)应该返回(非打印)5 7 1。我的方法是将整数转换为字符串,并使用它返回。我遇到的问题是 > 缺少返回语句错误,即使我在if语句中有一个返回语句。有人能解释这个错误意味着什么以及如何克服它吗? 当我把返回x;放在方法的末尾时,它会打印56781的错误答案49。 Java解决stringn.charat(x)%2!=0考虑到我可

    • 自从升级到Gradle 3.3以来,由于缺少翻译错误,我在构建代码时遇到了麻烦: 错误:xxx没有翻译成“af”(南非荷兰语)、“am”(阿姆哈拉语)、“ar”(阿拉伯语)、“az”(阿塞拜疆)、“az-az”(阿塞拜疆:阿塞拜疆)、“be”(白俄罗斯)、“bg”(保加利亚)、“ca”(加泰罗尼亚)、[……],“zh TW”(中文:台湾)、“zu”(祖鲁)[缺失翻译] 报告的大多数语言都是我的项目