Question

How can I setup and fill my Apache Archiva repository with CQ5 artifacts in order to use it as a maven repository source for development, instead of using Day maven repository (repo.adobe.com is not officially supported) ?

Answer, Resolution

Apache Archiva is a repository management software that allows you to deploy your maven
bundles to the repository. It also allows you to cache bundles from external repositories so your
developers will stay on your network rather than going to external sources for artifacts. The goal of this article is to describe a process that deploys CQ available artifacts into Archiva.

 

Install Archiva :

Configure Archiva :

  • Open your browser to the Archiva installation (http://<IP of your Archiva server>:8080/archiva)
  • The first time you startup Archiva it will ask you to create a username/password for the
    admin account. Go ahead and do that.
  • Create a deployment user, for example "deployer". This user will need the Role 'Repository Manager'.
  • Note : Take care to operate a first login with this new user, a password change will be asked at this moment. Unless you do that first, the Maven deploy commands issued with this user will fail.

Setup the Maven settings.xml file :

  • In your .m2/settings.xml add the following lines to define your Archiva Repository and the login/password Maven will use to deploy the Artifacts

<profile>
        <id>day-central</id>
        <activation>
            <activeByDefault>true</activeByDefault>
        </activation>
        <repositories>
          <repository>
            <id>internal</id>
            <name>My Company Archiva Repository</name>
            <url>http://<IP of your Archiva server>:8080/archiva/repository/internal</url>
            <layout>default</layout>
          </repository>
        </repositories>
        <pluginRepositories>
          <pluginRepository>
            <id>internal</id>
            <name>My Company Archiva Repository</name>
            <url>http://<IP of your Archiva server>:8080/archiva/repository/internal</url>
            <layout>default</layout>
          </pluginRepository>
        </pluginRepositories>
    </profile>
  </profiles>
 
  <servers>
      <server>
          <id>internal</id>
          <username>deployer</username>
          <password>deployer_pwd</password>
      </server>
  </servers>

 

 

Get CQ available libraries from a running instance :

Generate the Maven deploy commands that matches the CQ available artifacts :

To do this, run the attached Jar file with the following parameters :

  1. Remote repo URL
  2. Remote repo Id
  3. Directory where you just dowloaded the CQ libraries

Example : java -jar generateMavenDeployCommands.jar http://localhost:8080/archiva/repository/internal internal C:\cq53Jars

 

Last ned

 

3 files are generated in the directory of the Jar :

  1. deployMavenArtifact.sh

    Shellscript for MacOs + Linux that contains the mvn:deploy commands.
  2. deployMavenArtifact.bat

    Windows Bat script that contains the same deploy instructions, preceded by the call commands.

  3. dependenciesSnippet.xml

    Contains the list of all found artifacts in the form of a dependency list that you can partially integrate to your project pom file.

Applies to

CQ 5.3+

Dette produktet er lisensiert i henhold til Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License  Innlegg på Twitter™ og Facebook dekkes ikke av Creative Commons-vilkår.

Juridiske merknader   |   Regler for personvern på nettet