티스토리 뷰

이번프로젝트는 참 여러가지 유형의 자바 서버를 사용하게하네요.

아무튼 maven + jboss-as-7 을 이용한 환경을 구축해보도록 하겠습니다.


설치환경

OS : ubuntu

JDK : 1.6.0.38

Jboss : jboss-as-7.1.1.Final

maven : Apache Maven 2.2.1 (rdebian-8)


step 1. jboss-as-7 download

download url : http://www.jboss.org/jbossas/downloads/

download후 적당한 위치에 압축을 풀어 놓습니다.


step2.  환경변수 설정 및 jboss 실행

환경설정

$ vim ~/.bash_profile

export JBOSS_HOME="/home/rocksea/work/jboss-as-7.1.1.Final"

실행

$JBOSS_HOME/bin/standalone.sh


step3.  JBOSS Admin 생성
$JBOSS_HOME/bin/add-user.sh
What type of user do you wish to add?
 a) Management User (mgmt-users.properties)
 b) Application User (application-users.properties)
(a): a

Enter the details of the new user to add.
Realm (ManagementRealm) :
Username : rocksea
Password :
Re-enter Password :
About to add user 'rocksea' for realm 'ManagementRealm'
Is this correct yes/no? yes
Added user 'rocksea' to file '$JBOSS_HOME/standalone/configuration/mgmt-users.properties'
Added user 'rocksea' to file '$JBOSS_HOME/domain/configuration/mgmt-users.properties'


step4.  maven project 생성

project 생성 

mvn archetype:generate -DgroupId=com.mycompany.app -DartifactId=my-webapp -DarchetypeArtifactId=maven-archetype-webapp


pom.xml 설정

<dependency>

        <groupId>maven</groupId>

        <artifactId>maven-jboss-plugin</artifactId>

        <version>1.5</version>

        <type>plugin</type>

</dependency>


<build>

     <plugins>

             <plugin>

                     <groupId>org.jboss.as.plugins</groupId>

                     <artifactId>jboss-as-maven-plugin</artifactId>

                     <version>7.3.Final</version>

             </plugin>

     </plugins>

</build>


step5.  WEB-INF/jboss-*.xml 생성

WEB-INF/jboss-deployment-structure.xml
<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure>
  <deployment>
    <exclusions>
        <module name="org.apache.log4j" />
        <module name="org.apache.commons.logging" />
        <module name="org.slf4j"/>
    </exclusions>
  </deployment>
</jboss-deployment-structure>

WEB-INF/jboss-web.xml

<?xml version="1.0" encoding="UTF-8"?>
<!-- JBoss, Home of Professional Open Source Copyright 2012, Red Hat, Inc. 
    and/or its affiliates, and individual contributors by the @authors tag. See 
    the copyright.txt in the distribution for a full listing of individual contributors. 
    Licensed under the Apache License, Version 2.0 (the "License"); you may not 
    use this file except in compliance with the License. You may obtain a copy 
    of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required 
    by applicable law or agreed to in writing, software distributed under the 
    License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS 
    OF ANY KIND, either express or implied. See the License for the specific 
    language governing permissions and limitations under the License. -->

<!-- Configure usage of the security domain "other" -->
<jboss-web>
   <context-root>/</context-root>
</jboss-web>


6. jboss deploy

$ mvn jboss-as:deploy


결과화면


관리자  페이지 확인

http://localhost:9990 

위 생성한 jboss admin계정으로 로그인 후 확인




이상으로 maven + jboss 설치 및 배포에 대해 알아보았습니다.

by rocksea.






'Developer' 카테고리의 다른 글

[vim] plug-in management tool "vundle"  (0) 2013.04.02
Context initialization failed. ( tomcat 포팅시 error )  (0) 2013.02.28
[netty] timeout 설정  (0) 2013.02.15
[ shell ] rows sum script  (0) 2013.02.15
[samba] 간단 samba 설치  (0) 2013.02.12
댓글