Skip to content

Commit 992e1df

Browse files
added shade plugin to build uber jar
Former-commit-id: 6635186bdad6a7df38b08e9546411d8d57421122
1 parent 2f191c2 commit 992e1df

File tree

4 files changed

+44
-96
lines changed

4 files changed

+44
-96
lines changed

pom.xml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,34 @@
3030
<version>3.8.0</version>
3131
</dependency>
3232
</dependencies>
33+
34+
<build>
35+
<plugins>
36+
<plugin>
37+
<groupId>org.apache.maven.plugins</groupId>
38+
<artifactId>maven-shade-plugin</artifactId>
39+
<version>3.2.1</version>
40+
<executions>
41+
<execution>
42+
<phase>package</phase>
43+
<goals>
44+
<goal>shade</goal>
45+
</goals>
46+
<configuration>
47+
<!--<artifactSet>-->
48+
<!--<excludes>-->
49+
<!--<exclude>classworlds:classworlds</exclude>-->
50+
<!--<exclude>junit:junit</exclude>-->
51+
<!--<exclude>jmock:*</exclude>-->
52+
<!--<exclude>*:xml-apis</exclude>-->
53+
<!--<exclude>org.apache.maven:lib:tests</exclude>-->
54+
<!--<exclude>log4j:log4j:jar:</exclude>-->
55+
<!--</excludes>-->
56+
<!--</artifactSet>-->
57+
</configuration>
58+
</execution>
59+
</executions>
60+
</plugin>
61+
</plugins>
62+
</build>
3363
</project>

src/main/java/com/oracle/weblogicx/imagebuilder/builder/cli/BuilderCLIDriver.java

