更新#1
我不确定这是否是一个很好的解决方案,但作为快速解决方法,我可以通过将JFace从3.3.0-I20070606-0010降级到3.2.1-M20060908来将其建立在maven-2.x / Idea上1000
原始消息
我正在尝试使用IntelliJ Idea 11.0.2和Maven开发SWT / JFace应用程序。问题是:
Idea在内部使用看起来像maven-2.x API的东西,因此它无法处理正确的后缀版本(例如" 1.0-v666999"而不是普通" 1.0")版本范围,在org.eclipse中使用:jface maven artifact。但是,maven-3.0可以轻松地正确处理它们。
因此,相互排斥的问题是:
以下是使用JFace的示例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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>repotest</groupId>
<artifactId>repotest</artifactId>
<version>1.0-SNAPSHOT</version>
<name>Archetype - repotest</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>${swt.groupId}</groupId>
<artifactId>${swt.artifactId}</artifactId>
<version>3.3.0-v3346</version>
</dependency>
<dependency>
<groupId>org.eclipse</groupId>
<artifactId>jface</artifactId>
<version>3.3.0-I20070606-0010</version>
</dependency>
</dependencies>
<profiles>
<profile>
<id>mac</id>
<activation>
<os>
<name>mac os x</name>
</os>
</activation>
<properties>
<swt.groupId>org.eclipse.swt.carbon</swt.groupId>
<swt.artifactId>macosx</swt.artifactId>
</properties>
</profile>
<profile>
<id>windows</id>
<activation>
<os>
<family>windows</family>
</os>
</activation>
<properties>
<swt.groupId>org.eclipse.swt.win32.win32</swt.groupId>
<swt.artifactId>x86</swt.artifactId>
</properties>
</profile>
<profile>
<id>unix</id>
<activation>
<os>
<family>unix</family>
</os>
</activation>
<properties>
<swt.groupId>org.eclipse.swt.gtk.linux</swt.groupId>
<swt.artifactId>x86</swt.artifactId>
</properties>
</profile>
</profiles>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>1.5</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>repotest.RootWindow</mainClass>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
这是pom.xml使用的src / main / java / repotest / RootWindow.java文件:
package repotest;
import org.eclipse.swt.widgets.Display;
import org.eclipse.jface.window.ApplicationWindow;
public class RootWindow extends ApplicationWindow {
public static void main(String[] args) {
ApplicationWindow rootWindow = new RootWindow();
rootWindow.setBlockOnOpen(true);
rootWindow.open();
Display.getCurrent().dispose();
}
public RootWindow() {
super(null);
}
}