Comment construire maven projet importé dans Intellij IDEA 11?

J'ai créé une nouvelle Ide de projet en important les projets maven. Qui a bien fonctionné:
Comment construire maven projet importé dans Intellij IDEA 11?

Je peut exécuter maven objectifs du Projets Maven volet (sur le côté gauche de l'IDE de l'écran). Par exemple, je peux compiler les projets amende à l'aide de la compilation objectif.

Maintenant, je veux construire le projet à partir de l'INTERFACE utilisateur à l'aide de la Construire|Faire un Projet option. Toutefois, il ne fonctionne pas. Il se plaint du manque des packages d'application comme si elle ne voit pas les dépendances. Ces liens sont définis dans la pom.xml les fichiers, mais en faisant le projet à partir de l'IDE semble l'ignorer.

Que dois-je faire pour le faire fonctionner?

MODIFIER

OK, j'ai supprimé le .m2 répertoire de chez moi et a commencé à le compiler but de les Projets Maven volant. Je peux voir dans le volet de la console que maven télécharge les dépendances de l'Maven Central (je donne juste les premières lignes du journal, il est assez long):

"C:\Program Files (x86)\Java\jdk1.6.0_29\bin\java" -Dclassworlds.conf=O:\java\apache-maven-3.0.4\bin\m2.conf -Dmaven.home=O:\java\apache-maven-3.0.4 -Didea.launcher.port=7534 "-Didea.launcher.bin.path=C:\Program Files (x86)\JetBrains\IntelliJ IDEA 11.1.2\bin" -Dfile.encoding=UTF-8 -classpath "O:\java\apache-maven-3.0.4\boot\plexus-classworlds-2.4.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 11.1.2\lib\idea_rt.jar" com.intellij.rt.execution.application.AppMain org.codehaus.classworlds.Launcher --no-plugin-registry --fail-fast --strict-checksums --update-snapshots -f C:\dev\shunra\Application\Builder\build\vcat\pom.xml compile
[WARNING] Command line option -npr is deprecated and will be removed in future Maven versions.
[INFO] Scanning for projects...
[WARNING] 
[WARNING] Some problems were encountered while building the effective model for com.shunra:VCat-build:pom:1.0.0.SNAPSHOT
[WARNING] 'version' uses an unsupported snapshot version format, should be '*-SNAPSHOT' instead. @ line 7, column 11
[WARNING] 
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING] 
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING] 
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO] 
[INFO] util.logging
[INFO] Infra
[INFO] dtos
[INFO] commons
[INFO] license
[INFO] core
[INFO] vcat
[INFO] VCat-build
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building util.logging 0.0.1
[INFO] ------------------------------------------------------------------------
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-resources-plugin/2.5/maven-resources-plugin-2.5.pom
Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-resources-plugin/2.5/maven-resources-plugin-2.5.pom (7 KB at 7.2 KB/sec)
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-plugins/19/maven-plugins-19.pom
Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-plugins/19/maven-plugins-19.pom (11 KB at 38.7 KB/sec)
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/maven-parent/19/maven-parent-19.pom
Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/maven-parent/19/maven-parent-19.pom (25 KB at 70.0 KB/sec)
Downloading: http://repo.maven.apache.org/maven2/org/apache/apache/9/apache-9.pom
Downloaded: http://repo.maven.apache.org/maven2/org/apache/apache/9/apache-9.pom (15 KB at 63.5 KB/sec)
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-resources-plugin/2.5/maven-resources-plugin-2.5.jar
Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-resources-plugin/2.5/maven-resources-plugin-2.5.jar (26 KB at 63.1 KB/sec)
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-compiler-plugin/2.3.2/maven-compiler-plugin-2.3.2.pom
Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-compiler-plugin/2.3.2/maven-compiler-plugin-2.3.2.pom (8 KB at 29.6 KB/sec)
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-plugins/18/maven-plugins-18.pom
Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-plugins/18/maven-plugins-18.pom (13 KB at 53.6 KB/sec)
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/maven-parent/16/maven-parent-16.pom
Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/maven-parent/16/maven-parent-16.pom (23 KB at 66.8 KB/sec)
Downloading: http://repo.maven.apache.org/maven2/org/apache/apache/7/apache-7.pom
Downloaded: http://repo.maven.apache.org/maven2/org/apache/apache/7/apache-7.pom (15 KB at 59.5 KB/sec)

