Error dependencies when deploy on Wildfly 10
<p>My Project structure like this: </p>

<p>opm-common:
   |_opm-api:
   |_opm-portal:</p>

<p>These are opm file:</p>

<p>opm-common</p>

<pre><code>&lt;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"&gt;
&lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
&lt;groupId&gt;com.chick&lt;/groupId&gt;
&lt;artifactId&gt;opm-common&lt;/artifactId&gt;
&lt;packaging&gt;war&lt;/packaging&gt;
&lt;version&gt;0.1.1&lt;/version&gt;
&lt;name&gt;Online Project Management Common&lt;/name&gt;

&lt;properties&gt;
    &lt;spring.version&gt;4.3.2.RELEASE&lt;/spring.version&gt;
    &lt;jdk.version&gt;1.8&lt;/jdk.version&gt;      
    &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
    &lt;jackson.version&gt;2.7.3&lt;/jackson.version&gt;
    &lt;log4j.version&gt;1.2.17&lt;/log4j.version&gt;
    &lt;joda-time.version&gt;2.9.4&lt;/joda-time.version&gt;        
    &lt;spring-data&gt;1.9.2.RELEASE&lt;/spring-data&gt;
&lt;/properties&gt;
...
    &lt;build&gt;
        &lt;finalName&gt;opm-common&lt;/finalName&gt;
        &lt;plugins&gt;
            &lt;plugin&gt;
                &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                &lt;artifactId&gt;maven-surefire-plugin&lt;/artifactId&gt;
                &lt;version&gt;2.6&lt;/version&gt;
                &lt;configuration&gt;
                    &lt;argLine&gt;-Dfile.encoding=UTF-8&lt;/argLine&gt;
                &lt;/configuration&gt;
            &lt;/plugin&gt;
            &lt;plugin&gt;
                &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                &lt;artifactId&gt;maven-war-plugin&lt;/artifactId&gt;
                &lt;version&gt;2.6&lt;/version&gt;
                &lt;configuration&gt;
                    &lt;failOnMissingWebXml&gt;false&lt;/failOnMissingWebXml&gt;
                &lt;/configuration&gt;
            &lt;/plugin&gt;
            &lt;plugin&gt;
                &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
                &lt;version&gt;3.5.1&lt;/version&gt;
                &lt;configuration&gt;
                  &lt;source&gt;1.8&lt;/source&gt;
                  &lt;target&gt;1.8&lt;/target&gt;
                &lt;/configuration&gt;
             &lt;/plugin&gt;          
        &lt;/plugins&gt;
    &lt;/build&gt;    
&lt;/project&gt;
</code></pre>

<p>opm-api</p>

