Eclipse Maven错误:“dependencies.dependency.version”用于。。。必须是有效版本,但不可用

Eclipse Maven错误:“dependencies.dependency.version”用于。。。必须是有效版本,但不可用,eclipse,exception,maven,pom.xml,Eclipse,Exception,Maven,Pom.xml,我使用EclipseJuno创建了一个maven项目,并编辑了pom文件。当我通过mvn clean install使用命令提示符运行pom文件时,我遇到了这个错误 [ERROR] The build could not read 1 project -> [Help 1] [ERROR] [ERROR] The project se.cambio.platform.sdk:sdk-documentation-samples-laki:1 (F:\newWorkspace\s

我使用EclipseJuno创建了一个maven项目,并编辑了pom文件。当我通过mvn clean install使用命令提示符运行pom文件时,我遇到了这个错误

[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR]   The project se.cambio.platform.sdk:sdk-documentation-samples-laki:1      (F:\newWorkspace\sdk-documentation-samples-laki\pom.xml) has 2 errors
[ERROR]     'dependencies.dependency.version' for se.cambio.platform.sdk:sdk-client:jar    must be a valid version but is '${version.sdk.client}'. @ line 38, column 16
[ERROR]     'dependencies.dependency.version' for se.cambio.platform.sdk:sdk-common:jar   must be a valid version but is '${version.sdk.common}'. @ line 44, column 16
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
我的pom文件是

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"   xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-  4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>se.cambio.platform.sdk</groupId>
<artifactId>sdk-documentation-samples</artifactId>
<version>0.8.2</version>
</parent>
<artifactId>sdk-documentation-samples-laki</artifactId>
<version>1</version>
<description>this is a sample project</description>
<build>
<plugins>
  <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-jar-plugin</artifactId>
    <configuration>
      <archive>
        <manifestEntries>
          <ModuleClass>se.cambio.laki.client.Module</ModuleClass>
          <BuildVersion>${pom.version}</BuildVersion>
        </manifestEntries>
      </archive>
    </configuration>
  </plugin>
 </plugins>
</build>
<dependencies>
<dependency>
  <groupId>${project.groupId}</groupId>
  <artifactId>sdk-client</artifactId>
  <version>${version.sdk.client}</version>
  <scope>compile</scope>
</dependency>
<dependency>
  <groupId>${project.groupId}</groupId>
  <artifactId>sdk-common</artifactId>
  <version>${version.sdk.common}</version>
  <scope>compile</scope>
</dependency>
<dependency>
  <groupId>se.cambio.legacy</groupId>
  <artifactId>CDK</artifactId>
  <version>${version.cde}</version>
  <classifier>cdk-internal</classifier>
  <scope>runtime</scope>
</dependency>
<dependency>
  <groupId>commons-dbcp</groupId>
  <artifactId>commons-dbcp</artifactId>
  <version>1.4</version>
  <scope>runtime</scope>
</dependency>
        <dependency>
        <groupId>org.testng</groupId>
        <artifactId>testng</artifactId>
        <version>${version.testng}</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.mockito</groupId>
        <artifactId>mockito-all</artifactId>
        <version>1.8.5</version>
        <scope>test</scope>
    </dependency>
<dependency>
  <groupId>net.sourceforge.jtds</groupId>
  <artifactId>jtds</artifactId>
  <version>1.2.5</version>
  <scope>runtime</scope>
  </dependency>
<dependency>
        <groupId>cglib</groupId>
        <artifactId>cglib</artifactId>
        <version>2.2</version>
        <scope>test</scope>
    </dependency>
 </dependencies>
  </project>
如何解决此错误?

项目中未定义属性${version.sdk.client}和${version.sdk.common}

添加类似的内容可以解决问题。一定要调整课程的版本;1.0.0.0版本可能不是您所需要的

<properties>
    <version.sdk.client>1.0.0.RELEASE</version.sdk.client>
    <version.sdk.common>1.0.0.RELEASE</version.sdk.common>
</properties>
项目中未定义属性${version.sdk.client}和${version.sdk.common}

添加类似的内容可以解决问题。一定要调整课程的版本;1.0.0.0版本可能不是您所需要的

<properties>
    <version.sdk.client>1.0.0.RELEASE</version.sdk.client>
    <version.sdk.common>1.0.0.RELEASE</version.sdk.common>
</properties>

添加正确的属性:

<properties>
    <version.sdk.client>1.0</version.sdk.client>
    <version.sdk.common>1.0</version.sdk.common>
</properties>

但是,请确保输入正确的版本。

添加正确的属性:

<properties>
    <version.sdk.client>1.0</version.sdk.client>
    <version.sdk.common>1.0</version.sdk.common>
</properties>

但是,请确保输入正确的版本。

请发布整个pom,这样我们就可以看到您是如何声明${version.sdk.common}属性的。请发布整个pom,这样我们就可以看到您是如何声明${version.sdk.common}属性的。如果只使用一次版本号,那么只要替换$用实际版本号替换块中的{version.sdk.*}变量,而不是将其写入属性中。如果只使用一次版本号,则只需用实际版本号替换块中的${version.sdk.*}变量,而不是将其写入属性中,可能更容易读取。