2013-03-07 3 views
0

Cargo 1.3.3 플러그인에서 Maven 3.0.3을 사용하고 있습니다. 임베디드 JBoss 7.1 컨테이너를 구성하려고합니다. JBoss가 요청을 수신하는 포트 (일반적으로 8080)를 사용자 정의하고 싶습니다. 구성 섹션에서 "cargo.servlet.port"속성을 사용하여, 그것을 사용자 정의 할 수없는 것. 다음은 내 구성 여기Maven Cargo를 사용하여 임베디드 JBoss 컨테이너의 서블릿 포트를 사용자 정의하는 방법을 알고 계십니까?

   <plugin> 
        <groupId>org.codehaus.cargo</groupId> 
        <artifactId>cargo-maven2-plugin</artifactId> 
        <version>1.3.3</version> 
        <configuration> 
         <home>${project.build.directory}/jboss-${jboss.version}/container</home> 
         <properties> 
          <cargo.logging>high</cargo.logging> 
          <cargo.servlet.port>${jboss.servlet.port}</cargo.servlet.port> 
         </properties> 
         <container> 
          <containerId>jboss${jboss.major}x</containerId> 
          <zipUrlInstaller> 
           <url>http://download.jboss.org/jbossas/7.1/jboss-as-7.1.1.Final/jboss-as-7.1.1.Final.zip</url> 
           <downloadDir>${project.basedir}/downloads</downloadDir> 
           <extractDir>${project.build.directory}/extracts</extractDir> 
          </zipUrlInstaller> 
          <output>${project.build.directory}/jboss${jboss.major}x.log</output> 
          <log>${project.build.directory}/cargo.log</log> 
         </container> 
         <deployables> 
          <deployable> 
           <location>target/${project.artifactId}.${project.packaging}</location> 
           <pingURL>http://localhost:${jboss.servlet.port}/${project.artifactId}</pingURL> 
           <pingTimeout>60000</pingTimeout> 
           <properties> 
            <context>${project.artifactId}</context> 
           </properties> 
          </deployable> 
         </deployables> 
        </configuration> 
        <executions> 
         <execution> 
          <id>start-container</id> 
          <phase>pre-integration-test</phase> 
          <goals> 
           <goal>start</goal> 
           <goal>deploy</goal> 
          </goals> 
         </execution> 
         <execution> 
          <id>stop-container</id> 
          <phase>post-integration-test</phase> 
          <goals> 
           <goal>stop</goal> 
          </goals> 
         </execution> 
        </executions> 
       </plugin> 

것은 (나는 이미 내가 응용 프로그램 서버 로그에서 얻을 바인드 예외 JBoss의 인스턴스는 포트 8080)에서 실행.

16:45:41,913 INFO [org.jboss.ws.common.management.AbstractServerConfig] (MSC service thread 1-10) JBoss Web Services - Stack CXF Server 4.0.2.GA 
16:45:42,010 ERROR [org.apache.coyote.http11.Http11Protocol] (MSC service thread 1-3) Error initializing endpoint: java.net.BindException: Address already in use /0.0.0.0:8080 
    at org.apache.tomcat.util.net.JIoEndpoint.init(JIoEndpoint.java:983) [jbossweb-7.0.13.Final.jar:] 
    at org.apache.coyote.http11.Http11Protocol.init(Http11Protocol.java:190) [jbossweb-7.0.13.Final.jar:] 
    at org.apache.catalina.connector.Connector.init(Connector.java:983) [jbossweb-7.0.13.Final.jar:] 
    at org.jboss.as.web.WebConnectorService.start(WebConnectorService.java:267) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final] 
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA] 
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA] 
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895) [classes.jar:1.6.0_41] 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) [classes.jar:1.6.0_41] 
    at java.lang.Thread.run(Thread.java:680) [classes.jar:1.6.0_41] 

16:45:42,025 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-3) MSC00001: Failed to start service jboss.web.connector.http: org.jboss.msc.service.StartException in service jboss.web.connector.http: JBAS018007: Error starting web connector 
    at org.jboss.as.web.WebConnectorService.start(WebConnectorService.java:271) 
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA] 
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA] 
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895) [classes.jar:1.6.0_41] 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) [classes.jar:1.6.0_41] 
    at java.lang.Thread.run(Thread.java:680) [classes.jar:1.6.0_41] 
Caused by: LifecycleException: Protocol handler initialization failed: java.net.BindException: Address already in use /0.0.0.0:8080 
    at org.apache.catalina.connector.Connector.init(Connector.java:985) 
    at org.jboss.as.web.WebConnectorService.start(WebConnectorService.java:267) 
    ... 5 more 

그것은 나를 내 자신의 보스 세인트 사용할 수 있습니다 내가화물 플러그인이 좋아하는 이유 andalone.xml 구성이지만 Cargo에 대한 대안을 공개하고 있습니다. 단, 구성을 사용자 정의 할 수 있어야합니다. 어떤 안내해 주셔서 감사합니다. - Dave

+0

jboss-as-maven-plugin을 보았습니까? https://docs.jboss.org/jbossas/7/plugins/maven/latest/ –

답변

0

구성에 작은 버그가있는 것 같습니다. 이 속성은 플러그인 구성의 하위/속성 인 Cargo 구성의 일부이므로 실제로 구성 태그 내에 구성 태그를 넣어야합니다. 여기 내 것이 (부분적으로) :

<plugin> 
     <groupId>org.codehaus.cargo</groupId> 
     <artifactId>cargo-maven2-plugin</artifactId> 
     <version>1.3.3</version> 
     <configuration> 
     <container> 
      <!-- Add your container here, we use a custom one --> 
     </container> 
     <configuration> 
      <properties> 
      <cargo.servlet.port>5556</cargo.servlet.port> 
      <!-- other properties --> 
      </properties> 
      <configfiles combine.children="append"> 
      <!-- here we add our configuration files --> 
      <configfile> 
       <!-- Expect configfiles to be filtered and gathered in 
       target/jboss71x (in the respective subdirectories) --> 
       <file>${project.build.directory}/cargo/jboss71x</file> 
      </configfile> 
      </configfiles> 
     </configuration> 
     </configuration> 
    </plugin>