java maven 项目:SWT 3.5 依赖:任何官方公共仓库?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5096299/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-30 09:24:19  来源:igfitidea点击:

maven project: SWT 3.5 dependency: any official public repo?

javamavenswtconventions

提问by Anton K

Well, in short, I mayneed to grab new SWT version instead of 3.3 we're using for now. The project now has only this dependency and builds fine:

嗯,简而言之,我可能需要获取新的 SWT 版本,而不是我们目前使用的 3.3。该项目现在只有这个依赖项并且构建良好:

<dependency>
  <groupId>org.eclipse.swt.win32.win32</groupId>
  <artifactId>x86</artifactId>
  <version>3.3.0-v3346</version>
</dependency>

AFAICGoogle, there is no more recent version in the public maven repo: http://repo1.maven.org/maven2/org/eclipse/swt/

AFAICGoogle,公共 maven repo 中没有更新的版本:http://repo1.maven.org/maven2/org/eclipse/swt/

So:

所以:

  1. Is there some public maven repo with recent builds?
  2. If not, where do you get the jars you install locally and/or in your corporate Nexus?
  3. Any groupId/artifactId suggestions/conventions you know of?
  1. 是否有一些最近构建的公共 Maven 仓库?
  2. 如果没有,您从哪里获得在本地和/或公司 Nexus 中安装的 jars?
  3. 您知道的任何 groupId/artifactId 建议/约定吗?

TIA

TIA

PS: I am mostly a noob as to Eclipse products site layout and usually get lost in Google search results and/or the Eclipse site itself... so while the answer may be obvious for you it would likely not be so for me, even retrospectively.

PS:我对 Eclipse 产品站点布局基本上是个菜鸟,通常会在 Google 搜索结果和/或 Eclipse 站点本身中迷失……所以虽然答案对你来说可能很明显,但对我来说可能不是这样,即使追溯。

采纳答案by lenkite

Update: The repo was taken downand replaced by repo.eclipse.org which does not hold SWT artifacts.

更新:repo 被撤下并由 repo.eclipse.org 取代,它不保存 SWT 工件。

You can use a Nexus repository hosted at eclipse (this repository is in 'testing' status)

您可以使用 Eclipse 托管的 Nexus 存储库(此存储库处于“测试”状态)

http://maven.eclipse.org/nexus/content/repositories/testing/org/eclipse/swt/

http://maven.eclipse.org/nexus/content/repositories/testing/org/eclipse/swt/

There is a bug open on this with further info: https://bugs.eclipse.org/bugs/show_bug.cgi?id=199302

有一个错误打开了更多信息:https: //bugs.eclipse.org/bugs/show_bug.cgi?id=199302

回答by urish

I have created a maven repo for windows, Linux & osx artifacts at github:

我在 github 上为 windows、Linux 和 osx 工件创建了一个 maven 仓库:

https://github.com/maven-eclipse/swt-repo

https://github.com/maven-eclipse/swt-repo

To use it just put the following in your pom.xml:

要使用它,只需将以下内容放入您的 pom.xml 中:

<repositories>
    <repository>
        <id>swt-repo</id>
        <url>https://raw.githubusercontent.com/maven-eclipse/swt-repo/master/</url>
    </repository>
</repositories>

Then you can just reference the SWT dependency relevant to your platform. For example:

然后您可以只引用与您的平台相关的 SWT 依赖项。例如:

    <dependency>
        <groupId>org.eclipse.swt</groupId>
        <artifactId>org.eclipse.swt.win32.win32.x86</artifactId>
        <version>4.4</version>
    </dependency>

For other platforms, just replace artifactId with the appropriate value:

对于其他平台,只需将 artifactId 替换为适当的值:

  • org.eclipse.swt.win32.win32.x86
  • org.eclipse.swt.win32.win32.x86_64
  • org.eclipse.swt.gtk.linux.x86
  • org.eclipse.swt.gtk.linux.x86_64
  • org.eclipse.swt.cocoa.macosx
  • org.eclipse.swt.cocoa.macosx.x86_64
  • org.eclipse.swt.win32.win32.x86
  • org.eclipse.swt.win32.win32.x86_64
  • org.eclipse.swt.gtk.linux.x86
  • org.eclipse.swt.gtk.linux.x86_64
  • org.eclipse.swt.cocoa.macosx
  • org.eclipse.swt.cocoa.macosx.x86_64

In addition, artifacts for SWT 4.3.2, 4.3.1, 4.3.0, 4.2.2, 4.2.1, 3.8, 3.7.2 & 3.5.1 are also available from this repository.

此外,此存储库还提供 SWT 4.3.2、4.3.1、4.3.0、4.2.2、4.2.1、3.8、3.7.2 和 3.5.1 的工件。

We use a selenium-based approach to automatically deploy the artifacts of new SWT versions as they are released. The source code for the automation is open and available on github:

我们使用基于 selenium 的方法在新 SWT 版本发布时自动部署工件。自动化的源代码是开放的,可在 github 上获得:

https://github.com/hennr/swt-release-fetcher

