repository - How to fetch artifacts from own repo using maven? -
how create simple project fetches artifacts repo using maven? , these artifacts saved - default maven repo?
i using apache archiva.
just start using repository manager nexus , that's it. please configure settings.xml file according following:
<settings> <mirrors> <mirror> <!--this sends else /public --> <id>nexus</id> <mirrorof>*</mirrorof> <url>url of archiva server</url> </mirror> </mirrors> <profiles> <profile> <id>nexus</id> <!--enable snapshots built in central repo direct --> <!--all requests nexus via mirror --> <repositories> <repository> <id>central</id> <url>http://central</url> <releases><enabled>true</enabled></releases> <snapshots><enabled>true</enabled></snapshots> </repository> </repositories> <pluginrepositories> <pluginrepository> <id>central</id> <url>http://central</url> <releases><enabled>true</enabled></releases> <snapshots><enabled>true</enabled></snapshots> </pluginrepository> </pluginrepositories> </profile> </profiles> <activeprofiles> <!--make profile active time --> <activeprofile>nexus</activeprofile> </activeprofiles> </settings>
the artifacts being downloaded first stored archiva , of course on hard drive $home/.m2/repository
.
if deploy artifact archiva need configure distributionmanagement in pom file similar this:
<distributionmanagement> <repository> <id>releases</id> <name>archiva release repo</name> <url>http://url of archiva/releases/</url> </repository> <snapshotrepository> <id>snapshots<id> <name>archiva snapshots repo</name> <url>http://url of archiva/snapshots/</url> </snapshotrepository> ... </distributionmanagement> ...
to test can use mvn deploy
see if artiacts being deployed snapshot repository. can change version of test project 1.0
, redo mvn deploy
try deploy artifacts release repository.
Comments
Post a Comment