There are different ways on how you can deploy artifacts in an Archiva repository.
Starting with Archiva 1.2.3, it is possible to block re-deployment of released artifacts to a specific repository. This can be configured through the repository configuration page by ticking the Block Re-deployment of Released Artifacts checkbox.
WARNING The deployed artifact may not appear immediately in the search results. The execution of the index-content repository consumer and other scanning consumers are queued for execution to prevent concurrent updates to the index.
<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>
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>http://reposerver.mycompany.com:8080/archiva/repository/internal/</url> </repository> <snapshotRepository> <id>archiva.snapshots</id> <name>Internal Snapshot Repository</name> <url>http://reposerver.mycompany.com:8080/archiva/repository/snapshots/</url> </snapshotRepository> </distributionManagement> ... </project>
In some cases, you may want to use WebDAV to deploy instead of HTTP. If you find this is necessary, follow the same process as for HTTP, with these additional steps:
<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>
<project> ... <build> <extensions> <extension> <groupId>org.apache.maven.wagon</groupId> <artifactId>wagon-webdav</artifactId> <version>1.0-beta-2</version> </extension> </extensions> </build> ... </project>
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.
Once the files are deployed into the location of the Archiva managed repository, they should appear in the Browse page. The artifacts should also be searcheable as long as the index-content repository consumer is enabled.
You can use mvn deploy:deploy-file to deploy single artifacts to Archiva. Once you have the settings file in place as described above, you can deploy the artifact using this type of command:
mvn deploy:deploy-file -Dfile=filename.jar -DpomFile=filename.pom -DrepositoryId=archiva.internal -Durl=http://repo.mycompany.com:8080/repository/internal/
For more information, consult the documentation for the deploy:deploy-file goal
If you wish to use WebDAV to deploy the file, add dav: to the start of the URL as in the previous instructions.
However, on versions of Maven prior to 2.0.9, you will also need to create a file called pom.xml in the directory from which you intend to execute "mvn deploy:deploy-file":
<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 WebDAV protocol available to the build process.
Alternately, you can save this file somewhere else, and use "mvn ... -f /path/to/filename" to force the use of an alternate POM file.
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:
These are the files that will be in your repository after deployment:
Note: The maximum size of the file that can be uploaded is 10M by default. To alter the setting, change struts.multipart.maxSize in the file WEB-INF/classes/struts.properties in the Archiva web application (located under apps/archiva in the standalone distribution).
The upload form also provides validation checks against the required fields and the version. In Archiva 1.2.1, the version checking has been loosened. See MRM-1172 for more details.