-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e4d6ff3
commit 1c2fe88
Showing
40 changed files
with
2,015 additions
and
730 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file renamed
BIN
+17.1 MB
target/vaultjavasdk-maven-plugin-22.3.0.jar → ....1.0/vaultjavasdk-maven-plugin-23.1.0.jar
Binary file not shown.
1 change: 1 addition & 0 deletions
1
...veeva/vault/sdk/vaultjavasdk-maven-plugin/23.1.0/vaultjavasdk-maven-plugin-23.1.0.jar.md5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
2f807270380b9fd6a965b496336151eb |
1 change: 1 addition & 0 deletions
1
...eeva/vault/sdk/vaultjavasdk-maven-plugin/23.1.0/vaultjavasdk-maven-plugin-23.1.0.jar.sha1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
cedc716b5a7c54ac33e713ff5dab90e08a40902f |
8 changes: 8 additions & 0 deletions
8
...com/veeva/vault/sdk/vaultjavasdk-maven-plugin/23.1.0/vaultjavasdk-maven-plugin-23.1.0.pom
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
1 change: 1 addition & 0 deletions
1
...veeva/vault/sdk/vaultjavasdk-maven-plugin/23.1.0/vaultjavasdk-maven-plugin-23.1.0.pom.md5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
dd3c3bd39a2382bb2cd746c6eb340a86 |
1 change: 1 addition & 0 deletions
1
...eeva/vault/sdk/vaultjavasdk-maven-plugin/23.1.0/vaultjavasdk-maven-plugin-23.1.0.pom.sha1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
62f48f7535d462ee1bf077da809e59c9aca7e44b |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
docs/maven/com/veeva/vault/sdk/vaultjavasdk-maven-plugin/maven-metadata.xml.md5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
e844f406872e01bf4dcadddae4c2cf84 | ||
2a6c3c25d40f7a974ab6ce2b754caa84 |
2 changes: 1 addition & 1 deletion
2
docs/maven/com/veeva/vault/sdk/vaultjavasdk-maven-plugin/maven-metadata.xml.sha1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
b6253769ae02ff2db33957dc16a8fa22e8f82983 | ||
35ab72374de050c436542563405bdc5d73b0b46c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 0 additions & 15 deletions
15
src/main/java/com/veeva/vault/sdk/vaultapi/responsetypes/ErrorType.java
This file was deleted.
Oops, something went wrong.
37 changes: 0 additions & 37 deletions
37
src/main/java/com/veeva/vault/sdk/vaultapi/responsetypes/GenericType.java
This file was deleted.
Oops, something went wrong.
67 changes: 0 additions & 67 deletions
67
src/main/java/com/veeva/vault/sdk/vaultapi/vaultjavasdk/BaseMojo.java
This file was deleted.
Oops, something went wrong.
89 changes: 89 additions & 0 deletions
89
src/main/java/com/veeva/vault/sdk/vaultapi/vaultjavasdk/BasePlugin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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()))); | ||
} | ||
|
||
} |
Oops, something went wrong.