Lines changed: 6 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ public CommandResponse call() throws Exception {
5656
System.out.println("patches = \"" + patches + "\"");
5757
System.out.println("fromImage = \"" + fromImage + "\"");
5858
System.out.println("userId = \"" + userId + "\"");
59-
System.out.println("password = \"" + password + "\"");
6059
System.out.println("publish = \"" + isPublish + "\"");
6160

6261
FileHandler fileHandler = null;
@@ -121,7 +120,7 @@ public CommandResponse call() throws Exception {
121120

122121
if (!targetFile.exists() || !META_RESOLVER.hasMatchingKeyValue(propKey, targetFilePath)) {
123122
if (useCache != always) {
124-
//System.out.println("1. Downloading from " + propVal + " to " + targetFilePath);
123+
System.out.println("1. Downloading from " + propVal + " to " + targetFilePath);
125124
logger.info("1. Downloading from " + propVal + " to " + targetFilePath);
126125
HttpUtil.downloadFile(propVal, targetFilePath, userId, password);
127126
META_RESOLVER.addToCache(propKey, targetFilePath);
@@ -145,7 +144,7 @@ public CommandResponse call() throws Exception {
145144
if ("12.2.1.3.0".equals(installerVersion) ) {
146145
if (!opatchFile.exists() || !META_RESOLVER.hasMatchingKeyValue(opatchKey, opatch_1394_path)) {
147146
if (useCache != always) {
148-
//System.out.println("3. Downloading from " + OPATCH_1394_URL + " to " + opatch_1394_path);
147+
System.out.println("3. Downloading from " + OPATCH_1394_URL + " to " + opatch_1394_path);
149148
logger.info("3. Downloading from " + OPATCH_1394_URL + " to " + opatch_1394_path);
150149
HttpUtil.downloadFile(OPATCH_1394_URL, opatch_1394_path, userId, password);
151150
META_RESOLVER.addToCache(opatchKey, opatch_1394_path);
@@ -262,8 +261,6 @@ public CommandResponse call() throws Exception {
262261
}
263262

264263
private List<String> getInitialBuildCmd() {
265-
// List<String> cmdBuilder = new ArrayList<>(Arrays.asList("docker", "build",
266-
// "--squash", "--force-rm", "--no-cache", "--network=host"));
267264
List<String> cmdBuilder = Stream.of("docker", "build",
268265
"--squash", "--force-rm", "--no-cache", "--network=host").collect(Collectors.toList());
269266

@@ -390,6 +387,7 @@ private void setSystemProxy(String proxyUrl, String protocolToSet) {
390387
names = { "--password" },
391388
paramLabel = "<password associated with support user id>",
392389
required = true,
390+
interactive = true,
393391
description = "Password for support userId"
394392
)
395393
private String password;
@@ -413,9 +411,9 @@ private void setSystemProxy(String proxyUrl, String protocolToSet) {
413411
private boolean isPublish = false;
414412

415413
@Option(
416-
hidden = true,
417-
names = { "--httpProxyUrl" },
418-
description = "proxy for http protocol. Ex: http://myproxy:80 or http://user:passwd@myproxy:8080"
414+
hidden = true,
415+
names = { "--httpProxyUrl" },
416+
description = "proxy for http protocol. Ex: http://myproxy:80 or http://user:passwd@myproxy:8080"
419417
)
420418
private String httpProxyUrl;
421419

@@ -445,94 +443,6 @@ private void setSystemProxy(String proxyUrl, String protocolToSet) {
445443
)
446444
private boolean isCLIMode;
447445

448-
public InstallerType getInstallerType() {
449-
return installerType;
450-
}
451-
452-
public void setInstallerType(InstallerType installerType) {
453-
this.installerType = installerType;
454-
}
455-
456-
public String getInstallerVersion() {
457-
return installerVersion;
458-
}
459-
460-
public void setInstallerVersion(String installerVersion) {
461-
this.installerVersion = installerVersion;
462-
}
463-
464-
public String getJdkVersion() {
465-
return jdkVersion;
466-
}
467-
468-
public void setJdkVersion(String jdkVersion) {
469-
this.jdkVersion = jdkVersion;
470-
}
471-
472-
public boolean isLatestPSU() {
473-
return latestPSU;
474-
}
475-
476-
public void setLatestPSU(boolean latestPSU) {
477-
this.latestPSU = latestPSU;
478-
}
479-
480-
public List<String> getPatches() {
481-
return patches;
482-
}
483-
484-
public void setPatches(List<String> patches) {
485-
this.patches = patches;
486-
}
487-
488-
public String getFromImage() {
489-
return fromImage;
490-
}
491-
492-
public void setFromImage(String fromImage) {
493-
this.fromImage = fromImage;
494-
}
495-
496-
public String getImageTag() {
497-
return imageTag;
498-
}
499-
500-
public void setImageTag(String imageTag) {
501-
this.imageTag = imageTag;
502-
}
503-
504-
public String getUserId() {
505-
return userId;
506-
}
507-
508-
public void setUserId(String userId) {
509-
this.userId = userId;
510-
}
511-
512-
public String getPassword() {
513-
return password;
514-
}
515-
516-
public void setPassword(String password) {
517-
this.password = password;
518-
}
519-
520-
public CachePolicy getUseCache() {
521-
return useCache;
522-
}
523-
524-
public void setUseCache(CachePolicy useCache) {
525-
this.useCache = useCache;
526-
}
527-
528-
public boolean isPublish() {
529-
return isPublish;
530-
}
531-
532-
public void setPublish(boolean publish) {
533-
isPublish = publish;
534-
}
535-
536446
static class WLSVersionValues extends ArrayList<String> {
537447
WLSVersionValues() {
538448
super(Arrays.asList("12.2.1.3.0", "12.2.1.2.0"));

src/main/java/com/oracle/weblogicx/imagebuilder/builder/cli/CacheCLI.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,13 @@ public class CacheCLI implements Runnable {
3535
)
3636
private Path cacheDirPath = null;
3737

38+
@Option(
39+
names = { "--cli" },
40+
description = "CLI Mode",
41+
hidden = true
42+
)
43+
private boolean isCLIMode;
44+
3845
@Override
3946
public void run() {
4047
if (listCachePath) {

src/main/java/com/oracle/weblogicx/imagebuilder/builder/util/ARUConstants.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
public class ARUConstants {
66

7+
public static final String OPATCH_KEY = "opatch_1394";
78
public static final String OPATCH_1394_URL="https://updates.oracle.com/Orion/Services/download/" +
89
"p28186730_139400_Generic.zip?aru=22310944&patch_file=p28186730_139400_Generic.zip";
910
static final String REL_URL = "https://updates.oracle.com/Orion/Services/metadata?table=aru_releases";

0 commit comments

Comments
 (0)