https://github.com/hennr/swt-release-fetcher

Happy coding!

快乐编码!

回答by Anton K

Grab herethe version you need. SWT is still not bundled platform-neutrally, so you have to pay attention to the platform to use. I'd grabbed windows version, with postfix of 3.6.1-win32-win32-x86. I've used that as a versionId, leaving the platform out of group/artifact fields. This might be not totally correct for maven gurus but fits for me quite well (at least for now). Also I am using the debug-version of the jar, which is okay for development.

在这里你需要的版本。SWT 还没有捆绑平台中立,所以你要注意使用的平台。我抓住了 Windows 版本,后缀为 3.6.1-win32-win32-x86。我已将其用作 versionId,将平台排除在组/工件字段之外。这对于 maven 大师来说可能并不完全正确,但非常适合我(至少现在是这样)。此外,我正在使用 jar 的调试版本,这对于开发来说是可以的。

So here we go.

所以我们开始了。

Unpack the archive and then issue this (in the root folder of your archive):

解压存档,然后发出此命令(在存档的根文件夹中):

mvn install:install-file -DgroupId=org.eclipse -DartifactId=swt -Dversion=3.6.1-win32-win32-x86 -Dfile=swt-debug.jar -Dpackaging=jar -DlocalRepositoryPath=../path/to/your/local/project/repo

and then this, to install sources as well:

然后这个,也安装源代码:

mvn install:install-file -DgroupId=org.eclipse -DartifactId=swt -Dversion=3.6.1-win32-win32-x86 -Dfile=src.zip -Dpackaging=jar -Dclassifier=sources -DlocalRepositoryPath=../path/to/your/local/project/repo

Add reference to a local repo to your pom.xml,

将本地存储库的引用添加到您的 pom.xml,

<repositories>
    <repository>
        <id>local</id>
        <name>Project Local Repository</name>
        <layout>default</layout>
        <url>file://${project.baseDir}/path/to/your/local/project/repo/</url>
    </repository>
</repositories>

and then add a dependency itself:

然后添加一个依赖项本身:

<dependency>
    <groupId>org.eclipse</groupId>
    <artifactId>swt</artifactId>
    <version>3.6.1-win32-win32-x86</version>
</dependency>

Hope this helps someone, and I get some karma for bounties on other, harder questions of mine... ;)

希望这对某人有所帮助,并且我在其他更难的问题上获得了一些奖励...;)

回答by MNeimeier

have a look at the maven-eclipse-plugin. Assuming you have a local eclipse installation at /opt/eclipse, do the following:

看看 maven-eclipse-plugin。假设您在 /opt/eclipse 安装了本地 eclipse,请执行以下操作:

mvn eclipse:to-maven -DeclipseDir=/opt/eclipse/ -DstripQualifier=true

This will generate poms for all eclipse plugins and upload them to your local repo. It's also possible to load the generated poms and jars to a remote repo using the plugin option "deployTo".

这将为所有 eclipse 插件生成 poms 并将它们上传到您的本地存储库。也可以使用插件选项“deployTo”将生成的 poms 和 jars 加载到远程仓库。

See also:
maven-eclipse-plugin

另见:
maven-eclipse-plugin

After that you can use the artifacts from the repository.

之后,您可以使用存储库中的工件。

Hope the information is helpfull.

希望信息有帮助。

-Martin

-马丁

回答by Rüdiger Herrmann

As of Neon.2 (v 4.6.2) many Eclipse bundles, including SWT, are available on Maven Central:

从 Neon.2 (v 4.6.2) 开始,Maven Central 上提供了许多 Eclipse 包,包括 SWT:

https://repo1.maven.org/maven2/org/eclipse/platform/

https://repo1.maven.org/maven2/org/eclipse/platform/

Note that, in contrast to earlier published SWT artifacts, the group id was changed to org.eclipse.platform. To include SWT for Windows, for example, add this to your pom:

请注意,与之前发布的 SWT 工件相比,组 ID 已更改为org.eclipse.platform。例如,要包含适用于 Windows 的 SWT,请将其添加到您的 pom:

<dependency>
    <groupId>org.eclipse.platform</groupId>
    <artifactId>org.eclipse.swt.win32.win32.x86_64</artifactId>
    <version>${swt-version}</version>  <!-- currently 3.105.2 -->
</dependency>

From now on, all Eclipse platform releases (currently published every year around June) will be available as maven artifacts. See here to find the most recent version number: https://search.maven.org/#search%7Cga%7C1%7Corg.eclipse.platform%20swt

从现在开始,所有 Eclipse 平台版本(目前每年 6 月左右发布)都将作为 maven 工件提供。在这里查看最新版本号:https: //search.maven.org/#search%7Cga%7C1%7Corg.eclipse.platform%20swt

See here for an announcement with further details: https://objectteams.wordpress.com/2017/01/09/eclipse-neon-2-is-on-maven-central/

有关更多详细信息,请参阅此处的公告:https: //objectteams.wordpress.com/2017/01/09/eclipse-neon-2-is-on-maven-central/