Skip to content

Instantly share code, notes, and snippets.

@garlandkr
Forked from skyrocknroll/archivanotes.txt
Last active August 29, 2015 14:09
Show Gist options
  • Save garlandkr/72bb98d5965b4a44ece6 to your computer and use it in GitHub Desktop.
Save garlandkr/72bb98d5965b4a44ece6 to your computer and use it in GitHub Desktop.
Download archiva from http://archiva.apache.org/download.cgi
extract it to /opt/archiva/
cd /opt/archiva/bin
./archiva start
thats it :)
access it http://server-ip:8080/archiva or
http://server-ip:8080/ for archiva 1.4 onwards
to make the client to use the repo edit $M2_HOME/conf/settings.xml
and add this stuff inside <mirrors> tag
<mirror>
<id>archiva.central</id>
<url>http://192.168.1.7:8081/archiva/repository/internal</url>
<mirrorOf>central</mirrorOf>
</mirror>
if you run archive latest 1.4 M3 then url may change to
<url>http://192.168.1.7:8081/repository/internal</url>
this will proxy the requests only for maven central repo
to proxy all the requests change from
<mirrorOf>central</mirrorOf>
to
<mirrorOf>*<mirrorOf>
Eclipse _ M2 eclipse Gotchas
Even after configuring settings.xml eclipse wont fetch artifacts from proxy,
Because eclipse is using its own settingfile from /home/yuva/.m2/settings.xml
to fix this we need goto ->>
Window--> preference-->(search for maven) --> user settings --> user settings --> browse --
select the $M2_HOME/conf/settings.xml
==== Now Lets start uploading our internal artifact to our internal archiva repo =====
Publishing artifacts with sources on archiva
http://stackoverflow.com/questions/1072969/publishing-artifacts-with-sources-on-archiva
How to create jar archive of projects sources with maven
http://stackoverflow.com/questions/11628968/how-to-create-jar-archive-of-projects-sources-with-maven
while uploading the jar artifact genreate the source of the artifact by using following command mvn sources:jar (For this to work you should have included maven sources plugin in the pom.xml)
=================TroubleShooting ====================
If artifacts are not downloading from the out local archiva.
please provide a valid settings file in eclipse m2e windows-->Preferences-->Maven-->userSettings --> User Settings
Description Resource Path Location Type
ArtifactDescriptorException: Failed to read artifact descriptor for commons-lang:commons-lang:jar:2.6: ArtifactResolutionException: Failure to transfer commons-lang:commons-lang:pom:2.6 from http://10.30.0.127:8080/repository/internal was cached in the local repository, resolution will not be reattempted until the update interval of archiva.central has elapsed or updates are forced. Original error: Could not transfer artifact commons-lang:commons-lang:pom:2.6 from/to archiva.central (http://10.30.0.127:8080/repository/internal): Failed to transfer http://10.30.0.127:8080/repository/internal/commons-lang/commons-lang/2.6/commons-lang-2.6.pom. Error code 500, Unable to fetch artifact resource. pom.xml /url-app line 1 Maven Dependency Problem
Then goto archiva web console --> Proxy Connectors --> click the edit of internal --> Releases -->Drop Down --> always
If artifacts are not downloading then check the reports .
http://10.30.0.127/#reports
It may contain what is missing
eg:
com.xxx.monitoring.uptime.client uptime-client 0.2 com.xxx.monitoring.uptime.client/uptime-client/0.2 missing-pom The artifact's POM file '/opt/archivajs14M3/repositories/data/repositories/internal/com/xxx/monitoring/uptime/client/uptime-client/0.2/uptime-client-0.2.pom' was missing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment