2016-10-30 8 views
2

현재 튜토리얼을보고 있습니다. 프로젝트는 3 개의 모듈 (라이브러리 모델, 라이브러리 리소스, 라이브러리 int 테스트)이있는 하나의 상위 프로젝트 라이브러리 app으로 구성됩니다. library-int-tests를 처리 할 때 maven 빌드 프로세스가 실패합니다. 다음은 예외입니다.wildfly에 배포 할 수 없습니다.

13:54:02,028 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC000001: Failed to start service jboss.deployment.unit."29b978cf-ba15-4c96-a470-9221d44850d1.war".STRUCTURE: org.jboss.msc.service.StartException in service jboss.deployment.unit."29b978cf-ba15-4c96-a470-9221d44850d1.war".STRUCTURE: JBAS018733: Failed to process phase STRUCTURE of deployment "29b978cf-ba15-4c96-a470-9221d44850d1.war" 
    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:166) [wildfly-server-8.1.0.Final.jar:8.1.0.Final] 
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948) [jboss-msc-1.2.2.Final.jar:1.2.2.Final] 
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881) [jboss-msc-1.2.2.Final.jar:1.2.2.Final] 
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_20] 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_20] 
    at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_20] 
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS018741: Failed to get manifest for deployment "/content/29b978cf-ba15-4c96-a470-9221d44850d1.war/WEB-INF/lib/mockito-core-1.9.5.jar" 
    at org.jboss.as.server.deployment.module.ManifestAttachmentProcessor.getManifest(ManifestAttachmentProcessor.java:78) [wildfly-server-8.1.0.Final.jar:8.1.0.Final] 
    at org.jboss.as.server.deployment.module.ManifestAttachmentProcessor.deploy(ManifestAttachmentProcessor.java:65) [wildfly-server-8.1.0.Final.jar:8.1.0.Final] 
    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:159) [wildfly-server-8.1.0.Final.jar:8.1.0.Final] 
    ... 5 more 
Caused by: java.util.zip.ZipException: invalid LOC header (bad signature) 
    at java.util.zip.ZipFile.read(Native Method) [rt.jar:1.8.0_20] 
    at java.util.zip.ZipFile.access$1400(ZipFile.java:61) [rt.jar:1.8.0_20] 
    at java.util.zip.ZipFile$ZipFileInputStream.read(ZipFile.java:717) [rt.jar:1.8.0_20] 
    at java.util.zip.ZipFile$ZipFileInflaterInputStream.fill(ZipFile.java:420) [rt.jar:1.8.0_20] 
    at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:158) [rt.jar:1.8.0_20] 
    at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:122) [rt.jar:1.8.0_20] 
    at org.jboss.vfs.util.PaddedManifestStream.read(PaddedManifestStream.java:43) [jboss-vfs-3.2.5.Final.jar:3.2.5.Final] 
    at java.io.InputStream.read(InputStream.java:170) [rt.jar:1.8.0_20] 
    at java.util.jar.Manifest$FastInputStream.fill(Manifest.java:441) [rt.jar:1.8.0_20] 
    at java.util.jar.Manifest$FastInputStream.readLine(Manifest.java:375) [rt.jar:1.8.0_20] 
    at java.util.jar.Manifest$FastInputStream.readLine(Manifest.java:409) [rt.jar:1.8.0_20] 
    at java.util.jar.Attributes.read(Attributes.java:376) [rt.jar:1.8.0_20] 
    at java.util.jar.Manifest.read(Manifest.java:199) [rt.jar:1.8.0_20] 
    at java.util.jar.Manifest.<init>(Manifest.java:69) [rt.jar:1.8.0_20] 
    at org.jboss.vfs.VFSUtils.readManifest(VFSUtils.java:224) [jboss-vfs-3.2.5.Final.jar:3.2.5.Final] 
    at org.jboss.vfs.VFSUtils.getManifest(VFSUtils.java:208) [jboss-vfs-3.2.5.Final.jar:3.2.5.Final] 
    at org.jboss.as.server.deployment.module.ManifestAttachmentProcessor.getManifest(ManifestAttachmentProcessor.java:76) [wildfly-server-8.1.0.Final.jar:8.1.0.Final] 
    ... 7 more 

