-
Notifications
You must be signed in to change notification settings - Fork 2
Maven GitHub
Note: For Maven, we're using Maven-AKSW instead of GitHub.
Currently, a manual download and installation of packages at GitHub is needed. That is described in the OPAL common README and Maven: Guide to installing 3rd party JARs.
Use the information in the GitHub article Creating a personal access token for the command line to create a token at GitHub settings: tokens. You need to set the read:packages
and write:packages
scopes. You can copy the token only one time, directly after generation.
Edit the file ~/.m2/settings.xml
and insert the code below.
Replace TOKEN with the data from the step above and replace also USERNAME with your GitHub username.
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
http://maven.apache.org/xsd/settings-1.0.0.xsd">
<activeProfiles>
<activeProfile>github</activeProfile>
</activeProfiles>
<profiles>
<profile>
<id>github</id>
<repositories>
<repository>
<id>central</id>
<url>https://repo1.maven.org/maven2</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
<repository>
<id>github-projekt-opal</id>
<name>GitHub projekt-opal Apache Maven Packages</name>
<url>https://maven.pkg.github.com/projekt-opal</url>
</repository>
</repositories>
</profile>
</profiles>
<servers>
<server>
<id>github-projekt-opal</id>
<username>USERNAME</username>
<password>TOKEN</password>
</server>
</servers>
</settings>
Edit the pom.xml
of your project. Replace REPOSITORY with the name of your GitHub repository.
<distributionManagement>
<repository>
<id>github-projekt-opal</id>
<name>GitHub projekt-opal Apache Maven Packages</name>
<url>https://maven.pkg.github.com/projekt-opal/REPOSITORY</url>
</repository>
</distributionManagement>
Now you should be able to execute mvn deploy
.