Deploying Java Artifacts

For deploying Java artifacts, you need a place to store the artifacts. Naturally, it is recommended to use a Maven repository, however it is possible to point Maven to a local filesystem as a repository, mainly for testing things out. The configuration needs to go in your $M2_HOME/settings.xml file. A minimal example that stores the deployed artifacts in /tmp could be the following:

<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.1.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd">
  <profiles>
    <profile>
      <id>no-repository</id>
      <properties>
        <distributionManagementURL.release>file:///tmp/</distributionManagementURL.release>
        <distributionManagementURL.snapshot>file:///tmp/</distributionManagementURL.snapshot>
        <project.distributionManagement.repository.url>file:///tmp/</project.distributionManagement.repository.url>
        <project.distributionManagement.snapshotRepository.url>file:///tmp/</project.distributionManagement.snapshotRepository.url>
      </properties>
    </profile>
  </profiles>
  <activeProfiles>
    <activeProfile>no-repository</activeProfile>
  </activeProfiles>
</settings>

In your module you should compile/install as usual and execute:

make clean all install
make deploy


The command deploy would call Maven on all JARFILES and COMPONENTS_JARFILES defined in the Makefile, and end up deploying them in the configured repositories (/tmp in this case).

Currently at ALMA we're using an internal repository based on JFrog Artifactory for Java artifacts, which has a free community version.

There are some environment variables which help with the Maven deployment of artifacts:

Other adjustments can be made through the settings.xml like triggering different profiles (release, testing, development). In our case we have the following variables to enable/disable profiles:

These last two variables aren't defined anywhere in ACS and are rather used for convenience in the settings.xml file in your $M2_HOME.

Deploying Python Packages

For deploying Python packages, you need a repository, and as far as we've seen it's not trivial to use a local file system for testing. Here you need a .pypirc file in your home. A minimal example would be:

[distutils]
index-servers =
    pypi
    testpypi
    develop

[pypi]
repository = https://upload.pypi.org/legacy/

[testpypi]
repository = https://test.pypi.org/legacy/

[develop]
repository = https://<some_url>/develop/
username = <user>
password = <pass>

Then you would go to your component module as usual and execute:

make clean all install
make deploy


The command deploy would call setup.py and twine on all PY_MODULES and PY_PACKAGES. And end up deploying them in the configured repositories.

Currently at ALMA we're using an internal repository based on pypiserver, which is freely available at official PyPI, and you can find a Docker image in DockerHub.

There are some environment variables which help with the Python deployment of packages: