티스토리 뷰

maven repository를 내부에서 관리 할 수 있는 환경을 구축하기 위해 artifactory라는 Open source를 구축해 보도록 하겠습니다.


download url : http://olex.openlogic.com/package_versions/download/11700?package_version_id=6577&path=https%3A%2F%2Folex-secure.openlogic.com%2Fcontent%2Fopenlogic%2Fartifactory%2F2.4.0%2Fopenlogic-artifactory-2.4.0-all-bin-1.zip


step 1. 압축해제

다운받은 repository 압축해제

#unzip openlogic-artifactory-2.4.0-all-bin-1.zip


step 2. war 설정

압축 해제후 artifactory.war를 tomcat webapps ( docBase )로 이동

$cp /usr/local/artifactory-2.4.0/webapps/artifactory.war $TOMCAT_HOME/webapps


step 3. tomcat 실행

$TOMCAT_HOME/bin/startup.sh


step 4. maven  local repository 설정

$ vi ~/.m2/settings

<?xml version="1.0" encoding="UTF-8"?>

<settings xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd" xmlns="http://maven.apache.org/SETTINGS/1.0.0"

    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

  <servers>

    <server>

      <username>admin</username>

      <password>password</password>

      <id>central</id>

    </server>

    <server>

      <username>admin</username>

      <password>password</password>

      <id>snapshots</id>

    </server>

  </servers>

  <mirrors>

    <mirror>

      <mirrorOf>central</mirrorOf>

      <name>remote-repos</name>

      <url>http://repo1.maven.org/maven2/</url>

      <id>remote-repos</id>

    </mirror>

  </mirrors>


  <profiles>

    <profile>

      <repositories>

        <repository>

          <snapshots>

            <enabled>false</enabled>

          </snapshots>

          <id>central</id>

          <name>libs-release</name>

          <url>http://dev.softcast.co.kr:9000/repo</url>

        </repository>

        <repository>

          <snapshots />

          <id>snapshots</id>

          <name>libs-snapshot</name>

          <url>http://dev.softcast.co.kr:9000/repo</url>

        </repository>

      </repositories>

      <pluginRepositories>

        <pluginRepository>

          <snapshots>

            <enabled>false</enabled>

          </snapshots>

          <id>central</id>

          <name>plugins-release</name>

          <url>http://dev.softcast.co.kr:9000/repo</url>

        </pluginRepository>

        <pluginRepository>

          <snapshots />

          <id>snapshots</id>

          <name>plugins-snapshot</name>

          <url>http://dev.softcast.co.kr:9000/repo</url>

        </pluginRepository>

      </pluginRepositories>

      <id>artifactory</id>

    </profile>

  </profiles>

  <activeProfiles>

    <activeProfile>artifactory</activeProfile>

  </activeProfiles>

</settings>



step 5. maven  실행 테스트

$ mvn compile

$ mvn test-compile

$ mvn package

$ mvn install

$ mvn exec:java -Dexec.mainClass=co.kr.mycompany.MobilePush.App

회사 내부  및 기타 library를 관리목적으로 훌륭하다.

by rocksea.













댓글