【问题标题】:No versions available for org.eclipse.swt.win32.win32:x86_64:jar没有可用于 org.eclipse.swt.win32.win32:x86_64:jar 的版本
【发布时间】:2014-03-23 10:10:35
【问题描述】:

在尝试依赖 piccolo2d-swt-examples 工件(在 m2e 中)时,我收到以下消息

VersionRangeResolutionException: No versions available for org.eclipse.swt.win32.win32:x86_64:jar:[3.3.0-v3346,) within 
 specified range

这条消息的含义是什么?这是否意味着根本没有win32的库?还是说SWT不在maven控制之下?

更新

下面是我当前的POM

目前它对SWT 没有任何显式依赖。由于不熟悉 Maven,我无法判断此消息是否意味着 Maven 从全局设置和报告中感觉到我的 SWT 版本,没有为它编写的库,或者它只是在存储库中找不到任何必需的 SWT 库.

在第一种情况下,我根本不能使用 SWT 版本的 Piccolo(它不是可移植的,因为不是为所有平台编写的),而在第二种情况下,我可以使用它,但需要在本地存储库中为 Maven 打包 SWT。

这是问题。

<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>tests</groupId>
    <artifactId>Piccolo2D_3_Tests</artifactId>
    <version>0.0.1-SNAPSHOT</version>

    <dependencies>


        <dependency>
            <groupId>org.piccolo2d</groupId>
            <artifactId>piccolo2d-swt-examples</artifactId>
            <version>3.0</version>
        </dependency>


    </dependencies>
</project>

【问题讨论】:

  • 您想构建一个 64 位应用程序吗?如果没有,我会尝试将 org.eclipse.swt.win32.win32:x86:3.3.0-v3346 添加到依赖项中。
  • @MatthiasBraun 请看我的更新。

标签: java eclipse maven native piccolo


【解决方案1】:
VersionRangeResolutionException: No versions available for   
org.eclipse.swt.win32.win32:x86_64:jar:[3.3.0-v3346,) within specified range

根据maven central query,该 swt jar 文件没有 x86_64 工件,但 there is an x86 artifact

您可能想尝试使用 mvn -Pwindows_x86 强制您的 piccolo2d 依赖项显式激活其 windows_x86 配置文件,或者(更新 2)尝试使用 32 位 Java JDK 构建。

更新 1:您的问题类似于 piccolo Issue 203: Missing maven profile for Windows x86_64

【讨论】:

  • 为什么不说“缺少工件”?
  • 这将是 maven 开发人员的问题。
【解决方案2】:

我从这里 (http://www.java2s.com/Code/Jar/o/Downloadorgeclipseswtwin32win32x866442jar.htm) 下载了缺少的工件并使用
&gt;mvn install:install-file -Dfile=org.eclipse.swt.win32.win32.x86_64-4.2.jar -DgroupId=org.eclipse.swt.win32.win32 -DartifactId=x86_64 -Dversion=4.2 -Dpackaging=jar 安装了 jar
它开始正常工作:)

PS:这样你根本不需要篡改配置文件。

【讨论】:

  • 我会从官方 eclipse archive 站点下载 SWT 实现。下载swt-3.4.zip,解压并使用内部swt.jar文件。
【解决方案3】:

这是来自Piccolo readme

To include the Piccolo2D core classes in your project, use a
dependency of

<dependency>
  <groupId>org.piccolo2d</groupId>
  <artifactId>piccolo2d-core</artifactId>
  <version>1.3.1</version>
</dependency>

in your pom.xml. To include the Piccolo2D core classes and the
Piccolo2D extras classes in your project, use a dependency of

<dependency>
  <groupId>org.piccolo2d</groupId>
  <artifactId>piccolo2d-extras</artifactId>
  <version>1.3.1</version>
</dependency>

in your pom.xml. To include the Piccolo2D core classes and the
Piccolo2D SWT classes in your project, use a dependency of

<dependency>
  <groupId>org.piccolo2d</groupId>
  <artifactId>piccolo2d-swt</artifactId>
  <version>1.3.1</version>
</dependency>

添加这些依赖项会改变什么吗?

【讨论】:

  • 没有。最后一个工件很可能取决于前两个,因此它们是 Maven 自动包含的。
  • 自述文件中的另一篇文章:For some platforms, including Mac OSX with JDK version 1.6 or later on x86_64, the Eclipse Standard Widget Toolkit (SWT) version 3.3.0 or later must also be installed manually. Eclipse Standard Widget Toolkit http://www.eclipse.org/swt/
  • 通过Eclipse的“外部jar”方式下载和引用。如果没有 Maven,我可以编译和运行独立的 SWT 类。
猜你喜欢
  • 2016-06-27
  • 2021-08-25
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-11-24
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多