<pre><code>&lt;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"&gt;
    &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
    &lt;groupId&gt;com.chick&lt;/groupId&gt;
    &lt;artifactId&gt;opm-api&lt;/artifactId&gt;
    &lt;packaging&gt;war&lt;/packaging&gt;
    &lt;version&gt;0.1.1&lt;/version&gt;
    &lt;name&gt;Online Project Management API&lt;/name&gt;

    &lt;properties&gt;            
        &lt;opm.common.version&gt;0.1.1&lt;/opm.common.version&gt;      
        &lt;jdk.version&gt;1.8&lt;/jdk.version&gt;
        &lt;hibernate.version&gt;5.1.0.Final&lt;/hibernate.version&gt;
        &lt;servlet-api.version&gt;3.1.0&lt;/servlet-api.version&gt;
        &lt;mysql.version&gt;5.1.37&lt;/mysql.version&gt;       
        &lt;mongo.version&gt;3.2.2&lt;/mongo.version&gt;
    &lt;/properties&gt;

    &lt;dependencies&gt;
        &lt;!-- OPM dependencies  --&gt;
        &lt;dependency&gt;
            &lt;groupId&gt;com.chick&lt;/groupId&gt;
            &lt;artifactId&gt;opm-common&lt;/artifactId&gt;
            &lt;version&gt;${opm.common.version}&lt;/version&gt;
        &lt;/dependency&gt;
        ...     
    &lt;/dependencies&gt;

    &lt;build&gt;
        &lt;finalName&gt;opm-api&lt;/finalName&gt;
        &lt;plugins&gt;
            &lt;plugin&gt;
                &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                &lt;artifactId&gt;maven-surefire-plugin&lt;/artifactId&gt;
                &lt;version&gt;2.6&lt;/version&gt;
                &lt;configuration&gt;
                    &lt;argLine&gt;-Dfile.encoding=UTF-8&lt;/argLine&gt;
                &lt;/configuration&gt;
            &lt;/plugin&gt;
            &lt;plugin&gt;
                &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                &lt;artifactId&gt;maven-war-plugin&lt;/artifactId&gt;
                &lt;version&gt;2.6&lt;/version&gt;
                &lt;configuration&gt;
                &lt;archive&gt;
                    &lt;manifestEntries&gt;
                       &lt;Dependencies&gt;com.chick.opm-common&lt;/Dependencies&gt;
                    &lt;/manifestEntries&gt;
                 &lt;/archive&gt;
              &lt;/configuration&gt;
            &lt;/plugin&gt;
            &lt;plugin&gt;
                &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
                &lt;version&gt;3.5.1&lt;/version&gt;
                &lt;configuration&gt;
                  &lt;source&gt;1.8&lt;/source&gt;
                  &lt;target&gt;1.8&lt;/target&gt;
                &lt;/configuration&gt;
             &lt;/plugin&gt;           
        &lt;/plugins&gt;
    &lt;/build&gt;
    &lt;profiles&gt;
        &lt;profile&gt;       
         &lt;id&gt;default&lt;/id&gt;
         &lt;activation&gt;
            &lt;activeByDefault&gt;true&lt;/activeByDefault&gt;
         &lt;/activation&gt;
         &lt;build&gt;
            &lt;plugins&gt;
               &lt;plugin&gt;
                  &lt;artifactId&gt;maven-surefire-plugin&lt;/artifactId&gt;
                  &lt;version&gt;2.6&lt;/version&gt;
                  &lt;configuration&gt;
                     &lt;argLine&gt;-Dfile.encoding=UTF-8&lt;/argLine&gt;
                  &lt;/configuration&gt;
               &lt;/plugin&gt;
            &lt;/plugins&gt;
         &lt;/build&gt;
       &lt;/profile&gt;
       &lt;profile&gt;    
         &lt;id&gt;openshift&lt;/id&gt;
         &lt;build&gt;
            &lt;finalName&gt;opm-api&lt;/finalName&gt;
            &lt;plugins&gt;
              &lt;plugin&gt;
                &lt;artifactId&gt;maven-war-plugin&lt;/artifactId&gt;
                &lt;version&gt;2.1.1&lt;/version&gt;
                &lt;configuration&gt;
                  &lt;outputDirectory&gt;deployments&lt;/outputDirectory&gt;
                  &lt;warName&gt;opm-api&lt;/warName&gt;
                &lt;/configuration&gt;
              &lt;/plugin&gt;
            &lt;/plugins&gt;
          &lt;/build&gt;
        &lt;/profile&gt;
    &lt;/profiles&gt;
&lt;/project&gt;
</code></pre>

<p>When build ... everything seems to be good.
But when i run server to deploy opm-api ... it cann't create been (class in opm-common) </p>

<p>Below is servlet-context.xml (in opm-api)</p>

<pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;

