2017-02-02 7 views
0

ウィザードを使用してJava EE EARプロジェクトを作成しました。耳のpomファイルとWebサブプロジェクトの両方にエラーがあります。 ejb pomファイルのエラーはありません。Wildfly 10 Java EE EARプロジェクトのアーティファクトエラーが見つかりません

これは私が取得エラー...

がアーティファクトorg.jboss.ejb3行方不明です:JBossの-EJB3-ウェブ:戦争:ここでは1.0.0

は、耳のサブプロジェクトのPOMファイルでありますここで

<?xml version="1.0" encoding="UTF-8"?> 
<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> 

    <parent> 
     <artifactId>jboss-ejb3</artifactId> 
     <groupId>org.jboss.ejb3</groupId> 
     <version>1.0.0</version> 
    </parent> 

    <artifactId>jboss-ejb3-ear</artifactId> 
    <packaging>ear</packaging> 

    <name>jboss-ejb3: EAR Module</name> 

    <url>http://wildfly.org</url> 
    <licenses> 
     <license> 
      <name>Apache License, Version 2.0</name> 
      <distribution>repo</distribution> 
      <url>http://www.apache.org/licenses/LICENSE-2.0.html</url> 
     </license> 
    </licenses> 

    <dependencies> 

     <!-- Depend on the ejb module and war so that we can package them --> 
     <dependency> 
      <groupId>org.jboss.ejb3</groupId> 
      <artifactId>jboss-ejb3-web</artifactId> 
      <type>war</type> 
     </dependency> 
     <dependency> 
      <groupId>org.jboss.ejb3</groupId> 
      <artifactId>jboss-ejb3-ejb</artifactId> 
      <type>ejb</type> 
     </dependency> 
    </dependencies> 

    <build> 
     <finalName>${project.artifactId}</finalName> 
     <plugins> 
      <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-ear-plugin</artifactId> 
       <version>${version.ear.plugin}</version> 
       <configuration> 
        <!-- Tell Maven we are using Java EE 7 --> 
        <version>7</version> 
        <!-- Use Java EE ear libraries as needed. Java EE ear libraries 
         are in easy way to package any libraries needed in the ear, and automatically 
         have any modules (EJB-JARs and WARs) use them --> 
        <defaultLibBundleDir>lib</defaultLibBundleDir> 
        <fileNameMapping>no-version</fileNameMapping> 
       </configuration> 
      </plugin> 
      <!-- The WildFly plugin deploys your ear to a local WildFly container --> 
      <!-- Due to Maven's lack of intelligence with EARs we need to configure 
       the wildfly maven plugin to skip deployment for all modules. We then enable 
       it specifically in the ear module. --> 
      <plugin> 
       <groupId>org.wildfly.plugins</groupId> 
       <artifactId>wildfly-maven-plugin</artifactId> 
       <configuration> 
        <filename>${project.artifactId}.ear</filename> 
        <skip>false</skip> 
       </configuration> 
      </plugin> 
     </plugins> 
    </build> 

    <profiles> 
     <profile> 
      <!-- When built in OpenShift the 'openshift' profile will be used when invoking mvn. --> 
      <!-- Use this profile for any OpenShift specific customization your app will need. --> 
      <!-- By default that is to put the resulting archive into the 'deployments' folder. --> 
      <!-- http://maven.apache.org/guides/mini/guide-building-for-different-environments.html --> 
      <id>openshift</id> 
      <build> 
       <plugins> 
        <plugin> 
         <artifactId>maven-ear-plugin</artifactId> 
         <version>${version.ear.plugin}</version> 
         <configuration> 
          <outputDirectory>deployments</outputDirectory> 
         </configuration> 
        </plugin> 
       </plugins> 
      </build> 
     </profile> 
    </profiles> 

</project> 

は、エラーが、この中に発生しているウェブサブプロジェクト

