This small repository contains examples on how to use a code differencing tool GumTreeDiff (GTD
) from Java source code through APIs.
Folder gumtreediff-api-examples-maven
contains a sample maven
project that runs API use examples.
SDK version 11+ (these projects are developed with java-11-openjdk-amd64
).
These projects are built with maven
version 3.6.3.
Before building and running any of the projects for the first time please configure the maven
workflow for GTD
:
Step 0
If you do not yet have a GitHub account, register there.
Step 1
Go to your account and generate a personal access token (if you already have it, make sure it has all necessary permissions - see below):
-
Follow the instructions here
-
In step 6 of the above instructions set the token name to
github-GTD
or any other of your choice -
In step 7 of the above instructions set at least the following permissions:
repo
,read:packages
Step 2
Configure maven
to authenticate GithubPackages as a valid package source:
-
Full instructions are available here, section Authenticating to GitHub Packages/Authenticating with a personal access token, but the relevant steps are:
-
Create or edit the
~/.m2/settings.xml
from the template provided in the above instructions -
Update
repository
andserver
sections of thesettings.xml
to the following values:
<repository>
<id>github</id>
<name>GitHub GumTreeDiff Apache Maven Packages</name>
<url>https://maven.pkg.github.com/gumtreediff/gumtree</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
<server>
<id>github</id>
<username>HERE_YOUR_GITHUB_USERNAME</username>
<password>HERE_YOUR_GITHUB_PERSONAL_ACCESS_TOKEN</password>
</server>
The projects are developed in IntelliJ IDEA 2020.3.3 (Community Edition), so there are various build and run configurations available for each project in respective gumtreediff-examples/PROJECTNAME/.idea/runConfigurations/
folders.