From 0eeab39241a3648f80473236d18ea798b915ba6c Mon Sep 17 00:00:00 2001 From: Scott Kurz Date: Thu, 13 Dec 2018 12:42:43 -0500 Subject: [PATCH 1/4] Fix issue where files to format list was getting truncated due to case-sensitive var in hook script --- pre-commit.template | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pre-commit.template b/pre-commit.template index 0f6d7e28..3c80b11e 100755 --- a/pre-commit.template +++ b/pre-commit.template @@ -37,7 +37,7 @@ statusFile=status.$RANDOM fileCommand="git status --porcelain 2>&1 > $statusFile" $(eval $fileCommand) -newlist=Y +newList=Y while read -r do line="$REPLY" @@ -64,11 +64,11 @@ do # We had some inconsistencies with Git versions and sed versions, so hopefully this covers all cases. newFileCmd="echo \"$line\" | sed 's/.* //'" newFile=$(eval "$newFileCmd") - if [ $newlist == "Y" ] ; then + if [ $newList == "Y" ] ; then # formatFiles are input to the eclipse formatter formatFiles=$PROJECT_LOCATION/$newFile checkIfFormatted=$newFile - newlist=N + newList=N else formatFiles="$formatFiles $PROJECT_LOCATION/$newFile" checkIfFormatted="$checkIfFormatted $newFile" @@ -78,7 +78,7 @@ do # Note the sed output is an absolute path including project location newFileCmd="echo $line | cut -c 3- | sed -e 's|^|$PROJECT_LOCATION/|'" newFile=$(eval "$newFileCmd") - if [ $newlist == "Y" ] ; then + if [ $newList == "Y" ] ; then formatFiles="$newFile" checkIfFormatted=$newFile newList=N From 00a2543bc74c95ceeadbdcbe5af7f4a947392a3b Mon Sep 17 00:00:00 2001 From: Scott Kurz Date: Sun, 16 Dec 2018 18:07:17 -0500 Subject: [PATCH 2/4] Remove extra char after servlet mapping from IT URL --- .../src/test/java/application/DockerBuildIT.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/boost-maven/boost-maven-plugin/src/it/test-spring-boot-docker/src/test/java/application/DockerBuildIT.java b/boost-maven/boost-maven-plugin/src/it/test-spring-boot-docker/src/test/java/application/DockerBuildIT.java index 21c9d3d4..afd32fa9 100644 --- a/boost-maven/boost-maven-plugin/src/it/test-spring-boot-docker/src/test/java/application/DockerBuildIT.java +++ b/boost-maven/boost-maven-plugin/src/it/test-spring-boot-docker/src/test/java/application/DockerBuildIT.java @@ -156,7 +156,7 @@ public void testDockerContainerRunning() throws Exception { } public void testAppRunningOnEndpoint() throws Exception { - URL requestUrl = new URL("http://" + getTestDockerHost() + ":" + port + "/spring/"); + URL requestUrl = new URL("http://" + getTestDockerHost() + ":" + port + "/spring"); HttpURLConnection conn = (HttpURLConnection) requestUrl.openConnection(); if (conn != null) { From 6340b88cd18f75c33eb38fff998abdc7a6cac092 Mon Sep 17 00:00:00 2001 From: Scott Kurz Date: Fri, 14 Dec 2018 16:20:55 -0500 Subject: [PATCH 3/4] Mass formatting of all .java parts --- .../config/JDBCBoosterPackConfigurator.java | 10 +++--- .../config/LibertyServerConfigGenerator.java | 5 ++- .../boost/common/docker/AbstractDockerI.java | 13 +++---- .../boost/common/docker/DockerPushI.java | 5 +-- .../common/docker/dockerizer/Dockerizer.java | 2 +- .../spring/DockerizeSpringBootClasspath.java | 2 +- .../spring/DockerizeSpringBootJar.java | 2 +- .../dockerizer/spring/SpringDockerizer.java | 15 ++++---- .../common/utils/LibertyBoosterUtil.java | 4 +-- .../boost/common/utils/SpringBootUtil.java | 11 +++--- .../LibertyServerConfigGeneratorTest.java | 2 +- .../main/java/com/example/HelloResource.java | 2 +- .../src/main/java/hello/HelloController.java | 4 +-- .../src/main/java/hello/HelloController.java | 4 +-- .../main/java/com/example/HelloResource.java | 13 ++++--- .../main/java/com/example/HelloResource.java | 2 +- .../main/java/com/example/HelloResource.java | 2 +- .../main/java/application/Application.java | 2 +- .../test/java/application/DockerBuildIT.java | 2 +- .../test/java/application/DockerPushIT.java | 2 +- .../src/test/java/it/EndpointIT.java | 22 ++++++------ .../src/main/java/hello/WebSocketConfig.java | 2 +- .../maven/docker/AbstractDockerMojo.java | 2 +- .../maven/liberty/LibertyPackageMojo.java | 34 +++++++++---------- .../boost/maven/utils/MavenProjectUtil.java | 4 +-- 25 files changed, 81 insertions(+), 87 deletions(-) diff --git a/boost-common/src/main/java/io/openliberty/boost/common/config/JDBCBoosterPackConfigurator.java b/boost-common/src/main/java/io/openliberty/boost/common/config/JDBCBoosterPackConfigurator.java index 5890d9c9..1a1d79a6 100644 --- a/boost-common/src/main/java/io/openliberty/boost/common/config/JDBCBoosterPackConfigurator.java +++ b/boost-common/src/main/java/io/openliberty/boost/common/config/JDBCBoosterPackConfigurator.java @@ -24,8 +24,8 @@ public class JDBCBoosterPackConfigurator extends BoosterPackConfigurator { /** - * The artifactId of the dependency for this booster that needs to be copied - * to the server + * The artifactId of the dependency for this booster that needs to be copied to + * the server */ private final String DEPENDENCY_ARTIFACT = "org.apache.derby:derby:10.14.2.0"; @@ -39,8 +39,8 @@ public String getFeature() { } /** - * writes out jdbc default config data when selected by the presence of a - * jdbc boost dependency + * writes out jdbc default config data when selected by the presence of a jdbc + * boost dependency */ public void addServerConfig(Document doc) { @@ -97,4 +97,4 @@ public String getDependencyToCopy() { return DEPENDENCY_ARTIFACT; } -} \ No newline at end of file +} diff --git a/boost-common/src/main/java/io/openliberty/boost/common/config/LibertyServerConfigGenerator.java b/boost-common/src/main/java/io/openliberty/boost/common/config/LibertyServerConfigGenerator.java index 1874d434..1c6986f4 100644 --- a/boost-common/src/main/java/io/openliberty/boost/common/config/LibertyServerConfigGenerator.java +++ b/boost-common/src/main/java/io/openliberty/boost/common/config/LibertyServerConfigGenerator.java @@ -168,8 +168,7 @@ public void addFeatures(List features) { } /** - * Write the server.xml and bootstrap.properties to the server config - * directory + * Write the server.xml and bootstrap.properties to the server config directory * * @throws TransformerException * @throws IOException @@ -222,4 +221,4 @@ public void addApplication(String appName) { serverRoot.appendChild(appCfg); } -} \ No newline at end of file +} diff --git a/boost-common/src/main/java/io/openliberty/boost/common/docker/AbstractDockerI.java b/boost-common/src/main/java/io/openliberty/boost/common/docker/AbstractDockerI.java index 7e52528a..a27cbe94 100644 --- a/boost-common/src/main/java/io/openliberty/boost/common/docker/AbstractDockerI.java +++ b/boost-common/src/main/java/io/openliberty/boost/common/docker/AbstractDockerI.java @@ -21,13 +21,13 @@ import io.openliberty.boost.common.BoostLoggerI; public interface AbstractDockerI { - + public void execute(DockerClient dockerClient) throws BoostException; - + public RegistryAuthSupplier createRegistryAuthSupplier() throws BoostException; - + // Default methods - + default public String getImageName(String repository, String tag) { return repository + ":" + tag; } @@ -45,7 +45,7 @@ default public boolean isRepositoryValid(String repository) { return Pattern.matches(repositoryRegExp, repository); } - + default public DockerClient getDockerClient(boolean useProxy) throws BoostException { final RegistryAuthSupplier authSupplier = createRegistryAuthSupplier(); try { @@ -55,7 +55,8 @@ default public DockerClient getDockerClient(boolean useProxy) throws BoostExcept } } - default public boolean isValidDockerConfig(BoostLoggerI log, String repository, String tag, String artifactId) throws BoostException { + default public boolean isValidDockerConfig(BoostLoggerI log, String repository, String tag, String artifactId) + throws BoostException { if (repository.equals(artifactId) && !repository.equals(repository.toLowerCase())) { repository = artifactId.toLowerCase(); log.debug( diff --git a/boost-common/src/main/java/io/openliberty/boost/common/docker/DockerPushI.java b/boost-common/src/main/java/io/openliberty/boost/common/docker/DockerPushI.java index 11d27c45..7605c4e8 100644 --- a/boost-common/src/main/java/io/openliberty/boost/common/docker/DockerPushI.java +++ b/boost-common/src/main/java/io/openliberty/boost/common/docker/DockerPushI.java @@ -19,8 +19,9 @@ import io.openliberty.boost.common.BoostLoggerI; public interface DockerPushI extends AbstractDockerI { - - default public void dockerPush(DockerClient dockerClient, String artifactId, String repository, String tag, BoostLoggerI log) throws BoostException { + + default public void dockerPush(DockerClient dockerClient, String artifactId, String repository, String tag, + BoostLoggerI log) throws BoostException { final DockerLoggingProgressHandler progressHandler = new DockerLoggingProgressHandler(log); final String currentImage = getImageName(repository, tag); String newImage = null; diff --git a/boost-common/src/main/java/io/openliberty/boost/common/docker/dockerizer/Dockerizer.java b/boost-common/src/main/java/io/openliberty/boost/common/docker/dockerizer/Dockerizer.java index 8d9806c4..153d1890 100644 --- a/boost-common/src/main/java/io/openliberty/boost/common/docker/dockerizer/Dockerizer.java +++ b/boost-common/src/main/java/io/openliberty/boost/common/docker/dockerizer/Dockerizer.java @@ -146,4 +146,4 @@ private boolean isFileGeneratedByPlugin(File file) throws IOException { return false; } -} \ No newline at end of file +} diff --git a/boost-common/src/main/java/io/openliberty/boost/common/docker/dockerizer/spring/DockerizeSpringBootClasspath.java b/boost-common/src/main/java/io/openliberty/boost/common/docker/dockerizer/spring/DockerizeSpringBootClasspath.java index a63b82fb..ad9d96dd 100644 --- a/boost-common/src/main/java/io/openliberty/boost/common/docker/dockerizer/spring/DockerizeSpringBootClasspath.java +++ b/boost-common/src/main/java/io/openliberty/boost/common/docker/dockerizer/spring/DockerizeSpringBootClasspath.java @@ -21,7 +21,7 @@ import io.openliberty.boost.common.docker.DockerParameters; public class DockerizeSpringBootClasspath extends SpringDockerizer { - + public DockerizeSpringBootClasspath(File projectDirectory, File outputDirectory, File appArchive, String springBootVersion, DockerParameters params, BoostLoggerI log) { super(projectDirectory, outputDirectory, appArchive, springBootVersion, params, log); diff --git a/boost-common/src/main/java/io/openliberty/boost/common/docker/dockerizer/spring/DockerizeSpringBootJar.java b/boost-common/src/main/java/io/openliberty/boost/common/docker/dockerizer/spring/DockerizeSpringBootJar.java index 1d1d4bf4..4bb2df0d 100644 --- a/boost-common/src/main/java/io/openliberty/boost/common/docker/dockerizer/spring/DockerizeSpringBootJar.java +++ b/boost-common/src/main/java/io/openliberty/boost/common/docker/dockerizer/spring/DockerizeSpringBootJar.java @@ -29,7 +29,7 @@ public DockerizeSpringBootJar(File projectDirectory, File outputDirectory, File public Map getBuildArgs() { Map buildArgs = new HashMap(); - buildArgs.put("JAR_FILE", getAppPathString() + "/" + appArchive.getName()); + buildArgs.put("JAR_FILE", getAppPathString() + "/" + appArchive.getName()); return buildArgs; } diff --git a/boost-common/src/main/java/io/openliberty/boost/common/docker/dockerizer/spring/SpringDockerizer.java b/boost-common/src/main/java/io/openliberty/boost/common/docker/dockerizer/spring/SpringDockerizer.java index ccca7dec..9fb9e624 100644 --- a/boost-common/src/main/java/io/openliberty/boost/common/docker/dockerizer/spring/SpringDockerizer.java +++ b/boost-common/src/main/java/io/openliberty/boost/common/docker/dockerizer/spring/SpringDockerizer.java @@ -28,11 +28,12 @@ import net.wasdev.wlp.common.plugins.util.SpringBootUtil; public abstract class SpringDockerizer extends Dockerizer { - + public final String SPRING_BOOT_VERSION; public final DockerParameters params; - public SpringDockerizer(File projectDirectory, File outputDirectory, File appArchive, String springBootVersion, DockerParameters params, BoostLoggerI log) { + public SpringDockerizer(File projectDirectory, File outputDirectory, File appArchive, String springBootVersion, + DockerParameters params, BoostLoggerI log) { super(projectDirectory, outputDirectory, appArchive, log); this.SPRING_BOOT_VERSION = springBootVersion; this.params = params; @@ -62,7 +63,7 @@ public void createDockerFile() throws BoostException { throw new BoostException("Unable to create a Dockerfile because application type is not supported"); } } - + protected String getAppPathString() { Path projPath = projectDirectory.toPath(); @@ -82,12 +83,10 @@ protected String getSpringStartClass() throws BoostException { Attributes attributes = manifest.getMainAttributes(); return attributes.getValue("Start-Class"); } else { - throw new BoostException( - "Could not get Spring Boot start class due to error getting app manifest."); + throw new BoostException("Could not get Spring Boot start class due to error getting app manifest."); } } catch (IOException e) { - throw new BoostException("Could not get Spring Boot start class due to error opening app archive.", - e); + throw new BoostException("Could not get Spring Boot start class due to error opening app archive.", e); } } @@ -113,4 +112,4 @@ private void writeSpringBootDockerFile(File dockerFile, String startClass) throw } } -} \ No newline at end of file +} diff --git a/boost-common/src/main/java/io/openliberty/boost/common/utils/LibertyBoosterUtil.java b/boost-common/src/main/java/io/openliberty/boost/common/utils/LibertyBoosterUtil.java index edafd7b3..38954d99 100644 --- a/boost-common/src/main/java/io/openliberty/boost/common/utils/LibertyBoosterUtil.java +++ b/boost-common/src/main/java/io/openliberty/boost/common/utils/LibertyBoosterUtil.java @@ -39,8 +39,8 @@ public LibertyBoosterUtil(String libertyServerPath, Map dependen } /** - * take a list of pom boost dependency strings and map to liberty features - * for config. return a list of feature configuration objects for each found + * take a list of pom boost dependency strings and map to liberty features for + * config. return a list of feature configuration objects for each found * dependency. * * @param dependencies diff --git a/boost-common/src/main/java/io/openliberty/boost/common/utils/SpringBootUtil.java b/boost-common/src/main/java/io/openliberty/boost/common/utils/SpringBootUtil.java index daceaab8..197580ab 100644 --- a/boost-common/src/main/java/io/openliberty/boost/common/utils/SpringBootUtil.java +++ b/boost-common/src/main/java/io/openliberty/boost/common/utils/SpringBootUtil.java @@ -64,10 +64,9 @@ public class SpringBootUtil { private static final String SPRING_WEBSOCKET = "spring-websocket"; /** - * Get the expected path of the Spring Boot Uber JAR (with .spring - * extension) that was preserved during the Boost packaging process. No - * guarantee that the path exists or the artifact is indeed a Spring Boot - * Uber JAR. + * Get the expected path of the Spring Boot Uber JAR (with .spring extension) + * that was preserved during the Boost packaging process. No guarantee that the + * path exists or the artifact is indeed a Spring Boot Uber JAR. * * @param artifact * @return the canonical path @@ -115,8 +114,8 @@ public static File copySpringBootUberJar(File artifact, BoostLoggerI logger) thr } /** - * Add the Spring Boot Version property to the Manifest file in the Liberty - * Uber JAR. This is to trick Spring Boot into not repackaging it. + * Add the Spring Boot Version property to the Manifest file in the Liberty Uber + * JAR. This is to trick Spring Boot into not repackaging it. * * @param artifact * @param springBootVersion diff --git a/boost-common/src/test/java/io/openliberty/boost/common/config/LibertyServerConfigGeneratorTest.java b/boost-common/src/test/java/io/openliberty/boost/common/config/LibertyServerConfigGeneratorTest.java index ffdca4c6..0725e9e0 100644 --- a/boost-common/src/test/java/io/openliberty/boost/common/config/LibertyServerConfigGeneratorTest.java +++ b/boost-common/src/test/java/io/openliberty/boost/common/config/LibertyServerConfigGeneratorTest.java @@ -70,4 +70,4 @@ public void testZeroFeaturesInDefaultServerConfig() assertEquals("Didn't find empty list of features", 0, featureList.size()); } -} \ No newline at end of file +} diff --git a/boost-gradle/src/test/resources/jaxrsTestApp/src/main/java/com/example/HelloResource.java b/boost-gradle/src/test/resources/jaxrsTestApp/src/main/java/com/example/HelloResource.java index 7c4cb4b7..1f37cbd0 100644 --- a/boost-gradle/src/test/resources/jaxrsTestApp/src/main/java/com/example/HelloResource.java +++ b/boost-gradle/src/test/resources/jaxrsTestApp/src/main/java/com/example/HelloResource.java @@ -22,4 +22,4 @@ public class HelloResource { public String getInformation() throws Exception, IOException { return "Hello World From Your Friends at Liberty Boost EE!"; } -} \ No newline at end of file +} diff --git a/boost-gradle/src/test/resources/springApp/src/main/java/hello/HelloController.java b/boost-gradle/src/test/resources/springApp/src/main/java/hello/HelloController.java index d9c1069c..8a85245c 100644 --- a/boost-gradle/src/test/resources/springApp/src/main/java/hello/HelloController.java +++ b/boost-gradle/src/test/resources/springApp/src/main/java/hello/HelloController.java @@ -5,10 +5,10 @@ @RestController public class HelloController { - + @RequestMapping("/") public String index() { return "Greetings from Spring Boot!"; } - + } diff --git a/boost-gradle/src/test/resources/test-spring-boot-ssl/src/main/java/hello/HelloController.java b/boost-gradle/src/test/resources/test-spring-boot-ssl/src/main/java/hello/HelloController.java index d9c1069c..8a85245c 100644 --- a/boost-gradle/src/test/resources/test-spring-boot-ssl/src/main/java/hello/HelloController.java +++ b/boost-gradle/src/test/resources/test-spring-boot-ssl/src/main/java/hello/HelloController.java @@ -5,10 +5,10 @@ @RestController public class HelloController { - + @RequestMapping("/") public String index() { return "Greetings from Spring Boot!"; } - + } diff --git a/boost-maven/boost-maven-plugin/src/it/test-context/src/main/java/com/example/HelloResource.java b/boost-maven/boost-maven-plugin/src/it/test-context/src/main/java/com/example/HelloResource.java index 75434c76..133fffbf 100644 --- a/boost-maven/boost-maven-plugin/src/it/test-context/src/main/java/com/example/HelloResource.java +++ b/boost-maven/boost-maven-plugin/src/it/test-context/src/main/java/com/example/HelloResource.java @@ -11,16 +11,15 @@ //import com.ibm.json.java.JSONArray; //import com.ibm.json.java.JSONObject; - // This class define the RESTful API to fetch the database service information // /api/hello @Path("/hello") public class HelloResource { - @GET - @Produces("text/plain") - public String getInformation() throws Exception, IOException { - return "Hello World From Your Friends at Liberty Boost EE! - pass 1"; - } -} \ No newline at end of file + @GET + @Produces("text/plain") + public String getInformation() throws Exception, IOException { + return "Hello World From Your Friends at Liberty Boost EE! - pass 1"; + } +} diff --git a/boost-maven/boost-maven-plugin/src/it/test-jaxrs-2.0/src/main/java/com/example/HelloResource.java b/boost-maven/boost-maven-plugin/src/it/test-jaxrs-2.0/src/main/java/com/example/HelloResource.java index 7c4cb4b7..1f37cbd0 100644 --- a/boost-maven/boost-maven-plugin/src/it/test-jaxrs-2.0/src/main/java/com/example/HelloResource.java +++ b/boost-maven/boost-maven-plugin/src/it/test-jaxrs-2.0/src/main/java/com/example/HelloResource.java @@ -22,4 +22,4 @@ public class HelloResource { public String getInformation() throws Exception, IOException { return "Hello World From Your Friends at Liberty Boost EE!"; } -} \ No newline at end of file +} diff --git a/boost-maven/boost-maven-plugin/src/it/test-jaxrs-2.1/src/main/java/com/example/HelloResource.java b/boost-maven/boost-maven-plugin/src/it/test-jaxrs-2.1/src/main/java/com/example/HelloResource.java index 7c4cb4b7..1f37cbd0 100644 --- a/boost-maven/boost-maven-plugin/src/it/test-jaxrs-2.1/src/main/java/com/example/HelloResource.java +++ b/boost-maven/boost-maven-plugin/src/it/test-jaxrs-2.1/src/main/java/com/example/HelloResource.java @@ -22,4 +22,4 @@ public class HelloResource { public String getInformation() throws Exception, IOException { return "Hello World From Your Friends at Liberty Boost EE!"; } -} \ No newline at end of file +} diff --git a/boost-maven/boost-maven-plugin/src/it/test-spring-boot-docker/src/main/java/application/Application.java b/boost-maven/boost-maven-plugin/src/it/test-spring-boot-docker/src/main/java/application/Application.java index 088fbdce..bdd04a39 100644 --- a/boost-maven/boost-maven-plugin/src/it/test-spring-boot-docker/src/main/java/application/Application.java +++ b/boost-maven/boost-maven-plugin/src/it/test-spring-boot-docker/src/main/java/application/Application.java @@ -28,4 +28,4 @@ public String hello() { return "Greetings from Spring Boot!"; } -} \ No newline at end of file +} diff --git a/boost-maven/boost-maven-plugin/src/it/test-spring-boot-docker/src/test/java/application/DockerBuildIT.java b/boost-maven/boost-maven-plugin/src/it/test-spring-boot-docker/src/test/java/application/DockerBuildIT.java index afd32fa9..4effd65d 100644 --- a/boost-maven/boost-maven-plugin/src/it/test-spring-boot-docker/src/test/java/application/DockerBuildIT.java +++ b/boost-maven/boost-maven-plugin/src/it/test-spring-boot-docker/src/test/java/application/DockerBuildIT.java @@ -185,4 +185,4 @@ private static String getTestDockerHost() { } } -} \ No newline at end of file +} diff --git a/boost-maven/boost-maven-plugin/src/it/test-spring-boot-docker/src/test/java/application/DockerPushIT.java b/boost-maven/boost-maven-plugin/src/it/test-spring-boot-docker/src/test/java/application/DockerPushIT.java index c631c52e..c4d1eaef 100644 --- a/boost-maven/boost-maven-plugin/src/it/test-spring-boot-docker/src/test/java/application/DockerPushIT.java +++ b/boost-maven/boost-maven-plugin/src/it/test-spring-boot-docker/src/test/java/application/DockerPushIT.java @@ -84,4 +84,4 @@ private void removeImage(String imageName) throws Exception { Image removedImage = getImage(imageName); assertNull(imageName + " was not removed.", removedImage); } -} \ No newline at end of file +} diff --git a/boost-maven/boost-maven-plugin/src/it/test-spring-boot-ssl/src/test/java/it/EndpointIT.java b/boost-maven/boost-maven-plugin/src/it/test-spring-boot-ssl/src/test/java/it/EndpointIT.java index c31c97a1..3ba68e66 100644 --- a/boost-maven/boost-maven-plugin/src/it/test-spring-boot-ssl/src/test/java/it/EndpointIT.java +++ b/boost-maven/boost-maven-plugin/src/it/test-spring-boot-ssl/src/test/java/it/EndpointIT.java @@ -39,22 +39,20 @@ public static void init() { @Test public void testServlet() throws Exception { - - SSLContext sslContext = new SSLContextBuilder() - .loadTrustMaterial(null, (certificate, authType) -> true).build(); - - CloseableHttpClient client = HttpClients.custom() - .setSSLContext(sslContext) - .setSSLHostnameVerifier(new NoopHostnameVerifier()) - .build(); - + + SSLContext sslContext = new SSLContextBuilder().loadTrustMaterial(null, (certificate, authType) -> true) + .build(); + + CloseableHttpClient client = HttpClients.custom().setSSLContext(sslContext) + .setSSLHostnameVerifier(new NoopHostnameVerifier()).build(); + HttpGet httpGet = new HttpGet(URL); httpGet.setHeader("Accept", "application/xml"); - + HttpResponse response = client.execute(httpGet); - + assertEquals("HTTP GET failed", HttpStatus.SC_OK, response.getStatusLine().getStatusCode()); - + ResponseHandler handler = new BasicResponseHandler(); String body = handler.handleResponse(response); diff --git a/boost-maven/boost-maven-plugin/src/it/test-spring-boot-websocket/src/main/java/hello/WebSocketConfig.java b/boost-maven/boost-maven-plugin/src/it/test-spring-boot-websocket/src/main/java/hello/WebSocketConfig.java index 241e1d2f..d46e285f 100644 --- a/boost-maven/boost-maven-plugin/src/it/test-spring-boot-websocket/src/main/java/hello/WebSocketConfig.java +++ b/boost-maven/boost-maven-plugin/src/it/test-spring-boot-websocket/src/main/java/hello/WebSocketConfig.java @@ -21,4 +21,4 @@ public void registerStompEndpoints(StompEndpointRegistry registry) { registry.addEndpoint("/gs-guide-websocket").withSockJS(); } -} \ No newline at end of file +} diff --git a/boost-maven/boost-maven-plugin/src/main/java/io/openliberty/boost/maven/docker/AbstractDockerMojo.java b/boost-maven/boost-maven-plugin/src/main/java/io/openliberty/boost/maven/docker/AbstractDockerMojo.java index 69c079da..d8b3841d 100644 --- a/boost-maven/boost-maven-plugin/src/main/java/io/openliberty/boost/maven/docker/AbstractDockerMojo.java +++ b/boost-maven/boost-maven-plugin/src/main/java/io/openliberty/boost/maven/docker/AbstractDockerMojo.java @@ -69,7 +69,7 @@ public abstract class AbstractDockerMojo extends AbstractMojo implements Abstrac @Override public void execute() throws MojoExecutionException { try { - if(isValidDockerConfig(BoostLogger.getInstance(), repository, tag, project.getArtifactId())) { + if (isValidDockerConfig(BoostLogger.getInstance(), repository, tag, project.getArtifactId())) { execute(getDockerClient(useProxy)); } } catch (BoostException e) { diff --git a/boost-maven/boost-maven-plugin/src/main/java/io/openliberty/boost/maven/liberty/LibertyPackageMojo.java b/boost-maven/boost-maven-plugin/src/main/java/io/openliberty/boost/maven/liberty/LibertyPackageMojo.java index 9a420b2d..ebd459de 100644 --- a/boost-maven/boost-maven-plugin/src/main/java/io/openliberty/boost/maven/liberty/LibertyPackageMojo.java +++ b/boost-maven/boost-maven-plugin/src/main/java/io/openliberty/boost/maven/liberty/LibertyPackageMojo.java @@ -58,16 +58,15 @@ public void execute() throws MojoExecutionException { createServer(); /** - * Whether the packaged Liberty Uber JAR will be the project artifact. - * This should be the case in Spring Boot scenarios since Spring Boot - * developers expect a runnable JAR. + * Whether the packaged Liberty Uber JAR will be the project artifact. This + * should be the case in Spring Boot scenarios since Spring Boot developers + * expect a runnable JAR. */ boolean attach; /** - * Use the classifier to determine whether we need to set the Liberty - * Uber JAR as the project artifact, and add Spring-Boot-Version to the - * manifest + * Use the classifier to determine whether we need to set the Liberty Uber JAR + * as the project artifact, and add Spring-Boot-Version to the manifest */ String springBootClassifier = null; @@ -190,8 +189,8 @@ private void generateServerConfigEE() throws MojoExecutionException { } /** - * Manipulate the manifest so that Spring Boot will not attempt to repackage - * a Liberty Uber JAR. + * Manipulate the manifest so that Spring Boot will not attempt to repackage a + * Liberty Uber JAR. * * @param springBootVersion * @throws MojoExecutionException @@ -212,8 +211,8 @@ private void addSpringBootVersionToManifest(String springBootVersion) throws Moj /** * Check that we either have a Liberty Uber JAR (in which case this is a - * re-execution) or a Spring Boot Uber JAR (from which we will create a - * Liberty Uber JAR) when we begin the packaging for Spring Boot projects. + * re-execution) or a Spring Boot Uber JAR (from which we will create a Liberty + * Uber JAR) when we begin the packaging for Spring Boot projects. * * @throws MojoExecutionException */ @@ -226,8 +225,8 @@ private void validateSpringBootUberJAR(File springBootUberJar) throws MojoExecut } /** - * Copy the Spring Boot uber JAR back as the project artifact, only if - * Spring Boot didn't create it already + * Copy the Spring Boot uber JAR back as the project artifact, only if Spring + * Boot didn't create it already * * @throws MojoExecutionException */ @@ -300,8 +299,8 @@ private void installMissingFeatures() throws MojoExecutionException { } /** - * Get all booster dependencies and invoke the maven-dependency-plugin to - * copy them to the Liberty server. + * Get all booster dependencies and invoke the maven-dependency-plugin to copy + * them to the Liberty server. * * @throws MojoExecutionException * @@ -325,15 +324,14 @@ private void copyBoosterDependencies() throws MojoExecutionException { } /** - * Invoke the liberty-maven-plugin to package the server into a runnable - * Liberty JAR + * Invoke the liberty-maven-plugin to package the server into a runnable Liberty + * JAR * * @param packageFilePath * the Spring Boot Uber JAR file path, whose contents will be * replaced by the Liberty Uber JAR * @param attach - * whether or not to make the packaged server the project - * artifact + * whether or not to make the packaged server the project artifact * @throws MojoExecutionException */ private void createUberJar(String packageFilePath, boolean attach) throws MojoExecutionException { diff --git a/boost-maven/boost-maven-plugin/src/main/java/io/openliberty/boost/maven/utils/MavenProjectUtil.java b/boost-maven/boost-maven-plugin/src/main/java/io/openliberty/boost/maven/utils/MavenProjectUtil.java index 2e9037cc..72cc19c4 100644 --- a/boost-maven/boost-maven-plugin/src/main/java/io/openliberty/boost/maven/utils/MavenProjectUtil.java +++ b/boost-maven/boost-maven-plugin/src/main/java/io/openliberty/boost/maven/utils/MavenProjectUtil.java @@ -40,8 +40,8 @@ public static String findSpringBootVersion(MavenProject project) { /** * Get all dependencies with "org.springframework" as the groupId. These - * dependencies will be used to determine which additional Liberty features - * need to be enabled. + * dependencies will be used to determine which additional Liberty features need + * to be enabled. * */ public static List getSpringFrameworkDependencies(MavenProject project) { From 6cd306c807bd205e721a738aa2e13d71c076cb24 Mon Sep 17 00:00:00 2001 From: Scott Kurz Date: Fri, 14 Dec 2018 11:28:31 -0500 Subject: [PATCH 4/4] Rename test-context to test-dynamic-update, and run formatter --- boost-maven/boost-maven-plugin/src/it/pom.xml | 2 +- .../src/it/{test-context => test-dynamic-update}/pom.xml | 2 +- .../src/main/java/com/example/HelloResource.java | 0 .../src/main/webapp/META-INF/MANIFEST.MF | 0 .../src/main/webapp/WEB-INF/web.xml | 0 .../src/main/webapp/index.html | 0 .../src/test/java/it/EndpointIT.java | 0 7 files changed, 2 insertions(+), 2 deletions(-) rename boost-maven/boost-maven-plugin/src/it/{test-context => test-dynamic-update}/pom.xml (98%) rename boost-maven/boost-maven-plugin/src/it/{test-context => test-dynamic-update}/src/main/java/com/example/HelloResource.java (100%) rename boost-maven/boost-maven-plugin/src/it/{test-context => test-dynamic-update}/src/main/webapp/META-INF/MANIFEST.MF (100%) rename boost-maven/boost-maven-plugin/src/it/{test-context => test-dynamic-update}/src/main/webapp/WEB-INF/web.xml (100%) rename boost-maven/boost-maven-plugin/src/it/{test-context => test-dynamic-update}/src/main/webapp/index.html (100%) rename boost-maven/boost-maven-plugin/src/it/{test-context => test-dynamic-update}/src/test/java/it/EndpointIT.java (100%) diff --git a/boost-maven/boost-maven-plugin/src/it/pom.xml b/boost-maven/boost-maven-plugin/src/it/pom.xml index 4b93d782..145c0f20 100644 --- a/boost-maven/boost-maven-plugin/src/it/pom.xml +++ b/boost-maven/boost-maven-plugin/src/it/pom.xml @@ -25,7 +25,7 @@ test-spring-boot-ssl test-jaxrs-2.0 test-jaxrs-2.1 - test-context + test-dynamic-update diff --git a/boost-maven/boost-maven-plugin/src/it/test-context/pom.xml b/boost-maven/boost-maven-plugin/src/it/test-dynamic-update/pom.xml similarity index 98% rename from boost-maven/boost-maven-plugin/src/it/test-context/pom.xml rename to boost-maven/boost-maven-plugin/src/it/test-dynamic-update/pom.xml index 2e019a7e..0d5fcfaf 100644 --- a/boost-maven/boost-maven-plugin/src/it/test-context/pom.xml +++ b/boost-maven/boost-maven-plugin/src/it/test-dynamic-update/pom.xml @@ -2,7 +2,7 @@ 4.0.0 io.openliberty.boost - test-context + test-dynamic-update war 1.0-SNAPSHOT diff --git a/boost-maven/boost-maven-plugin/src/it/test-context/src/main/java/com/example/HelloResource.java b/boost-maven/boost-maven-plugin/src/it/test-dynamic-update/src/main/java/com/example/HelloResource.java similarity index 100% rename from boost-maven/boost-maven-plugin/src/it/test-context/src/main/java/com/example/HelloResource.java rename to boost-maven/boost-maven-plugin/src/it/test-dynamic-update/src/main/java/com/example/HelloResource.java diff --git a/boost-maven/boost-maven-plugin/src/it/test-context/src/main/webapp/META-INF/MANIFEST.MF b/boost-maven/boost-maven-plugin/src/it/test-dynamic-update/src/main/webapp/META-INF/MANIFEST.MF similarity index 100% rename from boost-maven/boost-maven-plugin/src/it/test-context/src/main/webapp/META-INF/MANIFEST.MF rename to boost-maven/boost-maven-plugin/src/it/test-dynamic-update/src/main/webapp/META-INF/MANIFEST.MF diff --git a/boost-maven/boost-maven-plugin/src/it/test-context/src/main/webapp/WEB-INF/web.xml b/boost-maven/boost-maven-plugin/src/it/test-dynamic-update/src/main/webapp/WEB-INF/web.xml similarity index 100% rename from boost-maven/boost-maven-plugin/src/it/test-context/src/main/webapp/WEB-INF/web.xml rename to boost-maven/boost-maven-plugin/src/it/test-dynamic-update/src/main/webapp/WEB-INF/web.xml diff --git a/boost-maven/boost-maven-plugin/src/it/test-context/src/main/webapp/index.html b/boost-maven/boost-maven-plugin/src/it/test-dynamic-update/src/main/webapp/index.html similarity index 100% rename from boost-maven/boost-maven-plugin/src/it/test-context/src/main/webapp/index.html rename to boost-maven/boost-maven-plugin/src/it/test-dynamic-update/src/main/webapp/index.html diff --git a/boost-maven/boost-maven-plugin/src/it/test-context/src/test/java/it/EndpointIT.java b/boost-maven/boost-maven-plugin/src/it/test-dynamic-update/src/test/java/it/EndpointIT.java similarity index 100% rename from boost-maven/boost-maven-plugin/src/it/test-context/src/test/java/it/EndpointIT.java rename to boost-maven/boost-maven-plugin/src/it/test-dynamic-update/src/test/java/it/EndpointIT.java