2011년 8월 22일 월요일

Manually install spring dependency for Maven



1. Manual install spring dependency for Maven 
For example, I'd like to install srping's core.jar file


mvn install:install-file -DgroupId=GroupID -DartifactId=ArtifacID -Dversion=Version -Dfile=File Path -Dpackaging=jar -DgerneratePom=true



[yeonki@localhost 3.0.5.RELEASE]$ mvn install:install-file -DgroupId=org.springframework -DartifactId=spring-core -Dversion=3.0.5.RELEASE -Dfile=/home/yeonki/spring-3.0.5/dist/org.springframework.core-3.0.5.RELEASE.jar -Dpackaging=jar -DgerneratePom=true
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-install-plugin:2.3.1:install-file (default-cli) @ standalone-pom ---
[INFO] Installing /home/yeonki/spring-3.0.5/dist/org.springframework.core-3.0.5.RELEASE.jar to /home/yeonki/.m2/repository/org/springframework/spring-core/3.0.5.RELEASE/spring-core-3.0.5.RELEASE.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.359s
[INFO] Finished at: Mon Aug 22 18:01:03 KST 2011
[INFO] Final Memory: 3M/15M
[INFO] ------------------------------------------------------------------------


Then, Go to maven's repository path. In my case, /home/yeonki/.m2/repository/org/springframework/spring-core/3.0.5.RELEASE/



[yeonki@localhost 3.0.5.RELEASE]$ dir
_maven.repositories    spring-core-3.0.5.RELEASE.pom
spring-core-3.0.5.RELEASE.jar    spring-core-3.0.5.RELEASE.pom.sha1
spring-core-3.0.5.RELEASE.jar.sha1


** You don't need to install it manually. Maven public repository has already provided spring-core 3.0.5.RELEASE. Visit http://mvnrepository.com/artifact/org.springframework. You can find nearly   everything that you'd like to from here.




2. Uninstall a local dependency
If you want uninstall this, you just delete its directory in the maven's local repository.

[yeonki@localhost springframework]$ rm -rf *core*

댓글 없음:

댓글 쓰기