summaryrefslogtreecommitdiff
path: root/eaaf_modules/eaaf_module_moa-sig/src/test
diff options
context:
space:
mode:
authorThomas Lenz <thomas.lenz@egiz.gv.at>2019-12-04 19:43:32 +0100
committerThomas Lenz <thomas.lenz@egiz.gv.at>2019-12-04 19:43:32 +0100
commit759ac5f42c6aff901dbeede4fbf1a1d2e08cad0f (patch)
tree2132024fc058b1ef5338bf50df575a3244cc3f9f /eaaf_modules/eaaf_module_moa-sig/src/test
parent4f15bdc45b08724d20c66c9fd74ea6a43a03c32f (diff)
downloadEAAF-Components-759ac5f42c6aff901dbeede4fbf1a1d2e08cad0f.tar.gz
EAAF-Components-759ac5f42c6aff901dbeede4fbf1a1d2e08cad0f.tar.bz2
EAAF-Components-759ac5f42c6aff901dbeede4fbf1a1d2e08cad0f.zip
common EGIZ code-style refactoring
Diffstat (limited to 'eaaf_modules/eaaf_module_moa-sig/src/test')
-rw-r--r--eaaf_modules/eaaf_module_moa-sig/src/test/java/artifacts/MavenArtifactInstaller.java109
1 files changed, 60 insertions, 49 deletions
diff --git a/eaaf_modules/eaaf_module_moa-sig/src/test/java/artifacts/MavenArtifactInstaller.java b/eaaf_modules/eaaf_module_moa-sig/src/test/java/artifacts/MavenArtifactInstaller.java
index 7b9e2748..11c84ec0 100644
--- a/eaaf_modules/eaaf_module_moa-sig/src/test/java/artifacts/MavenArtifactInstaller.java
+++ b/eaaf_modules/eaaf_module_moa-sig/src/test/java/artifacts/MavenArtifactInstaller.java
@@ -6,54 +6,65 @@ import java.text.MessageFormat;
public class MavenArtifactInstaller {
- public static final String MVN_INSTALL_PATH = "F:\\local_work\\program\\apache-maven-3.5.2-bin\\bin\\";
- public static final String CONFIG = "/settings.xml";
- public static final String REPO_SCAN_PATH = "/repository/iaik/prod";
-
- public static final String GROUP = "iaik.prod";
- public static final String PACKAGE = "jar";
- public static final String COMMAND_TEMPLATE = "{6}mvn.cmd install:install-file -s {0} -DgroupId={1} -DartifactId={2} -Dversion={3} -Dpackaging={4} -Dfile={5}";
-
- public static void main(String[] args) {
- String currentLocation = new java.io.File( "." ).toURI().toString();
- currentLocation = currentLocation.substring("file:/".length(), currentLocation.length() - 2);
- final String settingLocation = currentLocation + CONFIG;
- final File settingsFile = new File(settingLocation);
- if (!settingsFile.exists()) {
- System.out.println("Maven settings does not exist");
- System.exit(-1);
-
- }
-
- final String pathToScan = currentLocation + REPO_SCAN_PATH;
-
- final File toScan = new File(pathToScan);
-
- int counter=0;
- for (final File dir : toScan.listFiles()) {
- final String artifactName = dir.getName();
- for (final File version : dir.listFiles()) {
- final String libVersion = version.getName();
- final String jarPath = version.getAbsolutePath() + "/" + artifactName + "-" + libVersion + ".jar";
- final File jar = new File(jarPath );
- if (jar.exists()) {
- final String mvnCommand = MessageFormat.format(COMMAND_TEMPLATE, settingsFile.getAbsoluteFile(), GROUP, artifactName, libVersion, PACKAGE, jar.getAbsolutePath(), MVN_INSTALL_PATH);
- System.out.println("Execute: " + mvnCommand);
- try {
- Runtime.getRuntime().exec(mvnCommand);
- counter++;
- } catch (final IOException e) {
- e.printStackTrace();
-
- }
-
- } else
- System.out.print("Can NOT find jar with path: " + jarPath);
-
- }
-
- }
- System.out.println("Install #" + counter + " maven artifacts");
- }
+ public static final String MVN_INSTALL_PATH =
+ "F:\\local_work\\program\\apache-maven-3.5.2-bin\\bin\\";
+ public static final String CONFIG = "/settings.xml";
+ public static final String REPO_SCAN_PATH = "/repository/iaik/prod";
+
+ public static final String GROUP = "iaik.prod";
+ public static final String PACKAGE = "jar";
+ public static final String COMMAND_TEMPLATE =
+ "{6}mvn.cmd install:install-file -s {0} -DgroupId={1} -DartifactId={2} -Dversion={3} -Dpackaging={4} -Dfile={5}";
+
+ /**
+ * Only for test-deployment of maven artifacts.
+ *
+ * @param args System parameters
+ */
+ public static void main(final String[] args) {
+ String currentLocation = new java.io.File(".").toURI().toString();
+ currentLocation = currentLocation.substring("file:/".length(), currentLocation.length() - 2);
+ final String settingLocation = currentLocation + CONFIG;
+ final File settingsFile = new File(settingLocation);
+ if (!settingsFile.exists()) {
+ System.out.println("Maven settings does not exist");
+ System.exit(-1);
+
+ }
+
+ final String pathToScan = currentLocation + REPO_SCAN_PATH;
+
+ final File toScan = new File(pathToScan);
+
+ int counter = 0;
+ for (final File dir : toScan.listFiles()) {
+ final String artifactName = dir.getName();
+ for (final File version : dir.listFiles()) {
+ final String libVersion = version.getName();
+ final String jarPath =
+ version.getAbsolutePath() + "/" + artifactName + "-" + libVersion + ".jar";
+ final File jar = new File(jarPath);
+ if (jar.exists()) {
+ final String mvnCommand =
+ MessageFormat.format(COMMAND_TEMPLATE, settingsFile.getAbsoluteFile(), GROUP,
+ artifactName, libVersion, PACKAGE, jar.getAbsolutePath(), MVN_INSTALL_PATH);
+ System.out.println("Execute: " + mvnCommand);
+ try {
+ Runtime.getRuntime().exec(mvnCommand);
+ counter++;
+ } catch (final IOException e) {
+ e.printStackTrace();
+
+ }
+
+ } else {
+ System.out.print("Can NOT find jar with path: " + jarPath);
+ }
+
+ }
+
+ }
+ System.out.println("Install #" + counter + " maven artifacts");
+ }
}