Build multiple architecture SWT application with Maven

别说谁变了你拦得住时间么 提交于 2019-12-03 12:26:32

Not sure how the depency-plugin handles it, but it should work if you have only one dependency like this one:

    <dependency>
        <groupId>${swt.groupId}</groupId>
        <artifactId>${swt.artifactId}</artifactId>
        <version>3.7.2</version>
        <scope>compile</scope>
    </dependency>

And then profiles like these:

<profile>
  <id>gtk_linux_x86_64</id>
  <activation>
    <os>
      <name>linux</name>
      <arch>x86_64</arch>
    </os>
  </activation>
  <properties>
    <swt.groupId>org.eclipse.swt.gtk.linux</swt.groupId>
    <swt.artifactId>x86_64</swt.artifactId>
  </properties>
</profile>

Now the needed version of SWT get's used automatically, but can be set to what you need (e.g. when building a release) as well using:

mvn -P gtk_linux_x86_64

Note: Change your groupId and artifactId as needed.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!