3

私はMavenを初めて使用し、いくつかのフレームワークを使用して独自のJava EE Mavenプロジェクトを作成しようとしています.2つのモジュールと1つの親モジュールから始めました。問題は、mvn clean を発行するときにこのエラーが発生することです。

[ERROR] The projects in the reactor contain a cyclic reference: Edge between 'Vertex{label='org.tepo:Jporto-web:0.0.1-SNAPSHOT'}' and 'Vertex{label='org.tepo:Jporto-ejb:0.0.1-SNAPSHOT'}' introduces to cycle in the graph org.tepo:Jporto-ejb:0.0.1-SNAPSHOT --> org.tepo:Jporto-web:0.0.1-SNAPSHOT --> org.tepo:Jporto-ejb:0.0.1-SNAPSHOT -> [Help 1]

サイクル依存とは何かは知っていますが、私の poms にはそのようなものは見られません。親 POM:

<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>org.tepo</groupId>
  <artifactId>Jporto</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <packaging>pom</packaging>
  <name>jsf library tutto</name>
  <description>fiesta prego grande</description>
  <dependencies>

        <dependency>
        <groupId>org.tepo</groupId>
        <artifactId>Jporto-ejb</artifactId>
        <version>0.0.1-SNAPSHOT</version>
        <type>ejb</type>
        <scope>compile</scope>
    </dependency>

    <dependency>
        <groupId>org.tepo</groupId>
        <artifactId>Jporto-web</artifactId>
        <version>0.0.1-SNAPSHOT</version>
        <type>war</type>
        <scope>compile</scope>
    </dependency>
 </dependencies>

  <modules>
    <module>Jporto-ejb</module>
    <module>Jporto-web</module>
  </modules>

  <build>  
  <plugins>  
    <plugin>  
      <artifactId>maven-compiler-plugin</artifactId>  
      <inherited>true</inherited>  
      <configuration>  
        <source>1.6</source>  
        <target>1.6</target>  
        <encoding>UTF-8</encoding>  
        <version>2.5.1</version>
      </configuration>  
    </plugin>  
    <plugin>  
      <artifactId>maven-resources-plugin</artifactId>  
      <configuration>  
        <encoding>UTF-8</encoding>  
      </configuration>  
    </plugin>  
    <plugin>  
      <artifactId>maven-ejb-plugin</artifactId>  
      <inherited>true</inherited>  
      <configuration>  
        <ejbVersion>3.1</ejbVersion>  
      </configuration>  
    </plugin>  
  </plugins>  
</build>  

</project>

ウェブモジュール:

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

  <parent>
    <artifactId>Jporto</artifactId>
    <groupId>org.tepo</groupId>
    <version>0.0.1-SNAPSHOT</version>
  </parent>

  <artifactId>Jporto-web</artifactId>
  <groupId>org.tepo</groupId>
  <version>0.0.1-SNAPSHOT</version>
  <packaging>war</packaging>

  <dependencies>    
    <dependency>  
  <groupId>javax.jms</groupId>  
  <artifactId>jms</artifactId>  
  <version>1.1</version>  
  <scope>provided</scope>  
</dependency> 

<dependency>  
  <groupId>javax.transaction</groupId>  
  <artifactId>jta</artifactId>  
  <version>1.1</version>  
  <scope>provided</scope>  
</dependency>  

<dependency>  
  <groupId>org.hibernate</groupId>  
  <artifactId>hibernate-core</artifactId>  
  <version>4.0.0.Final</version>  
  <scope>provided</scope>  
</dependency>  

<dependency>  
  <groupId>org.hibernate</groupId>  
  <artifactId>hibernate-entitymanager</artifactId>  
  <version>4.0.0.Final</version>  
  <scope>provided</scope>  
</dependency>  

<dependency>  
  <groupId>org.hibernate.javax.persistence</groupId>  
  <artifactId>hibernate-jpa-2.0-api</artifactId>  
  <version>1.0.1.Final</version>  
  <scope>provided</scope>  
</dependency>  

<dependency>  
  <groupId>org.jboss.spec.javax.servlet</groupId>  
  <artifactId>jboss-servlet-api_3.0_spec</artifactId>  
  <version>1.0.0.Final</version>  
  <scope>provided</scope>  
</dependency>  

<dependency>  
  <groupId>javax.faces</groupId>  
  <artifactId>javax.faces-api</artifactId>  
  <version>2.1</version>  
  <scope>provided</scope>  
</dependency>  



  </dependencies>
</project>

EJB モジュール:

<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>
  <parent>
    <artifactId>Jporto</artifactId>
    <groupId>org.tepo</groupId>
    <version>0.0.1-SNAPSHOT</version>
  </parent>

  <groupId>org.tepo</groupId>
  <artifactId>Jporto-ejb</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <packaging>ejb</packaging>

  <dependencies>  

    <dependency>
        <groupId>org.jboss.as</groupId>
        <artifactId>jboss-as-ejb3</artifactId>
        <version>7.1.0.CR1b</version>
        <type>jar</type>
        <scope>provided</scope>
    </dependency>
  </dependencies>
</project>

なぜこのエラーが発生するのか説明してもらえますか? また、Eclipse では Web モジュールの pom ファイルで次のエラーが発生します。 :Webモジュールでコンパイル... 助けてくれてありがとう!

4

1 に答える 1

8

親 pom は、親 pom に依存するモジュールに依存します。

あなたができることは、親ポンに追加することです

<modules>
   <module>module1</module>
   <module>module2</module>
</module>

モジュールは、指定した名前のサブディレクトリでなければなりません。

于 2012-07-09T20:28:30.950 に答える