开发者

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

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

<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 pu开发者_如何转开发blic 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?

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.


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

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

To use it just put the following in your 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:

    <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:

  • 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.

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:

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

Happy coding!


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

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

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


Grab here the 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.

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,

<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... ;)


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

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".

See also:
maven-eclipse-plugin

After that you can use the artifacts from the repository.

Hope the information is helpfull.

-Martin


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

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:

<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

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