&lt;beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:context="http://www.springframework.org/schema/context"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="
        http://www.springframework.org/schema/beans     
        http://www.springframework.org/schema/beans/spring-beans.xsd
        http://www.springframework.org/schema/mvc 
        http://www.springframework.org/schema/mvc/spring-mvc.xsd
        http://www.springframework.org/schema/context 
        http://www.springframework.org/schema/context/spring-context.xsd"&gt;


    &lt;context:component-scan
        base-package="com.chick.opm.common.model,com.chick.opm.common.service, com.chick.opm.api.controller, com.chick.opm.dao, com.chick.opm.api.service" /&gt;
    &lt;mvc:annotation-driven /&gt;


    &lt;bean
        class="org.springframework.web.servlet.view.InternalResourceViewResolver"&gt;
        &lt;property name="prefix"&gt;
            &lt;value&gt;/WEB-INF/jsp/&lt;/value&gt;
        &lt;/property&gt;
        &lt;property name="suffix"&gt;
            &lt;value&gt;.jsp&lt;/value&gt;
        &lt;/property&gt;
    &lt;/bean&gt;

    &lt;!--    Service Common   --&gt;
    &lt;bean id="ResponeMessageService" class="com.chick.opm.common.service.iml.ResponeMessageServiceImpl"&gt;&lt;/bean&gt;
    &lt;bean id="ConstantService" class="com.chick.opm.common.service.iml.ConstantService"&gt;&lt;/bean&gt;
    &lt;bean id="RouterService" class="com.chick.opm.common.service.iml.RouterService"&gt;&lt;/bean&gt;

    &lt;!--    Service     --&gt;
    &lt;bean id="CollectionService" class="com.chick.opm.api.service.partial.CollectionService"&gt;&lt;/bean&gt;
    &lt;bean id="CommonService" class="com.chick.opm.api.service.common.CommonService"&gt;&lt;/bean&gt;

    &lt;!--    DAO     --&gt;
    &lt;bean id="CollectionDAO" class="com.chick.opm.api.dao.CollectionDAO"&gt;&lt;/bean&gt;


    &lt;mvc:resources mapping="/resources/**" location="/resources/" /&gt;
&lt;/beans&gt;
</code></pre>

<p>Below is jboss-deployment-structure.xml (in opm-api)</p>

<pre><code>&lt;?xml version="1.0"?&gt;
&lt;jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.0"&gt;
    &lt;sub-deployment name="opm-common-0.1.1.war"&gt;
        &lt;dependencies&gt;
                  &lt;module name="deployment.opm-common.war"/&gt;
        &lt;/dependencies&gt;
     &lt;/sub-deployment&gt;
&lt;/jboss-deployment-structure&gt;
</code></pre>

<p>Below is Error when deploy (have jboss-deployment-structure.xml )</p>

<pre><code>11:40:39,668 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC000001: Failed to start service jboss.deployment.unit."opm-api.war".STRUCTURE: org.jboss.msc.service.StartException in service jboss.deployment.unit."opm-api.war".STRUCTURE: WFLYSRV0153: Failed to process phase STRUCTURE of deployment "opm-api.war"
    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:154)
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948)
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: WFLYSRV0166: Sub deployment opm-common-0.1.1.war in jboss-deployment-structure.xml was not found. Available sub deployments: 
    at org.jboss.as.server.deployment.module.descriptor.DeploymentStructureDescriptorParser.subDeploymentNotFound(DeploymentStructureDescriptorParser.java:288)
    at org.jboss.as.server.deployment.module.descriptor.DeploymentStructureDescriptorParser.deploy(DeploymentStructureDescriptorParser.java:190)
    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:147)
    ... 5 more

11:40:39,985 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" =&gt; "opm-api.war")]) - failure description: {"WFLYCTL0080: Failed services" =&gt; {"jboss.deployment.unit.\"opm-api.war\".STRUCTURE" =&gt; "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"opm-api.war\".STRUCTURE: WFLYSRV0153: Failed to process phase STRUCTURE of deployment \"opm-api.war\"
    Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: WFLYSRV0166: Sub deployment opm-common-0.1.1.war in jboss-deployment-structure.xml was not found. Available sub deployments: "}}
11:40:42,455 INFO  [org.jboss.as.server] (ServerService Thread Pool -- 34) WFLYSRV0010: Deployed "opm-api.war" (runtime-name : "opm-api.war")
11:40:42,455 INFO  [org.jboss.as.controller] (Controller Boot Thread) WFLYCTL0183: Service status report
WFLYCTL0186:   Services which failed to start:      service jboss.deployment.unit."opm-api.war".STRUCTURE: org.jboss.msc.service.StartException in service jboss.deployment.unit."opm-api.war".STRUCTURE: WFLYSRV0153: Failed to process phase STRUCTURE of deployment "opm-api.war"
</code></pre>