所以我试着为了好玩而教自己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>如有任何帮助,将不胜感激:)
发布于 2018-09-15 20:14:38
您应该为${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>此外,您可能希望使用描述设置Maven项目的官方LWJGL页面,因为我不确定您的pom.xml是否包含所有必要的依赖项。
https://stackoverflow.com/questions/52348373
复制相似问题