Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/maven/6.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
java-Maven对另一个模块的依赖关系_Java_Maven_Wildfly 8 - Fatal编程技术网

java-Maven对另一个模块的依赖关系

java-Maven对另一个模块的依赖关系,java,maven,wildfly-8,Java,Maven,Wildfly 8,我有以下问题: 我只需要一个对EAR2EJB模块的依赖项。 我必须做什么才能获得正确的依赖关系 我在CarappWeb中使用了所有作用域的组合尝试了这一方法,但只接受提供的作用域,否则我将导致构建失败。(ear2上的mvn安装已完成) 通过以下设置,我得到EAR模块中的构建错误(carApp)。其他模块已成功构建。 如果没有对ear2ejb的依赖,就不会有构建错误 com.bs ear2 ejb 0.0.1-快照 ejb 假如 ear2ejb的POM 4.0.0 耳2 com.bs 0

我有以下问题:

我只需要一个对EAR2EJB模块的依赖项。 我必须做什么才能获得正确的依赖关系

我在CarappWeb中使用了所有作用域的组合尝试了这一方法,但只接受提供的作用域,否则我将导致构建失败。(ear2上的mvn安装已完成)

通过以下设置,我得到EAR模块中的构建错误(carApp)。其他模块已成功构建。 如果没有对ear2ejb的依赖,就不会有构建错误


com.bs
ear2 ejb
0.0.1-快照
ejb
假如
ear2ejb的POM


4.0.0
耳2
com.bs
0.0.1-快照
ear2 ejb
ejb
ear2:EJB模块
卡拉普网聚甲醛


4.0.0
克拉普
com.bs
0.0.1-快照
卡拉普网
战争
卡拉普:战争舱
http://wildfly.org
Apache许可证,版本2.0
回购
http://www.apache.org/licenses/LICENSE-2.0.html
com.google.code.gson
格森
2.3.1
com.bs
克拉普ejb
ejb
假如
org.jboss.resteasy
jaxrs api
假如
javax.enterprise
CDIAPI
假如
org.jboss.spec.javax.faces
jboss-jsf-api_2.2_规范
假如
org.hibernate.javax.persistence
hibernate-jpa-2.1-api
假如
org.hibernate
休眠验证器
假如
org.slf4j
slf4j api
com.bs
ear2 ejb
0.0.1-快照
ejb
${project.artifactId}
maven战争插件
${version.war.plugin}
错误的

以下错误:

[ERROR] Failed to execute goal org.wildfly.plugins:wildfly-maven-plugin:1.0.2.Final:deploy (default-cli) on project carApp-ear: Deployment failed and was rolled back. -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.wildfly.plugins:wildfly-maven-plugin:1.0.2.Final:deploy (default-cli) on project carApp-ear: Deployment failed and was rolled back.
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:120)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:355)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:216)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:160)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.wildfly.plugin.common.DeploymentExecutionException: Deployment failed and was rolled back.
at org.wildfly.plugin.deployment.standalone.StandaloneDeployment.execute(StandaloneDeployment.java:180)
at org.wildfly.plugin.deployment.AbstractDeployment.executeDeployment(AbstractDeployment.java:121)
at org.wildfly.plugin.deployment.AbstractDeployment.doExecute(AbstractDeployment.java:146)
at org.wildfly.plugin.deployment.AbstractAppDeployment.doExecute(AbstractAppDeployment.java:70)
at org.wildfly.plugin.deployment.AbstractDeployment.execute(AbstractDeployment.java:111)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 19 more
[ERROR] 
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :carApp-ear
[ERROR]无法执行goal org.wildfly.plugins:wildfly maven plugin:1.0.2。最终:在project carApp ear上部署(默认cli):部署失败并被回滚。->[帮助1]
org.apache.maven.lifecycle.LifecycleExecutionException:未能执行目标org.wildfly.plugins:wildfly maven plugin:1.0.2.Final:project carApp ear上的部署(默认cli):部署失败并被回滚。
位于org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
位于org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
位于org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
位于org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
位于org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
位于org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
位于org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:120)
在org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:355)
位于org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
位于org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
位于org.apache.maven.cli.MavenCli.doMain(MavenCli.java:216)
位于org.apache.maven.cli.MavenCli.main(MavenCli.java:160)
在sun.reflect.NativeMethodAccessorImpl.invoke0(本机方法)处
位于sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
在sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)中
位于java.lang.reflect.Method.invoke(Method.java:483)
位于org.codehaus.plexus.classworlds.launcher.launcher.launchEnhanced(launcher.java:289)
位于org.codehaus.plexus.classworlds.launcher.launcher.launch(launcher.java:229)
位于org.codehaus.plexus.classworlds.launcher.launcher.mainWithExitCode(launcher.java:415)
位于org.codehaus.plexus.classworlds.launcher.launcher.main(launcher.java:356)
原因:org.wildfly.plugin.common.DeploymentExecutionException:部署失败,已回滚。
位于org.wildfly.plugin.deployment.standalone.StandaloneDeployment.execute(StandaloneDeployment.java:180)
位于org.wildfly.plugin.deployment.AbstractDeployment.ExecutedDeployment(AbstractDeployment.java:121)
位于org.wildfly.plugin.deployment.AbstractDeployment.doExecute(AbstractDeployment.java:146)
位于org.wildfly.plugin.deployment.AbstractAppDeployment.doExecute(AbstractAppDeployment.java:70)
位于org.wildfly.plugin.deployment.AbstractDeployment.execute(AbstractDeployment.java:111)
位于org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
位于org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 还有19个
[错误]
[错误]
[错误]有关错误和可能的解决方案的更多信息,请阅读以下文章:
[错误][帮助1]http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[错误]
[错误]纠正问题后,可以使用命令恢复生成
[错误]mvn-射频:克拉普耳
(父)carApp-pom.xml