<?xml version="1.0" encoding="UTF-8"?> 
<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> 

    <parent> 
     <artifactId>jboss-ejb3</artifactId> 
     <groupId>org.jboss.ejb3</groupId> 
     <version>1.0.0</version> 
    </parent> 

    <artifactId>jboss-ejb3-web</artifactId> 
    <packaging>war</packaging> 

    <name>jboss-ejb3: WAR Module</name> 

    <url>http://wildfly.org</url> 
    <licenses> 
     <license> 
     <name>Apache License, Version 2.0</name> 
     <distribution>repo</distribution> 
     <url>http://www.apache.org/licenses/LICENSE-2.0.html</url> 
     </license> 
    </licenses> 

    <dependencies> 

     <!-- Dependency on the EJB module so we can use it's services if needed --> 
     <dependency> 
     <groupId>org.jboss.ejb3</groupId> 
     <artifactId>jboss-ejb3-ejb</artifactId> 
     <type>ejb</type> 
     <scope>provided</scope> 
     </dependency> 

     <!-- Import the JAX-RS API, we use provided scope as the API is included in JBoss WildFly --> 
     <dependency> 
     <groupId>org.jboss.resteasy</groupId> 
     <artifactId>jaxrs-api</artifactId> 
     <scope>provided</scope> 
     </dependency> 

     <!-- Import the CDI API, we use provided scope as the API is included in JBoss WildFly --> 
     <dependency> 
     <groupId>javax.enterprise</groupId> 
     <artifactId>cdi-api</artifactId> 
     <scope>provided</scope> 
     </dependency> 

     <!-- Import the JSF API, we use provided scope as the API is included in JBoss WildFly --> 
     <dependency> 
     <groupId>org.jboss.spec.javax.faces</groupId> 
     <artifactId>jboss-jsf-api_2.2_spec</artifactId> 
     <scope>provided</scope> 
     </dependency> 

     <!-- Import the JPA API, we use provided scope as the API is included in JBoss WildFly --> 
     <dependency> 
     <groupId>org.hibernate.javax.persistence</groupId> 
     <artifactId>hibernate-jpa-2.1-api</artifactId> 
     <scope>provided</scope> 
     </dependency> 

     <!-- JSR-303 (Bean Validation) Implementation --> 
     <!-- Provides portable constraints such as @Email --> 
     <!-- Hibernate Validator is shipped in JBoss WildFly --> 
     <dependency> 
      <groupId>org.hibernate</groupId> 
      <artifactId>hibernate-validator</artifactId> 
      <scope>provided</scope> 
      <exclusions> 
       <exclusion> 
        <groupId>org.slf4j</groupId> 
        <artifactId>slf4j-api</artifactId> 
       </exclusion> 
      </exclusions> 
     </dependency> 

    </dependencies> 

    <build> 
     <finalName>${project.artifactId}</finalName> 
     <plugins> 
     <plugin> 
      <artifactId>maven-war-plugin</artifactId> 
      <version>${version.war.plugin}</version> 
      <configuration> 
       <!-- Java EE 7 doesn't require web.xml, Maven needs to catch up! --> 
       <failOnMissingWebXml>false</failOnMissingWebXml> 
      </configuration> 
     </plugin> 
     </plugins> 
    </build> 

</project> 

のPOMファイルでありますpomファイルの領域

<dependency> 
    <groupId>org.jboss.ejb3</groupId> 
    <artifactId>jboss-ejb3-ejb</artifactId> 
    <type>ejb</type> 
    <scope>provided</scope> 
    </dependency> 

このエラーを解決するにはどうすればよいですか?

+0

親のpom.xmlファイルも追加してください –

答えて

0

親pomファイルにmodulesセクションがあり、依存ファイルが依存関係にあることを確認してください。

<modules> 
     <module>core-module</module> 
     <module>depends-on-core</module> 
     <module>depends-on-core2</module> 
     <module>depends-on-depends-on-core</module> 
    </modules> 

準備が整った後、maven。

関連する問題