Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/maven/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
IntelliJ Idea中的Maven版本范围和后缀版本_Maven_Maven 2_Intellij Idea_Maven 3_Jface - Fatal编程技术网

IntelliJ Idea中的Maven版本范围和后缀版本

IntelliJ Idea中的Maven版本范围和后缀版本,maven,maven-2,intellij-idea,maven-3,jface,Maven,Maven 2,Intellij Idea,Maven 3,Jface,更新#1 我不确定这是否是一个好的解决方案,但作为快速解决方案,我通过将JFace从3.3.0-I20070606-0010降级到3.2.1-M20060908-1000,在maven-2.x/Idea上构建了它 原始消息 我正在尝试使用IntelliJ Idea 11.0.2和Maven开发SWT/JFace应用程序。问题是: Idea在内部使用类似于maven-2.xapi的东西,因此它无法在org.eclipse:jface maven工件中使用的版本范围内正确处理后缀版本(如“1.0-v

更新#1

我不确定这是否是一个好的解决方案,但作为快速解决方案,我通过将JFace从3.3.0-I20070606-0010降级到3.2.1-M20060908-1000,在maven-2.x/Idea上构建了它

原始消息

我正在尝试使用IntelliJ Idea 11.0.2和Maven开发SWT/JFace应用程序。问题是:

Idea在内部使用类似于maven-2.xapi的东西,因此它无法在org.eclipse:jface maven工件中使用的版本范围内正确处理后缀版本(如“1.0-v666999”而不是普通的“1.0”)。然而,maven-3.0可以轻松地正确处理它们

因此,相互排斥的问题是:

  • 如何调整Idea以使用maven-3.0作为内部maven引擎(以便它能够正确地解决所有导入)
  • 如何使用maven-2.x工具“解决”这样的版本后缀,以便idea、JFace maven工件和maven本身都能很好地协同工作?
  • 有没有办法为maven“映射”版本,比如“1.0-v666999”->“1.0”
  • 有没有办法强制使用特定版本的工件
  • 你的想法-
  • 下面是使用JFace的示例pom.xml,JFace使用范围内的版本:

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

    我不明白,Idea使用你告诉它的任何Maven。你是否尝试用我提供的pom.xml和RootWindow.java文件导入Idea项目?它如何使用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);
        }
    }