Skip to content

Commit

Permalink
2.1.0 - Unirest 4.0 (#42)
Browse files Browse the repository at this point in the history
* Switching to Unirest 4
 * WIP

* JiraInstanceManagerRestSpec.groovy
 * Fixed minor bug

* Use java.nio instead groovy internal classes to resolve paths

* Create gh actions ci

* Working on solving shading and pom issues

* Merged Jonis licence/pom changes

* Buggfixes

* Updated README.md
Split up github action so that the two jars are build as separate steps for clarity

---------

Co-authored-by: Joni Lahtinen <[email protected]>
  • Loading branch information
farthinder and jlahtinen committed Jan 16, 2024
1 parent 14af34b commit 76d8699
Show file tree
Hide file tree
Showing 20 changed files with 319 additions and 301 deletions.
16 changes: 16 additions & 0 deletions .github/buildResources/createStandalonePom.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

/**
* Creates a new pom-standalone.xml based on pom.xml but with new artifact (jirainstancemanager-standalone) name and
* additional build steps for shading based on shadingConf.xml
*/
String projectBasePath = project.basedir
File origPom = new File(projectBasePath + "/pom.xml")
File shadingConf = new File(projectBasePath + "/.github/buildResources/shadingConf.xml")

String newPomBody = origPom.text.replace("<plugins>", "<plugins>\n" + shadingConf.text)

newPomBody = newPomBody.replaceFirst("<artifactId>jirainstancemanager<\\/artifactId>", "<artifactId>jirainstancemanager-standalone<\\/artifactId>")

File standalonePom = new File(projectBasePath + "/pom-standalone.xml")
standalonePom.createNewFile()
standalonePom.text = newPomBody
14 changes: 14 additions & 0 deletions .github/buildResources/secret_licenses/decrypt_licenses.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/sh

set -e

DIR="$( cd "$( dirname "$0" )" && pwd )"


mkdir -p $HOME/.licenses/jira
# --batch to prevent interactive command
# --yes to assume "yes" for questions
gpg --quiet --batch --yes --decrypt --passphrase="$LICENSE_PASSWORD" \
--output $HOME/.licenses/jira/jsm.license $DIR/jsm.license.gpg
gpg --quiet --batch --yes --decrypt --passphrase="$LICENSE_PASSWORD" \
--output $HOME/.licenses/jira/sr.license $DIR/sr.license.gpg
Binary file not shown.
4 changes: 4 additions & 0 deletions .github/buildResources/secret_licenses/sr.license.gpg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
� ⻵�ya�E�����
b�&*��!�w�G�9�K��͊�I����g�W������+��'��lh��� I����;M1�-s4�M���5��_������#��5���w��@]b� �puW虸$������ ���4���=���o���F��sJ<˼�7f��R�*L>�ǀ����k�5%�/��8wgE�B�|R5ܲ�8C�*�k��ę}&w�����������YΉr�Dᬪ�
�HT����+?�%'���*�H��g�Cqki'^�.��{�?�[C�FXz� C�����4�T�=��S@�������?�+�M��Ĺ\ 8m���|yT^�jT9ae�tR�����b�h��e��(���R���� �C��=�d� �A�F�iW��D�Q��9�K�D�o�3�����WB�٣d��5���]������j9�u_xRj̴���3N���_o�������xd`����I�dRX��'u�CX�T�d�~BB�٣����n���fr�B2�� ��qW���;��/ ���0n��|
�bV�5�� n��-S~~�*r�bְih��\hO>�B#R,;�r���H�z�1����nʟ�xIU�
Expand Down
77 changes: 77 additions & 0 deletions .github/buildResources/shadingConf.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<plugin>
<!-- Configured in pluginManagement instead of plugins, because we do not want a shaded parent POM -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.5.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.GroovyResourceTransformer">
<extModuleName>the-aggregated-module</extModuleName>
<extModuleVersion>1.0.0</extModuleVersion>
</transformer>
</transformers>
<!-- Will output 2 jars: the original, and the shaded one -->
<shadedArtifactAttached>false</shadedArtifactAttached>

<!-- final name of the shaded jar will be ${project.artifactId}-standalone -->
<!--shadedClassifierName>standalone</shadedClassifierName-->

<filters>

<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
<!--exclude>META-INF/groovy/*</exclude-->

</excludes>
</filter>
</filters>

<artifactSet>
<!--excludes>
<exclude>org.codehaus.groovy:groovy</exclude>
</excludes-->
<excludes>
<exclude>org.junit.jupiter:*</exclude>
<exclude>org.codehaus.groovy:*</exclude>
<exclude>org.junit:*</exclude>
<exclude>junit:*</exclude>
</excludes>

</artifactSet>
<relocations>
<relocation>
<pattern>unirest</pattern>
<shadedPattern>com.eficode.shaded.unirest</shadedPattern>
</relocation>
<relocation>
<pattern>kong</pattern>
<shadedPattern>com.eficode.shaded.kong</shadedPattern>
</relocation>
<relocation>
<pattern>org.apache.commons</pattern>
<shadedPattern>com.eficode.shaded.org.apache.commons</shadedPattern>
</relocation>
</relocations>

<!-- NOTE: Any dependencies of the project will not show up in the standalone pom.
This means that if those dependencies are not properly relocated and there is a class-loading conflict,
user would not be able to figure out where the conflicting dependency is. -->
<createDependencyReducedPom>true</createDependencyReducedPom>

<createSourcesJar>true</createSourcesJar>


</configuration>
</execution>
</executions>
</plugin>
28 changes: 24 additions & 4 deletions .github/workflows/maven-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,34 @@ jobs:
restore-keys: |
${{ runner.os }}-maven-
- name: Compile and install locally
- name: decrypt licenses
run: .github/buildResources/secret_licenses/decrypt_licenses.sh
env:
LICENSE_PASSWORD: ${{secrets.LICENSE_PASSWORD}}


- name: Compile and install main version
run: |
mkdir -p repository/com/eficode/atlassian/jirainstancemanager/
echo Building and installing "normal" version
mvn install -f pom.xml -DcreateChecksum=true
- name: Compile and install standalone version
run: |
mvn help:effective-pom -P groovy-3 -Doutput=effective-pom.xml
mvn install -f effective-pom.xml -DcreateChecksum=true
mkdir -p repository/com/eficode/atlassian/jirainstancemanager-standalone/
echo Creating pom for standalone version and installing
mvn gplus:execute@execute
echo Building and installing "standalone" version
mvn install -f pom-standalone.xml -DcreateChecksum=true
- name: Copying JAR files
run: |
echo Copying the new JAR files to repository which will be added to git branch "packages"
rsync -avh --checksum ~/.m2/repository/com/eficode/atlassian/jirainstancemanager/ repository/com/eficode/atlassian/jirainstancemanager/
rsync -avh --checksum ~/.m2/repository/com/eficode/atlassian/jirainstancemanager-standalone/ repository/com/eficode/atlassian/jirainstancemanager-standalone/
- name: Committing and pushing JAR files
run: |
Expand All @@ -71,4 +86,9 @@ jobs:
echo Committing changes
git commit -m "Updated packages to $VERSION"
echo Pushing changes
git push
git push
# Optional: Uploads the full dependency graph to GitHub to improve the quality of Dependabot alerts this repository can receive
- name: Update dependency graph
uses: advanced-security/maven-dependency-submission-action@571e99aab1055c2e71a1e2309b9691de18d6b7d6
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ Jira Instance Manager Rest (JR) is a Groovy library which can perform several ad

## Breaking Changes

* 2.1.0
* Switching to Unirest 4 might break some things if you depend on JIM supplying v4
* See https://github.com/Kong/unirest-java/blob/main/UPGRADE_GUIDE.md for Unirest breaking changes
* Due to problems with shading the standalone version is now released as a separate artifact "jirainstancemanager-standalone"
* The classifier standalone is no longer used

* 1.1.0:
* Almost all static methods in JiraInstanceManagerRest have been removed in order to better facilitate working with multiple JIRA instances and in cooperation with other libraries using Unirest library.
* Fixing the unfortunate spelling mistake "JiraInstanceManagrRest" in favor for "JiraInstanceManagerRest"
Expand Down
Loading

0 comments on commit 76d8699

Please sign in to comment.