1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
|
------
Deploying to Repository
------
Deploying to Repository
There are different ways on how you can deploy artifacts in an Archiva repository.
* Deploying via the Web UI Form
The easiest way to deploy in the repository is via the Web UI form, which can be accessed in the 'Upload Artifact' section.
Just follow these steps:
[[1]] Fill up the following required fields:
* Group Id - the groupId of the artifact to be deployed.
* Artifact Id - the artifactId of the artifact to be deployed.
* Version - the version of the artifact to be deployed.
* Packaging - the packaging of the artifact to be deployed. (ex. jar, war, ear, etc.)
* File - the actual artifact to be deployed.
[]
[[2]] Select the repository you want to deploy to. Please note that if you do not have write permission to the repository,
you will not be allowed to deploy in it.
[[3]] Now, if you want Archiva to generate a pom for the artifact, check the Generate Pom field. Right now, only Maven 2 poms
can be generated.
[[4]] Click Submit and a message will be displayed notifying you if the upload/deployment was successful or not.
[]
These are the files that will be in your repository after deployment:
* artifact
* pom file (if you checked Generate Pom)
* maven-metadata.xml (this will be created if none exists in the artifact level yet, otherwise it will just be updated)
* maven-metadata.xml.sha1 and maven-metadata.xml.md5 (these will be generated for newly created maven-metadata.xml files, otherwise
they will just be updated)
* Configuring Maven to deploy to an Archiva repository
[[1]] Create a user in Archiva to use for deployment
[[2]] The deployment user needs the Role 'Repository Manager' for each repository that you want to deploy to
[[3]] Define the server for deployment inside your 'settings.xml', use the newly created user for authentication
+-------------------------------------------------------------------------+
<settings>
...
<servers>
<server>
<id>archiva.internal</id>
<username>{archiva-deployment-user}</username>
<password>{archiva-deployment-pwd}</password>
</server>
<server>
<id>archiva.snapshots</id>
<username>{archiva-deployment-user}</username>
<password>{archiva-deployment-pwd}</password>
</server>
...
</servers>
...
</settings>
+-------------------------------------------------------------------------+
* Deploying to Archiva using WebDAV
[[1]] Configure the <<<distributionManagement>>> part of your <<<pom.xml>>> (customising the URLs as needed).
The <<<id>>> of the repository in <<<distributionManagement>>> <<must>> match the <<<id>>> of the <<<server>>>
element in <<<settings.xml>>>.
+-------------------------------------------------------------------------+
<project>
...
<distributionManagement>
<repository>
<id>archiva.internal</id>
<name>Internal Release Repository</name>
<url>dav:http://reposerver.mycompany.com:8080/archiva/repository/internal/</url>
</repository>
<snapshotRepository>
<id>archiva.snapshots</id>
<name>Internal Snapshot Repository</name>
<url>dav:http://reposerver.mycompany.com:8080/archiva/repository/snapshots/</url>
</snapshotRepository>
</distributionManagement>
...
</project>
+-------------------------------------------------------------------------+
[[2]] Add a build extension to your <<<pom.xml>>>
+-------------------------------------------------------------------------+
<project>
...
<build>
<extensions>
<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-webdav</artifactId>
<version>1.0-beta-2</version>
</extension>
</extensions>
</build>
...
</project>
+-------------------------------------------------------------------------+
[[3]] Finally the user that is running archiva (tomcat-user, plexus-user,..) must have write access to the deployment repository.
* Deploying using other protocols
You can also deploy to the Archiva server using traditional means such as SCP, FTP, etc. For more information on these deployment
techniques, refer to the Maven documentation.
Note that once the files are deployed into the location of the Archiva managed repository, they will not be detected by Archiva until the
next scan takes place, so the interval should be configured to a reasonably frequent setting.
* Deploying Third-Party Artifacts to Archiva
[[1]] In the directory from which you intend to execute "<<<mvn
deploy:deploy-file>>>", save the following content as <<<pom.xml>>>.
+-------+
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>webdav-deploy</artifactId>
<packaging>pom</packaging>
<version>1</version>
<name>Webdav Deployment POM</name>
<build>
<extensions>
<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-webdav</artifactId>
<version>1.0-beta-2</version>
</extension>
</extensions>
</build>
</project>
+-------+
This pom will not be deployed with the artifact, it simply serves to make the
wagon-webdav jar available to the build process.
Alternately, save this file somewhere else, and use "<<<mvn ... -f
/path/to/filename>>>" to force the use of an alternate POM file.
[[2]] Deploy the artifact:
+------+
mvn deploy:deploy-file -Dfile=filename.jar -DpomFile=filename.pom
-DrepositoryId=archiva.internal
-Durl=dav:http://repo.mycompany.com:8080/repository/internal/
+------+
~~TODO: information for Maven 1, ant tasks, ivy, etc.
|