Donc, je suppose qu'il n'y a pas de problème de connexion à la Maven Central.

EDIT2

Veuillez observer:
Comment construire maven projet importé dans Intellij IDEA 11?
Avis le problème - il y a deux modules importés de Maven - Commune et de Base. Leur artefact Maven Id sont communes et de base respectivement. IntelliJ semble confondre entre l'artefact Id et le nom du module, parce que:

  1. Le Projet déroulant affiche le nom du module suivi par l'artefact maven Id entre parenthèses.
  2. Dans le dialogue paramètres du Projet les modules sont dispensés par l'artefact maven Id.
  3. Mais dans les dépendances de modules, il affiche le nom du module.

La de Base module (artefact maven Id de base) devrait voir la dépendance Commune module (artefact maven Id communes), mais il ne le fait pas et c'est le problème.

EDIT3

Ici est le plus 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/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.shunra</groupId>
    <name>VCat-build</name>
    <version>1.0.0.SNAPSHOT</version>
    <artifactId>VCat-build</artifactId>
    <packaging>pom</packaging>
    <modules>
        <module>../../../util.logging</module>
        <module>../../../Infra</module>
        <module>../../../DTOs</module>
        <module>../../../ShunraLicense</module>
        <module>../../../Common</module>
        <module>../../../Core</module>
        <module>../../../VCat</module>
    </modules>
    <build>
        <plugins>
        </plugins>
    </build>
</project>

Ici est celle de la Common module:

<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.shunra</groupId>
<artifactId>commons</artifactId>
<version>0.0.1</version>
<dependencies>
<dependency>
<groupId>com.sun.jna</groupId>
<artifactId>jna</artifactId>
<version>3.0.9</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>1.4</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-math</artifactId>
<version>2.2</version>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
<version>1.9.4</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.2.7</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.shunra</groupId>
<artifactId>util.logging</artifactId>
<version>0.0.1</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>1.6</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.6</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.restlet.jse</groupId>
<artifactId>org.restlet</artifactId>
<version>2.0.10</version>
</dependency>
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<version>1</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>commons-configuration</groupId>
<artifactId>commons-configuration</artifactId>
<version>1.8</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
<version>1.8.3</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<!--        <dependency>
<groupId>com.shunra</groupId>
<artifactId>license</artifactId>
<version>0.0.1</version>
</dependency> -->
<dependency>
<groupId>com.shunra</groupId>
<artifactId>dtos</artifactId>
<version>0.0.1</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>maven-restlet</id>
<name>Public online Restlet repository</name>
<url>http://maven.restlet.org</url>
</repository> 
</repositories>
<build>
<sourceDirectory>src</sourceDirectory>
<resources>
<resource>
<directory>src</directory>
<excludes>
<exclude>**/*.java</exclude>
</excludes>
</resource>
</resources>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source/>
<target/>
</configuration>
</plugin>
</plugins>
</build>
</project>

Et voici l'un pour le module de Base:

<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.shunra</groupId>
<artifactId>core</artifactId>
<version>0.0.1</version>
<dependencies>
<dependency>
<groupId>com.shunra</groupId>
<artifactId>commons</artifactId>
<version>0.0.1</version>
</dependency>
<dependency>
<groupId>com.shunra</groupId>
<artifactId>license</artifactId>
<version>0.0.1</version>
</dependency>
</dependencies>
<build>
<sourceDirectory>src</sourceDirectory>
<resources>
<resource>
<directory>src</directory>
<excludes>
<exclude>**/*.java</exclude>
</excludes>
</resource>
</resources>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source/>
<target/>
</configuration>
</plugin>
</plugins>
</build>
</project>

EDIT4

Enfin résolu. Enlevé toutes les Intellij fichiers et réimportés à nouveau. Je suppose que l'pom.xml les fichiers ont été modifiés de façon à confusion pour IntelliJ.

Avez-vous vérifié que le parfait est un projet maven? Il ne sonne pas comme il a mis ses dépendances correctement, par exemple, il n'est pas en les tirant de la pom.
Juste ajouté EDIT2 sur le sujet. Comment puis-je résoudre ce problème?

OriginalL'auteur mark | 2013-01-08