프로그래밍
[maven] jar 를 Local Repository 에 추가하기
스티브김스
2015. 5. 6. 23:40
내부적으로 사용되는 lib들은 프로젝트에서 사용하기 위해서 artifactId 등을 따로 지정해서 사용할 수 있다.
이런 library등을 jar파일로 설치한다. 설치라기보다 로컬 리파지토리로 가져온다.
이후 pom.xml에 해당 artifactid, groupid 를 추가해서 사용할 수 있다.
maven은 로컬리파지토리에서 해당 id들을 찾은 후 외부 저장소에서 찾는 순서인듯 하다.
mvn install:install-file
-Dfile=<path-to-file>
-DgroupId=<group-id>
-DartifactId=<artifact-id>
-Dversion=<version>
-Dpackaging=<packaging>
-DgeneratePom=true
Where: <path-to-file> the path to the file to load
<group-id> the group that the file should be registered under
<artifact-id> the artifact name for the file
<version> the version of the file
<packaging> the packaging of the file e.g. jar
-Dfile=<path-to-file>
-DgroupId=<group-id>
-DartifactId=<artifact-id>
-Dversion=<version>
-Dpackaging=<packaging>
-DgeneratePom=true
Where: <path-to-file> the path to the file to load
<group-id> the group that the file should be registered under
<artifact-id> the artifact name for the file
<version> the version of the file
<packaging> the packaging of the file e.g. jar
예를 들어 test.jar 를 등록한다고 하면
mvn install:install-file -Dfile=test.jar -DgroupId=test -DartifactId=testing -Dversion=1.0 -Dpackaging=jar -DgeneratePom=true