Commit 90e44805 authored by Can's avatar Can
Browse files

Änderungen

parent d8949da8
Pipeline #9150 passed with stage
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="optional" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
<attribute name="optional" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>
/target/
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>dtabackend</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
</natures>
</projectDescription>
eclipse.preferences.version=1
encoding//src/main/java=UTF-8
encoding//src/main/resources=UTF-8
encoding//src/test/java=UTF-8
encoding/<project>=UTF-8
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.methodParameters=generate
org.eclipse.jdt.core.compiler.codegen.targetPlatform=17
org.eclipse.jdt.core.compiler.compliance=17
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
org.eclipse.jdt.core.compiler.release=enabled
org.eclipse.jdt.core.compiler.source=17
# base image to build a JRE # base image to build a JRE
FROM eclipse-temurin:21-jdk-alpine as corretto-jdk FROM arm64v8/eclipse-temurin:21-jdk-alpine as corretto-jdk
# required for strip-debug to work # required for strip-debug to work
RUN apk add --no-cache binutils RUN apk add --no-cache binutils
......
646164dfd46b4f94e30cd14b296e5244
\ No newline at end of file
91d8411af99e6c661791558ac9018a35ea7f1b47
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>de.hftstuttgart</groupId>
<artifactId>unified-ticketing</artifactId>
<version>${buildNumber}</version>
<properties>
<buildNumber>devel</buildNumber>
<java.version>11</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<profiles>
<profile>
<id>ci</id>
<activation>
<property><name>env.BUILD_NUMBER</name></property>
</activation>
<properties>
<buildNumber>${env.BUILD_NUMBER}</buildNumber>
</properties>
</profile>
</profiles>
<dependencies>
<!-- https://mvnrepository.com/artifact/com.squareup.okhttp3/okhttp -->
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>4.9.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.11.3</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.7.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.7.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>3.6.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-junit-jupiter</artifactId>
<version>3.6.0</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>17</source>
<target>17</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.21.0</version>
<dependencies>
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-surefire-provider</artifactId>
<version>1.3.2</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>gitlab-maven</id>
<url>https://transfer.hft-stuttgart.de/gitlab/api/v4/projects/${env.CI_PROJECT_ID}/packages/maven</url>
</repository>
</repositories>
<distributionManagement>
<repository>
<id>gitlab-maven</id>
<url>https://transfer.hft-stuttgart.de/gitlab/api/v4/projects/${env.CI_PROJECT_ID}/packages/maven</url>
</repository>
<snapshotRepository>
<id>gitlab-maven</id>
<url>https://transfer.hft-stuttgart.de/gitlab/api/v4/projects/${env.CI_PROJECT_ID}/packages/maven</url>
</snapshotRepository>
</distributionManagement>
</project>
045b5e86f4b266d12d16865d58be9831
\ No newline at end of file
4c48af52875080d02f54ec804e2031eb1357c32b
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<metadata>
<groupId>de.hftstuttgart</groupId>
<artifactId>unified-ticketing</artifactId>
<versioning>
<release>0.2.2</release>
<versions>
<version>0.2.2</version>
</versions>
<lastUpdated>20240314141547</lastUpdated>
</versioning>
</metadata>
c09bc237f3ccf25b2300964f062be9d3
\ No newline at end of file
e64ca2844b74f031f6debd85c4d31d18f2706e2a
\ No newline at end of file
...@@ -162,6 +162,12 @@ ...@@ -162,6 +162,12 @@
<artifactId>okhttp</artifactId> <artifactId>okhttp</artifactId>
<version>4.11.0</version> <version>4.11.0</version>
</dependency> </dependency>
<!-- https://mvnrepository.com/artifact/org.tmatesoft.svnkit/svnkit -->
<dependency>
<groupId>org.tmatesoft.svnkit</groupId>
<artifactId>svnkit</artifactId>
<version>1.10.11</version>
</dependency>
</dependencies> </dependencies>
......
...@@ -8,6 +8,12 @@ import org.eclipse.jgit.api.errors.GitAPIException; ...@@ -8,6 +8,12 @@ import org.eclipse.jgit.api.errors.GitAPIException;
import org.eclipse.jgit.transport.UsernamePasswordCredentialsProvider; import org.eclipse.jgit.transport.UsernamePasswordCredentialsProvider;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.util.FileSystemUtils; import org.springframework.util.FileSystemUtils;
import org.tmatesoft.svn.core.SVNException;
import org.tmatesoft.svn.core.SVNURL;
import org.tmatesoft.svn.core.auth.BasicAuthenticationManager;
import org.tmatesoft.svn.core.wc2.SvnCheckout;
import org.tmatesoft.svn.core.wc2.SvnOperationFactory;
import org.tmatesoft.svn.core.wc2.SvnTarget;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
...@@ -42,19 +48,42 @@ public class JGitUtil { ...@@ -42,19 +48,42 @@ public class JGitUtil {
} }
try { try {
LOG.debug("preparing clone"); LOG.debug("preparing clone");
CloneCommand cloneCommand = Git.cloneRepository()
.setDirectory(checkoutDirectory)
.setURI(config.group(1));
if (!config.group(2).equals("none") && !config.group(3).equals("none")) { if (config.group(1).endsWith(".git")) {
LOG.debug("setting credentials"); CloneCommand cloneCommand = Git.cloneRepository()
cloneCommand.setCredentialsProvider(new UsernamePasswordCredentialsProvider(config.group(2), config.group(3))); .setDirectory(checkoutDirectory)
} .setURI(config.group(1));
if (!config.group(2).equals("none") && !config.group(3).equals("none")) {
LOG.debug("setting credentials");
cloneCommand.setCredentialsProvider(new UsernamePasswordCredentialsProvider(config.group(2), config.group(3)));
}
LOG.debug("cloning...");
cloneCommand.call().close();
}
else {
SVNURL svnUrl = SVNURL.parseURIDecoded(config.group(1));
final SvnOperationFactory svnOperationFactory = new SvnOperationFactory();
try {
final SvnCheckout checkout = svnOperationFactory.createCheckout();
checkout.setSingleTarget(SvnTarget.fromFile(checkoutDirectory));
checkout.setSource(SvnTarget.fromURL(svnUrl));
if (!config.group(2).equals("none") && !config.group(3).equals("none")) {
LOG.debug("Setting credentials");
svnOperationFactory.setAuthenticationManager(new BasicAuthenticationManager(config.group(2), config.group(3)));
}
checkout.run();
LOG.debug("SVN checkout completed successfully.");
} finally {
svnOperationFactory.dispose();
}
}
LOG.debug("cloning...");
cloneCommand.call().close();
//if an optional directory parameter was given //if an optional directory parameter was given
if(subDir!="") if(subDir!="")
{ {
...@@ -69,5 +98,8 @@ public class JGitUtil { ...@@ -69,5 +98,8 @@ public class JGitUtil {
catch (GitAPIException e) { catch (GitAPIException e) {
LOG.error(String.format("Error while cloning from %s: could not read from Git", config.group(1)), e); LOG.error(String.format("Error while cloning from %s: could not read from Git", config.group(1)), e);
} }
catch (SVNException e) {
LOG.error(String.format("Error while cloning from %s: could not read from Svn", config.group(1)), e);
}
} }
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment