Skip to content

Commit

Permalink
v23.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ithomas-veeva committed May 2, 2023
1 parent e4d6ff3 commit 1c2fe88
Show file tree
Hide file tree
Showing 40 changed files with 2,015 additions and 730 deletions.
13 changes: 10 additions & 3 deletions dependency-reduced-pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<artifactId>vaultjavasdk-maven-plugin</artifactId>
<packaging>maven-plugin</packaging>
<name>Vault Java SDK Maven Plugin</name>
<version>22.3.0</version>
<version>23.1.0</version>
<build>
<plugins>
<plugin>
Expand Down Expand Up @@ -103,17 +103,24 @@
<dependency>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-plugin-annotations</artifactId>
<version>3.5</version>
<version>3.8.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.2</version>
<version>4.13.2</version>
<scope>test</scope>
<exclusions>
<exclusion>
<artifactId>hamcrest-core</artifactId>
<groupId>org.hamcrest</groupId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<properties>
<jackson.version>2.14.2</jackson.version>
<maven.compiler.source>1.8</maven.compiler.source>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.target>1.8</maven.compiler.target>
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2f807270380b9fd6a965b496336151eb
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
cedc716b5a7c54ac33e713ff5dab90e08a40902f
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>com.veeva.vault.sdk</groupId>
<artifactId>vaultjavasdk-maven-plugin</artifactId>
<version>23.1.0</version>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dd3c3bd39a2382bb2cd746c6eb340a86
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
62f48f7535d462ee1bf077da809e59c9aca7e44b
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
<groupId>com.veeva.vault.sdk</groupId>
<artifactId>vaultjavasdk-maven-plugin</artifactId>
<versioning>
<release>22.3.0</release>
<release>23.1.0</release>
<versions>
<version>2.0.0</version>
<version>22.2.0</version>
<version>22.2.1</version>
<version>22.3.0</version>
<version>23.1.0</version>
</versions>
<lastUpdated>20221219192649</lastUpdated>
<lastUpdated>20230502164605</lastUpdated>
</versioning>
</metadata>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
e844f406872e01bf4dcadddae4c2cf84
2a6c3c25d40f7a974ab6ce2b754caa84
Original file line number Diff line number Diff line change
@@ -1 +1 @@
b6253769ae02ff2db33957dc16a8fa22e8f82983
35ab72374de050c436542563405bdc5d73b0b46c
53 changes: 44 additions & 9 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>com.veeva.vault.sdk</groupId>
<artifactId>vaultjavasdk-maven-plugin</artifactId>
<version>22.3.0</version>
<version>23.1.0</version>
<packaging>maven-plugin</packaging>

<name>Vault Java SDK Maven Plugin</name>
Expand All @@ -14,6 +14,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<jackson.version>2.14.2</jackson.version>
</properties>

<repositories>
Expand All @@ -31,43 +32,77 @@
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<version>3.0</version>
<version>3.9.0</version>
</dependency>
<dependency>
<groupId>com.veeva.vault</groupId>
<artifactId>vapil</artifactId>
<version>22.3.0</version>
<version>23.1.1</version>
</dependency>
<dependency>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-plugin-annotations</artifactId>
<version>3.5</version>
<version>3.8.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
<version>3.0.8</version>
<version>3.5.1</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.2</version>
<version>4.13.2</version>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/com.google.code.gson/gson -->
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.5</version>
<version>2.10.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-compress -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-compress</artifactId>
<version>1.18</version>
<version>1.21</version>
</dependency>

<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-csv</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-properties</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-xml</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>com.opencsv</groupId>
<artifactId>opencsv</artifactId>
<version>5.7.1</version>
</dependency>
</dependencies>

<build>
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
package com.veeva.vault.sdk.vaultapi.vaultjavasdk;

import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.veeva.vault.sdk.vaultapi.vaultjavasdk.model.PluginSettings;
import com.veeva.vault.vapil.api.client.VaultClient;
import org.apache.log4j.Logger;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugins.annotations.Parameter;

import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;

public class BasePlugin extends AbstractMojo {

protected VaultClient vaultClient;

@Parameter( property = "vapilSettingsFilePath", defaultValue = "")
protected String vapilSettingsFilePath= "";
@Parameter( property = "pluginSettingsFilePath", defaultValue = "")
protected String pluginSettingsFilePath;
protected PluginSettings pluginSettings;
protected String PACKAGE_NAME = null;
protected Path PACKAGE_PATH = null;
protected static final String USER_DIR = System.getProperty("user.dir");
protected static final String OUTPUT_XML_FILE = USER_DIR + "/deployment/";
protected static final String VPK_OUTPUT_DESTINATION = USER_DIR + "/deployment/packages/";

private static final Logger logger = Logger.getLogger(BasePlugin.class);


@Override
public void execute() throws MojoExecutionException, MojoFailureException {

if (vaultClient == null) {
if (vapilSettingsFilePath != null) {
try {
vaultClient = VaultClient.newClientBuilderFromSettings(convertFileToString(vapilSettingsFilePath))
.build();
} catch (Exception e) {
logger.error("Failed to map Plugin Settings: " + e.getMessage());
}
} else {
logger.error("File path for Vapil settings is not present.");
}
}

if (pluginSettingsFilePath != null) {
try {

this.pluginSettings = mapSettingValues(pluginSettingsFilePath);

} catch (Exception e) {
logger.error("Failed to map Plugin Settings: " + e.getMessage());
throw new IllegalArgumentException("Invalid Plugin Settings");
}

if (pluginSettings != null) {
this.PACKAGE_NAME = pluginSettings.getPackageName() + ".vpk";
this.PACKAGE_PATH = Paths.get(VPK_OUTPUT_DESTINATION, PACKAGE_NAME);
}
}
}

private static PluginSettings mapSettingValues(String pluginSettingsFilePath) throws Exception {

ObjectMapper mapper = new ObjectMapper();
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
try {
return mapper.readValue(convertFileToString(pluginSettingsFilePath), PluginSettings.class);

} catch (IOException | IllegalArgumentException e) {
logger.error("Failed to load Plugin Settings: " + e.getMessage());
throw new Exception(e);
}

}

private static String convertFileToString(String filePath) throws IOException {
File file = new File(filePath);
return new String(Files.readAllBytes(Paths.get(file.getPath())));
}

}
Loading

0 comments on commit 1c2fe88

Please sign in to comment.