Loading src/main/java/com/inteligr8/maven/aps/modeling/goal/PublishAppGoal.java +9 −1 Original line number Diff line number Diff line Loading @@ -40,6 +40,9 @@ public class PublishAppGoal extends ApsAppAddressibleGoal { @Parameter( property = "aps-model.publish.comment", required = true, defaultValue = "Automated by 'aps-model-maven-plugin'" ) protected String comment; @Parameter( property = "aps-model.dryRun", required = true, defaultValue = "false" ) protected boolean dryRun; @Override public void executeEnabled() throws MojoExecutionException, MojoFailureException { Long appId = this.findAppId(false); Loading @@ -56,7 +59,12 @@ public class PublishAppGoal extends ApsAppAddressibleGoal { AppDefinitionPublishRepresentation appDefPublish = new AppDefinitionPublishRepresentation(); appDefPublish.setComment(this.comment); if (this.dryRun) { this.getLog().info("[DRYRUN]: Publishing app: " + appId); } else { this.getLog().info("Publishing app: " + appId); api.getAppDefinitionsApi().publish(appId, appDefPublish); } } } src/main/java/com/inteligr8/maven/aps/modeling/goal/UploadAppGoal.java +31 −12 Original line number Diff line number Diff line Loading @@ -50,6 +50,9 @@ public class UploadAppGoal extends ApsAppAddressibleGoal { @Parameter( property = "publish", required = true, defaultValue = "false" ) protected boolean publish = false; @Parameter( property = "aps-model.dryRun", required = true, defaultValue = "false" ) protected boolean dryRun; protected final int bufferSize = 128 * 1024; @Override Loading Loading @@ -93,25 +96,41 @@ public class UploadAppGoal extends ApsAppAddressibleGoal { if (appId == null) { if (this.publish) { if (this.dryRun) { this.getLog().info("[DRYRUN]: Uploading & publishing new APS App: " + this.apsAppName); } else { this.getLog().info("Uploading & publishing new APS App: " + this.apsAppName); AppDefinitionUpdateResultRepresentation appDefUpdate = api.getAppDefinitionsJerseyApi().publishApp(multipart); if (Boolean.TRUE.equals(appDefUpdate.getError())) throw new MojoExecutionException(appDefUpdate.getErrorDescription()); } } else { if (this.dryRun) { this.getLog().info("[DRYRUN]: Uploading new APS App: " + this.apsAppName); } else { this.getLog().info("Uploading new APS App: " + this.apsAppName); api.getAppDefinitionsJerseyApi().importApp(multipart, true); } } } else { if (this.publish) { if (this.dryRun) { this.getLog().info("[DRYRUN]: Uploading, versioning, & publishing APS App: " + this.apsAppName + " (" + appId + ")"); } else { this.getLog().info("Uploading, versioning, & publishing APS App: " + this.apsAppName + " (" + appId + ")"); AppDefinitionUpdateResultRepresentation appDefUpdate = api.getAppDefinitionsJerseyApi().publishApp(appId, multipart); if (Boolean.TRUE.equals(appDefUpdate.getError())) throw new MojoExecutionException(appDefUpdate.getErrorDescription()); } } else { if (this.dryRun) { this.getLog().info("[DRYRUN]: Uploading & versioning APS App: " + this.apsAppName + " (" + appId + ")"); } else { this.getLog().info("Uploading & versioning APS App: " + this.apsAppName + " (" + appId + ")"); api.getAppDefinitionsJerseyApi().importApp(appId, multipart, true); } } } } catch (ParseException pe) { throw new MojoExecutionException("The app ZIP could not be wrapped in a multipart", pe); } finally { Loading Loading
src/main/java/com/inteligr8/maven/aps/modeling/goal/PublishAppGoal.java +9 −1 Original line number Diff line number Diff line Loading @@ -40,6 +40,9 @@ public class PublishAppGoal extends ApsAppAddressibleGoal { @Parameter( property = "aps-model.publish.comment", required = true, defaultValue = "Automated by 'aps-model-maven-plugin'" ) protected String comment; @Parameter( property = "aps-model.dryRun", required = true, defaultValue = "false" ) protected boolean dryRun; @Override public void executeEnabled() throws MojoExecutionException, MojoFailureException { Long appId = this.findAppId(false); Loading @@ -56,7 +59,12 @@ public class PublishAppGoal extends ApsAppAddressibleGoal { AppDefinitionPublishRepresentation appDefPublish = new AppDefinitionPublishRepresentation(); appDefPublish.setComment(this.comment); if (this.dryRun) { this.getLog().info("[DRYRUN]: Publishing app: " + appId); } else { this.getLog().info("Publishing app: " + appId); api.getAppDefinitionsApi().publish(appId, appDefPublish); } } }
src/main/java/com/inteligr8/maven/aps/modeling/goal/UploadAppGoal.java +31 −12 Original line number Diff line number Diff line Loading @@ -50,6 +50,9 @@ public class UploadAppGoal extends ApsAppAddressibleGoal { @Parameter( property = "publish", required = true, defaultValue = "false" ) protected boolean publish = false; @Parameter( property = "aps-model.dryRun", required = true, defaultValue = "false" ) protected boolean dryRun; protected final int bufferSize = 128 * 1024; @Override Loading Loading @@ -93,25 +96,41 @@ public class UploadAppGoal extends ApsAppAddressibleGoal { if (appId == null) { if (this.publish) { if (this.dryRun) { this.getLog().info("[DRYRUN]: Uploading & publishing new APS App: " + this.apsAppName); } else { this.getLog().info("Uploading & publishing new APS App: " + this.apsAppName); AppDefinitionUpdateResultRepresentation appDefUpdate = api.getAppDefinitionsJerseyApi().publishApp(multipart); if (Boolean.TRUE.equals(appDefUpdate.getError())) throw new MojoExecutionException(appDefUpdate.getErrorDescription()); } } else { if (this.dryRun) { this.getLog().info("[DRYRUN]: Uploading new APS App: " + this.apsAppName); } else { this.getLog().info("Uploading new APS App: " + this.apsAppName); api.getAppDefinitionsJerseyApi().importApp(multipart, true); } } } else { if (this.publish) { if (this.dryRun) { this.getLog().info("[DRYRUN]: Uploading, versioning, & publishing APS App: " + this.apsAppName + " (" + appId + ")"); } else { this.getLog().info("Uploading, versioning, & publishing APS App: " + this.apsAppName + " (" + appId + ")"); AppDefinitionUpdateResultRepresentation appDefUpdate = api.getAppDefinitionsJerseyApi().publishApp(appId, multipart); if (Boolean.TRUE.equals(appDefUpdate.getError())) throw new MojoExecutionException(appDefUpdate.getErrorDescription()); } } else { if (this.dryRun) { this.getLog().info("[DRYRUN]: Uploading & versioning APS App: " + this.apsAppName + " (" + appId + ")"); } else { this.getLog().info("Uploading & versioning APS App: " + this.apsAppName + " (" + appId + ")"); api.getAppDefinitionsJerseyApi().importApp(appId, multipart, true); } } } } catch (ParseException pe) { throw new MojoExecutionException("The app ZIP could not be wrapped in a multipart", pe); } finally { Loading