java - pom.xml 中的 LWJGL 项目错误:缺少工件 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>
此外,您可能希望使用描述设置 Maven 项目的官方 LWJGL 页面,因为我不确定您是否pom.xml
包含所有必要的依赖项。
推荐阅读
- c# - 按特定顺序排列乌龙
- email - 更改我们的延期交货 woocommerce 电子邮件中的“延期交货”文本
- java - 是否可以让 SwaggerHub 生成没有“@schema”注释的客户端 sdk 模型(java)?
- spring - Spring 在 Kotlin 对象中自动装配是多余的吗?
- git - git - 查找创建分支的提交
- wildfly - Wildfly 找不到要注入 CDI 托管 bean 的持久性单元
- ios - 当应用程序完全关闭时,如何通过 APNS 传递推送通知?
- ios - 到达IOS的视频部分
- node.js - 错误:libnode.so.64:无法打开共享对象文件:没有这样的文件或目录 - Docker 容器
- mysql - 为什么加载环境变量主函数golang