모든 모듈의 POM.xml 파일은 다음과 같습니다. 라이브러리 응용 프로그램의 pom.xml 파일 (상위 프로젝트) 라이브러리-INT-테스트

<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> 
     <groupId>com.library</groupId> 
     <artifactId>library-app</artifactId> 
     <version>0.0.1-SNAPSHOT</version> 
    </parent> 
    <artifactId>library-int-tests</artifactId> 

    <properties> 
     <version.arquillian_core>1.1.5.Final</version.arquillian_core> 
     <version.arquillian.wildfly>8.1.0.Final</version.arquillian.wildfly> 
    </properties> 

    <dependencies> 

     <dependency> 
      <groupId>com.library</groupId> 
      <artifactId>library-model</artifactId> 
      <scope>test</scope> 
     </dependency> 

     <dependency> 
      <groupId>com.library</groupId> 
      <artifactId>library-model</artifactId> 
      <type>test-jar</type> 
      <scope>test</scope> 
     </dependency> 

     <dependency> 
      <groupId>com.library</groupId> 
      <artifactId>library-resource</artifactId> 
      <scope>test</scope> 
     </dependency> 

     <dependency> 
      <groupId>com.library</groupId> 
      <artifactId>library-resource</artifactId> 
      <type>test-jar</type> 
      <scope>test</scope> 
     </dependency> 

     <dependency> 
      <groupId>com.google.code.gson</groupId> 
      <artifactId>gson</artifactId> 
      <scope>test</scope> 
     </dependency> 

     <dependency> 
      <groupId>org.jboss.resteasy</groupId> 
      <artifactId>resteasy-client</artifactId> 
      <scope>test</scope> 
     </dependency> 

     <dependency> 
      <groupId>org.skyscreamer</groupId> 
      <artifactId>jsonassert</artifactId> 
      <scope>test</scope> 
     </dependency> 


    </dependencies> 


    <profiles> 
     <profile> 
      <id>skip-int-tests</id> 
      <activation> 
       <activeByDefault>true</activeByDefault> 
      </activation> 
      <build> 
       <plugins> 
        <plugin> 
         <groupId>org.apache.maven.plugins</groupId> 
         <artifactId>maven-compiler-plugin</artifactId> 
         <executions> 
          <execution> 
           <id>default-testCompile</id> 
           <phase>test-compile</phase> 
           <configuration> 
            <testExcludes> 
             <exclude>**/*.java</exclude> 
            </testExcludes> 
           </configuration> 

           <goals> 
            <goal>testCompile</goal> 
           </goals> 
          </execution> 
         </executions> 
        </plugin> 
       </plugins> 
      </build> 
     </profile> 

     <profile> 
      <id>integrationTests-wildfly</id> 
      <properties> 
       <jboss.home>target/wildfly-8.1.0.Final</jboss.home> 
      </properties> 

      <build> 
       <testResources> 
        <testResource> 
         <directory>src/test/resources</directory> 
         <filtering>true</filtering> 
        </testResource> 
       </testResources> 

       <plugins> 
        <plugin> 
         <groupId>org.apache.maven.plugins</groupId> 
         <artifactId>maven-compiler-plugin</artifactId> 
         <executions> 
          <execution> 
           <id>default-testCompile</id> 
           <phase>test-compile</phase> 
           <configuration> 
            <testIncludes> 
              <include>**/*.java</include> 
            </testIncludes> 
           </configuration> 
          <goals> 
           <goal>testCompile</goal> 
          </goals> 
          </execution> 
         </executions> 
        </plugin> 

        <plugin> 
         <groupId>org.apache.maven.plugins</groupId> 
         <artifactId>maven-surefire-plugin</artifactId> 
         <configuration> 
          <includes> 
           <include>**/*IntTest.java</include> 
          </includes> 
         </configuration> 
        </plugin> 

        <plugin> 
         <groupId>org.apache.maven.plugins</groupId> 
         <artifactId>maven-dependency-plugin</artifactId> 
         <executions> 
          <execution> 
           <id>unpack</id> 
           <phase>generate-sources</phase> 
           <goals> 
            <goal>unpack</goal> 
           </goals> 
          </execution> 
         </executions> 

         <configuration> 
          <artifactItems> 
           <artifactItem> 
            <groupId>org.wildfly</groupId> 
            <artifactId>wildfly-dist</artifactId> 
            <version>${version.arquillian.wildfly}</version> 
            <type>zip</type> 
            <overWrite>false</overWrite> 
            <outputDirectory>target</outputDirectory> 
           </artifactItem> 
          </artifactItems> 
         </configuration> 
        </plugin> 

        <plugin> 
         <artifactId>maven-resources-plugin</artifactId> 
         <executions> 
          <execution> 
           <id>copy-resources</id> 
           <phase>process-resources</phase> 
           <goals> 
            <goal>copy-resources</goal> 
           </goals> 

           <configuration> 
            <outputDirectory>${jboss.home}/standalone/configuration</outputDirectory> 
            <resources> 
             <resource> 
              <directory>src/test/resources/</directory> 
              <includes> 
               <include>standalone-full.xml</include> 
              </includes> 
              <filtering>true</filtering> 
             </resource> 
            </resources> 
           </configuration> 
          </execution> 
         </executions> 
        </plugin> 


       </plugins> 
      </build> 

      <dependencyManagement> 

       <dependencies> 
        <dependency> 
         <groupId>org.jboss.shrinkwrap.resolver</groupId> 
         <artifactId>shrinkwrap-resolver-bom</artifactId> 
         <version>2.2.0-beta-1</version> 
         <type>pom</type> 
         <scope>import</scope> 
        </dependency> 

<dependency> 
     <groupId>org.mockito</groupId> 
     <artifactId>mockito-all</artifactId> 
     <version>1.9.5</version> 
     <scope>test</scope> 
    </dependency> 

        <dependency> 
         <groupId>org.jboss.arquillian</groupId> 
         <artifactId>arquillian-bom</artifactId> 
         <version>${version.arquillian_core}</version> 
         <type>pom</type> 
         <scope>import</scope> 
        </dependency> 
       </dependencies> 
      </dependencyManagement> 


      <dependencies> 
       <dependency> 
        <groupId>org.jboss.arquillian.core</groupId> 
        <artifactId>arquillian-core-api</artifactId> 
        <scope>test</scope> 
       </dependency> 

       <dependency> 
        <groupId>org.wildfly</groupId> 
        <artifactId>wildfly-arquillian-container-managed</artifactId> 
        <version>${version.arquillian.wildfly}</version> 
        <scope>test</scope> 
       </dependency> 

       <dependency> 
        <groupId>org.jboss.arquillian.junit</groupId> 
        <artifactId>arquillian-junit-container</artifactId> 
        <scope>test</scope> 
       </dependency> 

       <dependency> 
        <groupId>org.jboss.shrinkwrap.resolver</groupId> 
        <artifactId>shrinkwrap-resolver-impl-maven</artifactId> 
        <scope>test</scope> 
       </dependency> 

       <dependency> 
        <groupId>org.jboss.spec</groupId> 
        <artifactId>jboss-javaee-7.0</artifactId> 
        <version>1.0.0.Final</version> 
        <type>pom</type> 
        <scope>test</scope> 
       </dependency> 

      </dependencies> 
     </profile> 
    </profiles> 

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.library</groupId> 
    <artifactId>library-app</artifactId> 
    <version>0.0.1-SNAPSHOT</version> 
    <packaging>pom</packaging> 

    <properties> 
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 
    </properties> 

    <repositories> 
     <repository> 
      <id>JBoss repository</id> 
      <url>https://repository.jboss.org/nexus/content/groups/public-jboss</url> 
     </repository> 
    </repositories> 

    <build> 
     <pluginManagement> 
      <plugins> 
       <plugin> 
        <groupId>org.apache.maven.plugins</groupId> 
        <artifactId>maven-compiler-plugin</artifactId> 
        <version>3.2</version> 
       </plugin> 

       <plugin> 
        <groupId>org.apache.maven.plugins</groupId> 
        <artifactId>maven-surefire-plugin</artifactId> 
        <version>2.18</version> 
       </plugin> 

       <plugin> 
        <groupId>org.apache.maven.plugins</groupId> 
        <artifactId>maven-ear-plugin</artifactId> 
        <version>2.9.1</version> 
       </plugin> 

       <plugin> 
        <groupId>org.apache.maven.plugins</groupId> 
        <artifactId>maven-war-plugin</artifactId> 
        <version>2.6</version> 
       </plugin> 

       <plugin> 
        <groupId>org.apache.maven.plugins</groupId> 
        <artifactId>maven-jar-plugin</artifactId> 
        <version>2.5</version> 
       </plugin> 
      </plugins> 
     </pluginManagement> 

     <plugins> 
      <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-compiler-plugin</artifactId> 
       <configuration> 
        <source>1.8</source> 
        <target>1.8</target> 
       </configuration> 
      </plugin> 
     </plugins> 
    </build> 


    <dependencyManagement> 
     <dependencies> 
      <dependency> 
       <groupId>com.google.code.gson</groupId> 
       <artifactId>gson</artifactId> 
       <version>2.3.1</version> 
      </dependency> 

      <dependency> 
       <groupId>org.jboss.resteasy</groupId> 
       <artifactId>resteasy-client</artifactId> 
       <version>3.0.2.Final</version> 
       <scope>test</scope> 
      </dependency> 

      <dependency> 
       <groupId>org.skyscreamer</groupId> 
       <artifactId>jsonassert</artifactId> 
       <version>1.2.3</version> 
       <scope>test</scope> 
      </dependency> 

      <!-- Our library-model src and test jars are below --> 
      <dependency> 
       <groupId>com.library</groupId> 
       <artifactId>library-model</artifactId> 
       <version>${project.version}</version> 
      </dependency> 

      <dependency> 
       <groupId>com.library</groupId> 
       <artifactId>library-model</artifactId> 
       <version>${project.version}</version> 
       <type>test-jar</type> 
      </dependency> 


      <!-- Our library-model src and test jars are abve --> 

    <!-- Our library-resource src and test jars are below --> 
      <dependency> 
       <groupId>com.library</groupId> 
       <artifactId>library-resource</artifactId> 
       <version>${project.version}</version> 
      </dependency> 

      <dependency> 
       <groupId>com.library</groupId> 
       <artifactId>library-resource</artifactId> 
       <version>${project.version}</version> 
       <type>test-jar</type> 
      </dependency> 

    <!-- Our library-resource src and test jars are abve --> 


     </dependencies> 
    </dependencyManagement> 

    <dependencies> 
     <dependency> 
      <groupId>javax</groupId> 
      <artifactId>javaee-api</artifactId> 
      <version>7.0</version> 
      <scope>provided</scope> 
     </dependency> 

     <dependency> 
      <groupId>org.slf4j</groupId> 
      <artifactId>slf4j-api</artifactId> 
      <version>1.7.7</version> 
      <scope>provided</scope> 
     </dependency> 

     <dependency> 
      <groupId>junit</groupId> 
      <artifactId>junit</artifactId> 
      <version>4.11</version> 
      <scope>test</scope> 
     </dependency> 


     <!-- <dependency> 
      <groupId>org.mockito</groupId> 
      <artifactId>mockito-core</artifactId> 
      <version>2.1.0-RC.1</version> 
      <type>pom</type> 
     </dependency> 
--> 
    <dependency> 
     <groupId>org.mockito</groupId> 
     <artifactId>mockito-all</artifactId> 
     <version>1.9.5</version> 
     <scope>test</scope> 
    </dependency> 

     <!-- https://mvnrepository.com/artifact/org.mockito/mockito-all --> 
    <!-- <dependency> 
      <groupId>org.mockito</groupId> 
      <artifactId>mockito-all</artifactId> 
      <version>1.10.19</version> 
     </dependency> --> 

     <!-- https://mvnrepository.com/artifact/org.hamcrest/hamcrest-all --> 
     <dependency> 
      <groupId>org.hamcrest</groupId> 
      <artifactId>hamcrest-all</artifactId> 
      <version>1.3</version> 
     </dependency> 

     <dependency> 
      <groupId>javax.el</groupId> 
      <artifactId>javax.el-api</artifactId> 
      <version>2.2.4</version> 
      <scope>test</scope> 
     </dependency> 

     <dependency> 
      <groupId>org.glassfish.web</groupId> 
      <artifactId>javax.el</artifactId> 
      <version>2.2.4</version> 
      <scope>test</scope> 
     </dependency> 

     <dependency> 
      <groupId>org.slf4j</groupId> 
      <artifactId>slf4j-simple</artifactId> 
      <version>1.6.4</version> 
      <scope>test</scope> 
     </dependency> 
    </dependencies> 
    <modules> 
     <module>library-model</module> 
     <module>library-resource</module> 
     <module>library-int-tests</module> 
    </modules> 
</project> 

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> 
    <parent> 
     <groupId>com.library</groupId> 
     <artifactId>library-app</artifactId> 
     <version>0.0.1-SNAPSHOT</version> 
    </parent> 
    <artifactId>library-model</artifactId> 

    <build> 
     <plugins> 
      <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-jar-plugin</artifactId> 
       <executions> 
        <execution> 
         <goals> 
          <goal>test-jar</goal> 
         </goals> 
        </execution> 
       </executions> 
      </plugin> 
     </plugins> 
    </build> 

    <dependencies> 
     <!-- used for testing phase only for runtime we will use postgresql --> 
     <dependency> 
      <groupId>org.hsqldb</groupId> 
      <artifactId>hsqldb</artifactId> 
      <version>2.3.2</version> 
      <scope>test</scope> 
     </dependency> 



     <dependency> 
      <groupId>org.hibernate</groupId> 
      <artifactId>hibernate-entitymanager</artifactId> 
      <version>4.3.7.Final</version> 
      <scope>test</scope> 
     </dependency> 


     <!-- This hibernate-validator dependency is commented because of validationException. 
      So, below 4.3.2 validation was brought <dependency> <groupId>org.hibernate</groupId> 
      <artifactId>hibernate-validator</artifactId> <version>5.1.3.Final</version> 
      <scope>test</scope> </dependency> --> 
     <dependency> 
      <groupId>org.hibernate</groupId> 
      <artifactId>hibernate-validator</artifactId> 
      <version>4.3.2.Final</version> 
     </dependency> 

    </dependencies> 
</project> 
도서관 자원의 16,

마지막의 pom.xml 파일 내가 제이보스 8.1 사용하고

<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> 
     <groupId>com.library</groupId> 
     <artifactId>library-app</artifactId> 
     <version>0.0.1-SNAPSHOT</version> 
    </parent> 
    <artifactId>library-resource</artifactId> 

    <build> 
     <plugins> 
      <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-jar-plugin</artifactId> 
       <executions> 
        <execution> 
         <goals> 
          <goal>test-jar</goal> 
         </goals> 
        </execution> 
       </executions> 
      </plugin> 
     </plugins> 
    </build> 


    <dependencies> 

     <dependency> 
      <groupId>com.library</groupId> 
      <artifactId>library-model</artifactId> 
     </dependency> 

     <dependency> 
      <groupId>com.library</groupId> 
      <artifactId>library-model</artifactId> 
      <type>test-jar</type> 
      <scope>test</scope> 
     </dependency> 

     <dependency> 
      <groupId>com.google.code.gson</groupId> 
      <artifactId>gson</artifactId> 
     </dependency> 

     <dependency> 
      <groupId>org.jboss.resteasy</groupId> 
      <artifactId>resteasy-client</artifactId> 
      <scope>test</scope> 
     </dependency> 

     <dependency> 
      <groupId>org.skyscreamer</groupId> 
      <artifactId>jsonassert</artifactId> 
      <scope>test</scope> 
     </dependency> 


     <!-- Our library-model src and test jars are abve --> 

    </dependencies> 
</project> 

. 이 오류는 mockito에 대해 뭔가를 표시합니다. 나는 그것을 이해하지 못한다. 이 문제를 해결하도록 도와주세요.

편집 : 오류 및 경고 로그가 매우 큽니다. 나는 pastebin에 완전한 출력물을 호스트하고 싶었지만 크기 제한 때문에 그것을 할 수 없었다. 나는 여기 출력의 일부를 호스팅했습니다 http://pastebin.com/S2cSaPBt

+1

정확한 오류 출력 – davidxxx

+0

오류가 http://pastebin.com/S2cSaPBt에서 호스팅되었습니다. – karna

답변

0

당신이 손상된 mockito-core-1.9.5.jar 라이브러리를 가지고있는 것 같습니다. 로컬 저장소에서 JAR을 삭제하고 응용 프로그램을 다시 빌드하려고 할 수 있습니다.

관련 문제