Skip to content

Commit 19793f2

Browse files
more changes to structure
Former-commit-id: 9f814ae88dd92202121e1e70df168dc52649d610
2 parents 9557d7e + f5c4887 commit 19793f2

24 files changed

+535
-705
lines changed

pom.xml

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
<properties>
1212
<maven.compiler.source>1.8</maven.compiler.source>
1313
<maven.compiler.target>1.8</maven.compiler.target>
14+
<exec-maven-plugin.version>1.6.0</exec-maven-plugin.version>
15+
<shade-plugin-version>3.2.1</shade-plugin-version>
16+
<JAVA8_HOME></JAVA8_HOME>
1417
</properties>
1518

1619
<dependencies>
@@ -33,10 +36,39 @@
3336

3437
<build>
3538
<plugins>
39+
<plugin>
40+
<groupId>org.codehaus.mojo</groupId>
41+
<artifactId>exec-maven-plugin</artifactId>
42+
<version>${exec-maven-plugin.version}</version>
43+
<executions>
44+
<execution>
45+
<id>generate-autocompletion-script</id>
46+
<phase>package</phase>
47+
<goals>
48+
<goal>exec</goal>
49+
</goals>
50+
</execution>
51+
</executions>
52+
<configuration>
53+
<executable>java</executable>
54+
<arguments>
55+
<!--<argument>-Dpicocli.autocomplete.systemExitOnError</argument>-->
56+
<argument>-cp</argument>
57+
<classpath/>
58+
<argument>picocli.AutoComplete</argument>
59+
<argument>--force</argument><!-- overwrite if exists -->
60+
<argument>--writeCommandScript</argument>
61+
<argument>--completionScript</argument>
62+
<argument>${project.build.directory}/imagebuilder_completion.sh</argument>
63+
<argument>com.oracle.weblogicx.imagebuilder.builder.cli.CLIDriver</argument>
64+
<!-- replace with your class -->
65+
</arguments>
66+
</configuration>
67+
</plugin>
3668
<plugin>
3769
<groupId>org.apache.maven.plugins</groupId>
3870
<artifactId>maven-shade-plugin</artifactId>
39-
<version>3.2.1</version>
71+
<version>${shade-plugin-version}</version>
4072
<executions>
4173
<execution>
4274
<phase>package</phase>

src/main/java/com/oracle/weblogicx/imagebuilder/builder/api/model/CachePolicy.java

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,18 @@
44

55
@SuppressWarnings("unused")
66
public enum CachePolicy {
7-
first,
8-
always,
9-
never
7+
FIRST("first"),
8+
ALWAYS("always"),
9+
NEVER("never");
10+
11+
private String value;
12+
13+
CachePolicy(String value) {
14+
this.value = value;
15+
}
16+
17+
@Override
18+
public String toString() {
19+
return value;
20+
}
1021
}

src/main/java/com/oracle/weblogicx/imagebuilder/builder/api/model/CommandResponse.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,25 @@ public class CommandResponse {
77
private int status;
88
private String message;
99
private Object result;
10+
private boolean success = true;
1011

1112
public CommandResponse(int status, String message) {
1213
this.status = status;
1314
this.message = message;
15+
16+
if (status != 0) {
17+
this.success = false;
18+
}
1419
}
1520

1621
public CommandResponse(int status, String message, Object result) {
1722
this.status = status;
1823
this.message = message;
1924
this.result = result;
25+
26+
if (status != 0) {
27+
this.success = false;
28+
}
2029
}
2130

2231
public int getStatus() {
@@ -31,4 +40,13 @@ public String getMessage() {
3140
public <T> T getResult() {
3241
return (T) result;
3342
}
43+
44+
public boolean isSuccess() {
45+
return success;
46+
}
47+
48+
public void setSuccess(boolean success) {
49+
this.success = success;
50+
}
51+
3452
}

0 commit comments

Comments
 (0)