Is there such a thing as a local remote Maven repository? -
i have build box on installed:
- maven
- bamboo
- archiva
i have configured bamboo grab maven project remote git source , build goals 'clean install'.
i have configured archiva 2 repos:
- mirror - mirror of central
- dev - repo artifacts
i have made following changes maven settings.xml:
# define local repo - same location have set archiva 'dev' repo. <localrepository>/opt/maven-repo/dev</localrepository> # define archiva mirror set <mirror> <id>mirror</id> <url>http://localhost:8080/repository/mirror/</url> <mirrorof>external:*</mirrorof> </mirror>
when execute build maven grabs external via mirror , adds built artifact dev, along other jars grabbed mirror. have duplicate jars...
\repo\mirror\junit\junit \repo\mirror\classworlds\classworlds \repo\dev\junit\junit \repo\dev\classworlds\classworlds \repo\dev\me\myartifact
my question is, correct approach? want keep 'dev' artifacts , mirror central - don't want duplicates.
should using localrepository config in settings.xml or should using 'mvn deploy' put artifact in archiva repository different method?
could clarify different use cases local , remote repository?
finally, how should defining pom? currently, have defined
<distributionmanagement> <repository> <id>dev</id> <url>file:///repo/dev</url> </repository> </distributionmanagement>
should adding in mirror?
to put artifacts in repository manager should use default maven-deploy-plugin
can controlled distributionmanagement
. target put things controlled defining distributionmanagement.
<project 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/maven-4.0.0.xsd"> ... <distributionmanagement> <repository> <id>releases</id> <name>release</name> <url>http://urlarchiva/releases/</url> </repository> <snapshotrepository> <id>snapshots</id> <name>snapshots</name> <url>http://urlarchiva/snapshots/</url> </snapshotrepository> ... </distributionmanagement> ... </project>
the repositories used consume artifacts defined in settings.xml
<settings> <mirrors> <mirror> <!--this sends else /public --> <id>nexus</id> <mirrorof>*</mirrorof> <url>http://serverurlarchiva/public/</url> </mirror> </mirrors> <profiles> <profile> <id>nexus</id> <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>
on bamboo should able control settings.xml used have local repository per build makes build independent each other.
Comments
Post a Comment