Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: migration from BitBucket to GitHub #3

Merged
merged 4 commits into from
May 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 0 additions & 24 deletions .github/workflows/maven-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,6 @@ jobs:
"enabled": "true",
"updatePolicy": "never"
}
},
{
"id": "repsy",
"name": "repsy.io",
"url": "https://repo.repsy.io/mvn/sbb/polarion",
"releases": {
"enabled": "true",
"updatePolicy": "never"
}
}
]
profiles: >
Expand All @@ -48,13 +39,6 @@ jobs:
{
"altDeploymentRepository": "github::default::https://maven.pkg.github.com/SchweizerischeBundesbahnen/ch.sbb.polarion.extension.extension-name"
}
},
{
"id": "repsyDeploy",
"properties":
{
"altDeploymentRepository": "repsy::default::https://repo.repsy.io/mvn/sbb/polarion"
}
}
]
servers: >
Expand All @@ -68,11 +52,6 @@ jobs:
"id": "github",
"username": "${env.GITHUB_ACTOR}",
"password": "${env.GITHUB_TOKEN}"
},
{
"id": "repsy",
"username": "${{ secrets.CH_SBB_POLARION_REPSY_USERNAME }}",
"password": "${{ secrets.CH_SBB_POLARION_REPSY_PASSWORD }}"
}
]
- name: Print settings.xml
Expand All @@ -83,9 +62,6 @@ jobs:
id: artefact_version
run: echo "version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)"
>> $GITHUB_OUTPUT
- name: Publish to repsy.io
if: ${{ !endsWith(steps.artefact_version.outputs.version, '-SNAPSHOT') }}
run: mvn --batch-mode deploy -PrepsyDeploy
- name: Publish to GitHub Packages
if: ${{ !endsWith(steps.artefact_version.outputs.version, '-SNAPSHOT') }}
run: mvn --batch-mode deploy -PgithubDeploy
Expand Down
260 changes: 248 additions & 12 deletions README.md

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions lombok.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# tells Lombok that this is the root directory and that it shouldn’t search parent directories for more configuration files
config.stopBubbling = true
# tells Lombok to add @lombok.Generated annotation to all generated methods
lombok.addLombokGeneratedAnnotation = true
169 changes: 164 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,32 @@
<parent>
<groupId>ch.sbb.polarion.extensions</groupId>
<artifactId>ch.sbb.polarion.extension.generic.parent-pom</artifactId>
<version>2.0.0</version>
<version>4.9.1</version>
</parent>

<artifactId>ch.sbb.polarion.extension.extension-name</artifactId>
<version>0.0.0-SNAPSHOT</version>
<artifactId>ch.sbb.polarion.extension.pdf-exporter</artifactId>
<version>5.0.2-SNAPSHOT</version>
<packaging>jar</packaging>

<properties>
<maven-jar-plugin.Extension-Context>extension-name</maven-jar-plugin.Extension-Context>
<maven-jar-plugin.Automatic-Module-Name>ch.sbb.polarion.extension.extension_name</maven-jar-plugin.Automatic-Module-Name>
<pdfbox.version>3.0.2</pdfbox.version>
<okapi.xliff.version>1.46.0</okapi.xliff.version>

<slf4j.version>1.7.36</slf4j.version>
<testcontainers.version>1.19.8</testcontainers.version>
<javax.transaction-api.version>1.3</javax.transaction-api.version>
<byte-buddy.version>1.14.17</byte-buddy.version>

<exec-maven-plugin.version>3.3.0</exec-maven-plugin.version>
<weasyprint.version>61.2</weasyprint.version>
<awaitility.version>4.2.1</awaitility.version>

<maven-jar-plugin.Extension-Context>pdf-exporter</maven-jar-plugin.Extension-Context>
<maven-jar-plugin.Automatic-Module-Name>ch.sbb.polarion.extension.pdf_exporter</maven-jar-plugin.Automatic-Module-Name>
<web.app.name>${maven-jar-plugin.Extension-Context}</web.app.name>