克拉普
4.0.0
com.bs
克拉普
0.0.1-快照
聚甲醛
http://wildfly.org
Apache许可证,版本2.0
回购
http://www.apache.org/licenses/LICENSE-2.0.html
克拉普ejb
卡拉普网
克拉普耳
UTF-8
1.0.2.1最终版本
8.2.1.最终版本
9.0.0.1
3.1
2.10
2.3
2.16
2.5
1.7
1.7
com.bs
ear2 ejb
ejb
0.0.1-快照
com.bs
克拉普ejb
${project.version}
ejb
com.bs
卡拉普网
${project.version}
战争
编写
org.wildfly.bom
jboss-javaee-7.0-with-tools
${version.jboss.bom}
<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>carApp</artifactId>
    <groupId>com.bs</groupId>
    <version>0.0.1-SNAPSHOT</version>
</parent>

<artifactId>carApp-web</artifactId>
<packaging>war</packaging>

<name>carApp: 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 for JSON -->
    <dependency>
        <groupId>com.google.code.gson</groupId>
        <artifactId>gson</artifactId>
        <version>2.3.1</version>
    </dependency>

    <!-- Dependency on the EJB module so we can use it's services if needed -->
    <dependency>
        <groupId>com.bs</groupId>
        <artifactId>carApp-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>

    <dependency>
        <groupId>com.bs</groupId>
        <artifactId>ear2-ejb</artifactId>
        <version>0.0.1-SNAPSHOT</version>
        <type>ejb</type>
    </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>
[ERROR] Failed to execute goal org.wildfly.plugins:wildfly-maven-plugin:1.0.2.Final:deploy (default-cli) on project carApp-ear: Deployment failed and was rolled back. -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.wildfly.plugins:wildfly-maven-plugin:1.0.2.Final:deploy (default-cli) on project carApp-ear: Deployment failed and was rolled back.
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:120)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:355)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:216)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:160)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.wildfly.plugin.common.DeploymentExecutionException: Deployment failed and was rolled back.
at org.wildfly.plugin.deployment.standalone.StandaloneDeployment.execute(StandaloneDeployment.java:180)
at org.wildfly.plugin.deployment.AbstractDeployment.executeDeployment(AbstractDeployment.java:121)
at org.wildfly.plugin.deployment.AbstractDeployment.doExecute(AbstractDeployment.java:146)
at org.wildfly.plugin.deployment.AbstractAppDeployment.doExecute(AbstractAppDeployment.java:70)
at org.wildfly.plugin.deployment.AbstractDeployment.execute(AbstractDeployment.java:111)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 19 more
[ERROR] 
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :carApp-ear