Skip to content

Maven AKSW

Adrian Wilke edited this page Nov 29, 2019 · 8 revisions

Use artifacts

The URL for AKSW Maven repositories is https://maven.aksw.org/archiva/.

To use artifacts hosted there, you have to edit your pom.xml. For instance, if you want to use version 1.* of OPAL common:

<dependencies>
	<dependency>
		<groupId>org.dice-research.opal</groupId>
		<artifactId>common</artifactId>
		<version>[1,2)</version>
	</dependency>
</dependencies>

<repositories>
	<repository>
		<id>maven.aksw.internal</id>
		<name>AKSW Repository</name>
		<url>http://maven.aksw.org/archiva/repository/internal</url>
	</repository>
	<repository>
		<id>maven.aksw.snapshots</id>
		<name>AKSW Snapshot Repository</name>
		<url>http://maven.aksw.org/archiva/repository/snapshots</url>
	</repository>
</repositories>

Deploy artifacts

1. AKSW account

An AKSW account is required to deploy artifacts, see [LDAP].

2. Setup: Maven master password

Create a master password using mvn --encrypt-master-password.

Add the generated password in ~/.m2/settings-security.xml using the following format:

<settingsSecurity>
  <master>{myGeneratedMasterPassword}</master>
</settingsSecurity>

Source: [MVN]

3. Setup: Encrypted AKSK password

Encrypt your AKSW password using mvn --encrypt-password.

Add your login and encrypted password tp ~/.m2/settings.xml using the following format:

<servers>
	<server>
		<id>maven.aksw.internal</id>
		<username>{myAkswLogin}</username>
		<password>{myEnkryptedAkswPassword}</password>
	</server>
	<server>
		<id>maven.aksw.snapshots</id>
		<username>{myAkswLogin}</username>
		<password>{myEnkryptedAkswPassword}</password>
	</server>
</servers>

Source: [MVN],[AKSW]

4. Project configuration

Add the following information to your pom.xml

<distributionManagement>
	<repository>
		<id>maven.aksw.internal</id>
		<name>AKSW Repository</name>
		<url>http://maven.aksw.org/archiva/repository/internal</url>
	</repository>
	<snapshotRepository>
		<id>maven.aksw.snapshots</id>
		<name>AKSW Snapshot Repository</name>
		<url>http://maven.aksw.org/archiva/repository/snapshots</url>
	</snapshotRepository>
</distributionManagement>

Source: [AKSW]

5. Deployment:

Use the following script deploy-project.sh to deploy your component:

#!/bin/bash

#check whether all parameters are there
if test $# -ge 1
then
  #store the current directory and change to the jar directory
  pushd $1
  mvn clean package deploy -DaltDeploymentRepository=maven.aksw.internal::default::http://maven.aksw.org/repository/internal $2
  #restore the current directory
  popd
  #check the status of the last command (mvn ...)
  if [ $? != 0 ] 
  then
    pause
  fi
else
  echo "ERROR! Missing arguments. usage: mvn_deploy_cmd <path_to_project_folder> [mvn-arguments]"
fi

Deployment without tests

Use the file deploy-project-without-testing.sh [MR]:

#!/bin/bash
#check whether all parameters are there
if test $# -ge 1
then
  ./deploy-project.sh $1 -DskipTests
else
  echo "ERROR! Missing arguments. usage: mvn_deploy_cmd <path_to_project_folder> [mvn-arguments]"
fi

Source: [MR]

References