Maven <-> JFace and SWT <-> Idea | unresolved symbols

Hello, i have following maven project structure of two files (also attached as tarball to this message):

repotest/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>



repotest/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);
     }
}


``mvn install'' goes just fine; i even can execute resulting jar file via ``java -jar target/repotest-1.0-SNAPSHOT.jar'' in repotest directory and get working empty window.


But when i am trying to import this simple project into idea - i am getting bunch of errors about unresolved symbol 'org.eclipse' and also idea says

Couldn't find a version in [3.2.1-v3235e, 3.3.0-v3346] to match range [3.3.0,4.0.0) org.eclipse:swt:jar:null from the specified reme repositories: central (http://repo1.maven.org/maven2) Path to dependency: 1) repotest:repotest:jar:1.0-SNAPSHOT 2) org.eclipse:jface:jar:3.3.0-I20070606-0010


Any hints what could be reason of such behaviour and how it could be fixed?

Attachment(s):
repotest.tar.gz
1 comment
Comment actions Permalink

This bug looks to appear only when mvn-2 is used. there is no problems with mvn-3. Any hints how to tune idea to use maven 3 version?

0

Please sign in to leave a comment.