【问题标题】:SWT dependency artifact missing?缺少 SWT 依赖项工件?
【发布时间】:2015-10-28 18:29:11
【问题描述】:

我想在我的项目中使用 swt,并以此页面为起点: https://code.google.com/p/swt-repo/

我添加了存储库和依赖项,但我的 pom.xml 有一个错误说: 缺少工件 org.eclipse.swt:org.eclipse.swt.win32.win32.x86:jar:4.4

可能是什么问题?

我的整个 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>group</groupId>
    <artifactId>artifact</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <packaging>jar</packaging>

    <name>artifact</name>
    <url>http://maven.apache.org</url>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <dependencies>
        <!-- SWT -->
        <dependency>
            <groupId>org.eclipse.swt</groupId>
            <artifactId>org.eclipse.swt.win32.win32.x86</artifactId>
            <version>4.4</version>
        </dependency>       
    </dependencies>

    <repositories>
        <repository>
            <id>swt-repo</id>
            <url>https://swt-repo.googlecode.com/svn/repo/</url>
        </repository>
    </repositories>
</project>

【问题讨论】:

    标签: java eclipse maven swt


    【解决方案1】:

    问题在于没有托管 SWT 库文件的官方 maven 存储库。过去有一些网站可以工作,但现在几乎所有网站都被废弃、关闭或搬迁。他们在https://github.com/maven-eclipse/maven-eclipse.github.io 上解释了问题,但那里描述的解决方案(使用http://maven-eclipse.github.io/maven)不起作用,因为该链接会将您重定向到 git 存储库。

    您发布的链接似乎是目前剩下的唯一 maven repo。 Maven 像您一样正确访问它时遇到问题。我不完全确定问题是什么。我怀疑它与丢失或无效的索引有关,但我不确定。无论如何,最好的解决方案是下载所需的 jar 并将它们手动添加到本地存储库。无论如何,这可能是个好主意,因为 Google Code 将在 2016 年 1 月关闭

    顺便说一句,有an open bug for SWT to be distributed via Maven,但它是在 2007 年发布的!仍然没有官方解决方案。

    【讨论】:

      猜你喜欢
      • 2012-12-15
      • 1970-01-01
      • 2012-02-28
      • 1970-01-01
      • 2017-12-25
      • 2015-04-18
      • 2020-03-24
      • 2012-07-12
      • 1970-01-01
      相关资源
      最近更新 更多