简体   繁体   English

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}

So I'm trying to teach myself LWJGl for fun, so I make the project file, put the things into the pom.xml file, and then I get this error: 因此,我试图自学LWJGl,所以我制作了项目文件,并将其放入pom.xml文件,然后出现此错误:

Missing artifact org.lwjgl:lwjgl-platform:jar:natives-windows:${lwjgl.version} 缺少工件org.lwjgl:lwjgl-platform:jar:natives-windows:$ {lwjgl.version}

This is my pom.xml file: 这是我的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>

Any help would be appreciated, thanks :) 任何帮助,将不胜感激,谢谢:)

You should define a property for ${lwjgl.version} . 您应该为${lwjgl.version}定义一个属性。 As you can see at Maven Central , the only version of this artifact is 3.0.0 and you must explicitly define it. 如您在Maven Central所看到的,此工件的唯一版本是3.0.0 ,您必须显式定义它。 Please replace your <properties> tag with the following: 请用以下内容替换您的<properties>标记:

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <lwjgl.version>3.0.0</lwjgl.version>
</properties>

Also, you might want to get use of the offical LWJGL page describing setting up Maven project, as I am not sure if your pom.xml includes all necessary dependencies. 另外,您可能想使用描述建立Maven项目的官方LWJGL页面 ,因为我不确定pom.xml包含所有必需的依赖项。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM