pom.xml 中的 LWJGL 项目错误:缺少工件 org.lwjgl:lwjgl-platform:jar:natives-windows:${lwjgl.version}
LWJGL project error in pom.xml: Missing artifact org.lwjgl:lwjgl-platform:jar:natives-windows:${lwjgl.version}
所以我自学 LWJGl 很有趣,所以我制作了项目文件,将这些东西放入 pom.xml 文件中,然后我得到了这个错误:
缺少工件 org.lwjgl:lwjgl-platform:jar:natives-windows:${lwjgl.version}
这是我的 pom.xml 文件:
<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>
<groupId>learninglwjgl</groupId>
<artifactId>learninglwjgl</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>learninglwjgl</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.lwjgl</groupId>
<artifactId>lwjgl-platform</artifactId>
<version>${lwjgl.version}</version>
<classifier>${native.target}</classifier>
</dependency>
</dependencies>
<profiles>
<profile>
<id>windows-profile</id>
<activation>
<os>
<family>Windows</family>
</os>
</activation>
<properties>
<native.target>natives-windows</native.target>
</properties>
</profile>
<profile>
<id>linux-profile</id>
<activation>
<os>
<family>Linux</family>
</os>
</activation>
<properties>
<native.target>natives-linux</native.target>
</properties>
</profile>
<profile>
<id>OSX-profile</id>
<activation>
<os>
<family>mac</family>
</os>
</activation>
<properties>
<native.target>natives-osx</native.target>
</properties>
</profile>
</profiles>
</project>
任何帮助将不胜感激,谢谢:)
您应该为 ${lwjgl.version}
定义一个 属性。正如您在 Maven Central 中所见,此工件的唯一版本是 3.0.0
,您必须明确定义它。请用以下内容替换您的 <properties>
标签:
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<lwjgl.version>3.0.0</lwjgl.version>
</properties>
此外,您可能希望使用 the offical LWJGL page 描述设置 Maven 项目,因为我不确定您的 pom.xml
是否包含所有必要的依赖项。
所以我自学 LWJGl 很有趣,所以我制作了项目文件,将这些东西放入 pom.xml 文件中,然后我得到了这个错误:
缺少工件 org.lwjgl:lwjgl-platform:jar:natives-windows:${lwjgl.version}
这是我的 pom.xml 文件:
<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>
<groupId>learninglwjgl</groupId>
<artifactId>learninglwjgl</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>learninglwjgl</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.lwjgl</groupId>
<artifactId>lwjgl-platform</artifactId>
<version>${lwjgl.version}</version>
<classifier>${native.target}</classifier>
</dependency>
</dependencies>
<profiles>
<profile>
<id>windows-profile</id>
<activation>
<os>
<family>Windows</family>
</os>
</activation>
<properties>
<native.target>natives-windows</native.target>
</properties>
</profile>
<profile>
<id>linux-profile</id>
<activation>
<os>
<family>Linux</family>
</os>
</activation>
<properties>
<native.target>natives-linux</native.target>
</properties>
</profile>
<profile>
<id>OSX-profile</id>
<activation>
<os>
<family>mac</family>
</os>
</activation>
<properties>
<native.target>natives-osx</native.target>
</properties>
</profile>
</profiles>
</project>
任何帮助将不胜感激,谢谢:)
您应该为 ${lwjgl.version}
定义一个 属性。正如您在 Maven Central 中所见,此工件的唯一版本是 3.0.0
,您必须明确定义它。请用以下内容替换您的 <properties>
标签:
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<lwjgl.version>3.0.0</lwjgl.version>
</properties>
此外,您可能希望使用 the offical LWJGL page 描述设置 Maven 项目,因为我不确定您的 pom.xml
是否包含所有必要的依赖项。