<!--suppress UnresolvedMavenProperty -->
<maven-surefire-plugin.wpCommand>${HOME}/.local/bin/weasyprint</maven-surefire-plugin.wpCommand>
</properties>

<dependencies>
Expand All @@ -25,6 +39,81 @@
<artifactId>ch.sbb.polarion.extension.generic.app</artifactId>
<version>${project.parent.version}</version>
</dependency>

<dependency>
<groupId>com.polarion.thirdparty</groupId>
<artifactId>velocity-engine-core-2.3</artifactId>
<version>${polarion.version}</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>com.polarion.alm.wiki</groupId>
<artifactId>sidecar</artifactId>
<version>${polarion.version}</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>2.2</version>
<scope>provided</scope>
</dependency>


<dependency>
<groupId>org.apache.pdfbox</groupId>
<artifactId>pdfbox</artifactId>
<version>${pdfbox.version}</version>
<exclusions> <!-- pdfbox 3.0.0 has scope test for junit, pdfbox 3.0.1 has no such scope, that's why this exclusion has been added -->
<exclusion>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>net.sf.okapi.lib</groupId>
<artifactId>okapi-lib-xliff2</artifactId>
<version>${okapi.xliff.version}</version>
</dependency>
<dependency>
<groupId>net.bytebuddy</groupId>
<artifactId>byte-buddy</artifactId>
<version>${byte-buddy.version}</version>
</dependency>

<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>${slf4j.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>testcontainers</artifactId>
<version>${testcontainers.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.transaction</groupId>
<artifactId>javax.transaction-api</artifactId>
<version>${javax.transaction-api.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.awaitility</groupId>
<artifactId>awaitility</artifactId>
<version>${awaitility.version}</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
Expand All @@ -37,6 +126,21 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<id>external-delivery</id>
<goals>
<goal>jar</goal>
</goals>
<phase>package</phase>
<configuration>
<classifier>external</classifier>
<excludes>
<exclude>default/cover-page/EuroSpec/**</exclude>
</excludes>
</configuration>
</execution>
</executions>
</plugin>

<plugin>
Expand All @@ -48,6 +152,61 @@
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
</plugin>

</plugins>
</build>

<profiles>
<profile>
<id>install-weasyprint</id>

<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>${exec-maven-plugin.version}</version>
<executions>
<execution>
<id>pip-install</id>
<phase>generate-resources</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>pip</executable>
<arguments>
<argument>install</argument>
<argument>weasyprint==${weasyprint.version}</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>

<profile>
<id>tests-with-weasyprint-cli</id>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven-surefire-plugin.version}</version>
<configuration>
<!-- hide unwanted exceptions logging -->
<redirectTestOutputToFile>true</redirectTestOutputToFile>
<systemPropertyVariables>
<wpExporterImpl>command</wpExporterImpl>
<wpCommand>${maven-surefire-plugin.wpCommand}</wpCommand>
</systemPropertyVariables>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package ch.sbb.polarion.extension.pdf.exporter;

import lombok.AllArgsConstructor;
import lombok.Getter;

@AllArgsConstructor
@Getter
public class PdfExportException extends RuntimeException {

private final String command;
private final int exitStatus;
private final byte[] out;
private final byte[] err;

@Override
public String getMessage() {
return "Process (" + this.command + ") exited with status code " + this.exitStatus + ":" + System.lineSeparator() + new String(err);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package ch.sbb.polarion.extension.pdf.exporter;

import ch.sbb.polarion.extension.generic.GenericUiServlet;
import ch.sbb.polarion.extension.generic.properties.CurrentExtensionConfiguration;
import ch.sbb.polarion.extension.pdf.exporter.properties.PdfExporterExtensionConfiguration;

import java.io.Serial;

public class PdfExporterAdminUiServlet extends GenericUiServlet {

@Serial
private static final long serialVersionUID = -6337912330074718317L;

public PdfExporterAdminUiServlet() {
super("pdf-exporter-admin");
CurrentExtensionConfiguration.getInstance().setExtensionConfiguration(PdfExporterExtensionConfiguration.getInstance());
}
}
Loading
Loading