달력

5

« 2024/5 »

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
2008. 4. 16. 10:39

Artifactory 사용하기 프레임워크2008. 4. 16. 10:39

1. 설치하기

http://www.jfrog.org/sites/artifactory/latest에서 최신 버전을 다운로드하고 적절한 디렉토리에서 압축을 푼다.

2. 설정하기
$ARTIFACTORY_HOME/etc에 있는 artifactory.config.xml 파일을 아래과 같이 수정한다.
<?xml version="1.0" encoding="UTF-8"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://artifactory.jfrog.org/xsd/1.1.0"
xsi:schemaLocation="http://artifactory.jfrog.org/xsd/1.1.0
http://www.jfrog.org/xsd/artifactory-v1_1_0.xsd">
<localRepositories>
<localRepository>
<key>daum-internal-repository</key>
<description>daum internal repository</description>
<handleReleases>true</handleReleases>
<handleSnapshots>true</handleSnapshots>
</localRepository>
<localRepository>
<key>third-party-repository</key>
<description>third party repository</description>
<handleReleases>true</handleReleases>
<handleSnapshots>true</handleSnapshots>
</localRepository>
</localRepositories>
<remoteRepositories>
<remoteRepository>
<key>ibiblio</key>
<handleReleases>true</handleReleases>
<handleSnapshots>false</handleSnapshots>
<excludesPattern>org/artifactory/**,org/jfrog/**</excludesPattern>
<url>http://repo1.maven.org/maven2</url>
</remoteRepository>
<remoteRepository>
<key>codehaus-snapshots</key>
<blackedOut>true</blackedOut>
<handleReleases>false</handleReleases>
<handleSnapshots>true</handleSnapshots>
<excludesPattern>org/artifactory/**,org/jfrog/**</excludesPattern>
<url>http://snapshots.repository.codehaus.org</url>
</remoteRepository>
<remoteRepository>
<key>apache-m2-snapshots</key>
<handleReleases>false</handleReleases>
<handleSnapshots>true</handleSnapshots>
<url>http://people.apache.org/repo/m2-snapshot-repository</url>
</remoteRepository>
<remoteRepository>
<key>apache-snapshots</key>
<handleReleases>false</handleReleases>
<handleSnapshots>true</handleSnapshots>
<url>http://people.apache.org/maven-snapshot-repository</url>
</remoteRepository>
</remoteRepositories>
</config>

3. 실행하기
$ARTIFACTORY_HOME/bin에서 artifactory.sh를 수행한다. 이 스크립트는 jetty를 이용해서 $JAVA_HOME 환경 변수 설정이 필요하다.
8081 포트로 artifactory가 실행된다.

4. settings.xml
~/.m2/settins.xml 파일을 아래와 같이 설정한다.
<settings 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/settings-1.0.0.xsd">
<profiles>
<profile>
<id>gaia</id>
<repositories>
<repository>
<id>central</id>
<url>
http://media-install:8081/artifactory/repo
</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>snapshots</id>
<url>
http://media-install:8081/artifactory/repo
</url>
<releases>
<enabled>false</enabled>
</releases>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<url>
http://media-install:8081/artifactory/repo
</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>snapshots</id>
<url>
http://media-install:8081/artifactory/repo
</url>
<releases>
<enabled>false</enabled>
</releases>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
</settings>

5. maven에서 artifactory 연결하기
mvn 실행시 settings.xml에서 정의한 프로파일을 정의하기 위해 '-Pgaia'를 지정하면 된다.

6. 정상적으로 동작하는지 확인하기
http://media-install:8081/artifactory로 접속 admin/password로 로긴한다. 왼쪽 메뉴에서 "Browsing/Repositories Tree"를 클릭해서 artifactory들이 보이면 정상 동작하는 것이다.

7. 3rd party artifact나 사내 artifact 등록하기
왼쪽 메뉴에서 "Deploy an Artifacts" 클릭. "찾아보기" 버튼으로 deploy할 artifact 선택하고, "Upload!" 버튼 클릭. 다음에 나오는 화면에서 groupId, artifactId 확인하고 적절하게 설정하고 deploy한다.

:
Posted by codetemplate