diff --git a/liberty-maven-plugin/src/it/binary-scanner-it/resources/basic-dev-project10/pom.xml b/liberty-maven-plugin/src/it/binary-scanner-it/resources/basic-dev-project10/pom.xml new file mode 100755 index 000000000..fc755016e --- /dev/null +++ b/liberty-maven-plugin/src/it/binary-scanner-it/resources/basic-dev-project10/pom.xml @@ -0,0 +1,220 @@ + + + + 4.0.0 + + binary-scanner-it-tests + dev-sample-proj + 1.0-SNAPSHOT + war + + + UTF-8 + UTF-8 + 1.7 + 1.7 + LibertyProject + + 9080 + 9443 + + usr + + + + + oss-sonatype + oss-sonatype + https://oss.sonatype.org/content/repositories/snapshots/ + + true + + + + + + + io.openliberty.features + features-bom + RUNTIME_VERSION + pom + import + + + + + + + + jakarta.platform + jakarta.jakartaee-api + 10.0.0 + provided + + + org.eclipse.microprofile + microprofile + 6.0 + pom + provided + + + + junit + junit + 4.13.1 + test + + + org.apache.cxf + cxf-rt-rs-client + 3.2.6 + test + + + org.apache.cxf + cxf-rt-rs-extension-providers + 3.2.6 + test + + + org.glassfish + javax.json + 1.0.4 + test + + + + org.apache.commons + commons-lang3 + 3.0 + + + + javax.xml.bind + jaxb-api + 2.3.1 + provided + + + com.sun.xml.bind + jaxb-core + 2.3.0.1 + provided + + + javax.activation + activation + 1.1.1 + provided + + + javax.batch + javax.batch-api + 1.0.1 + provided + + + + org.slf4j + slf4j-api + 1.7.25 + + + ch.qos.logback + logback-classic + 1.2.3 + runtime + + + + + + + + org.apache.maven.plugins + maven-war-plugin + 3.3.2 + + false + pom.xml + + + + + org.apache.maven.plugins + maven-surefire-plugin + 3.0.0-M1 + + + test + default-test + + + **/it/** + + ${project.build.directory}/test-reports/unit + + + + + + + io.openliberty.tools + liberty-maven-plugin + SUB_VERSION + + + io.openliberty + openliberty-kernel + RUNTIME_VERSION + zip + + ${app.name} + ${packaging.type} + + ${testServerHttpPort} + ${testServerHttpsPort} + json + + + + + + + org.apache.maven.plugins + maven-failsafe-plugin + 3.0.0-M1 + + + integration-test + integration-test + + integration-test + + + + **/it/**/*.java + + + + ${testServerHttpPort} + + + + + + verify-results + + verify + + + + + ${project.build.directory}/test-reports/it/failsafe-summary.xml + ${project.build.directory}/test-reports/it + + + + + diff --git a/liberty-maven-plugin/src/it/binary-scanner-it/resources/basic-dev-project10/src/main/java/com/demo/HelloLogger.java b/liberty-maven-plugin/src/it/binary-scanner-it/resources/basic-dev-project10/src/main/java/com/demo/HelloLogger.java new file mode 100755 index 000000000..caea6b44b --- /dev/null +++ b/liberty-maven-plugin/src/it/binary-scanner-it/resources/basic-dev-project10/src/main/java/com/demo/HelloLogger.java @@ -0,0 +1,37 @@ +/******************************************************************************* + * (c) Copyright IBM Corporation 2020. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *******************************************************************************/ +package com.demo; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import jakarta.ws.rs.GET; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.Produces; + +import static jakarta.ws.rs.core.MediaType.TEXT_PLAIN; + +@Path("/show-log") +public class HelloLogger { + private static final Logger log = LoggerFactory.getLogger(HelloLogger.class); + + @GET + @Produces(TEXT_PLAIN) + public String showLog() { + log.info("Here is the Log"); + return "Log has been shown"; + } +} diff --git a/liberty-maven-plugin/src/it/binary-scanner-it/resources/basic-dev-project10/src/main/java/com/demo/HelloServlet.java b/liberty-maven-plugin/src/it/binary-scanner-it/resources/basic-dev-project10/src/main/java/com/demo/HelloServlet.java new file mode 100644 index 000000000..a5811dedc --- /dev/null +++ b/liberty-maven-plugin/src/it/binary-scanner-it/resources/basic-dev-project10/src/main/java/com/demo/HelloServlet.java @@ -0,0 +1,39 @@ +/******************************************************************************* + * (c) Copyright IBM Corporation 2019. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *******************************************************************************/ +package com.demo; + +import java.io.IOException; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import jakarta.servlet.ServletException; +import jakarta.servlet.annotation.WebServlet; +import jakarta.servlet.http.HttpServlet; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; + +@WebServlet(urlPatterns="/servlet") +public class HelloServlet extends HttpServlet { + private static final long serialVersionUID = 1L; + + private static final Logger log = LoggerFactory.getLogger(HelloLogger.class); + + protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + log.info("SLF4J Logger is ready for messages."); + response.getWriter().append("hello world"); + } +} \ No newline at end of file diff --git a/liberty-maven-plugin/src/it/binary-scanner-it/resources/basic-dev-project10/src/main/java/com/demo/HelloWorld.java b/liberty-maven-plugin/src/it/binary-scanner-it/resources/basic-dev-project10/src/main/java/com/demo/HelloWorld.java new file mode 100755 index 000000000..ec88aeba2 --- /dev/null +++ b/liberty-maven-plugin/src/it/binary-scanner-it/resources/basic-dev-project10/src/main/java/com/demo/HelloWorld.java @@ -0,0 +1,34 @@ +/******************************************************************************* + * (c) Copyright IBM Corporation 2022. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *******************************************************************************/ +package com.demo; + +import org.eclipse.microprofile.health.Liveness; +import org.eclipse.microprofile.health.HealthCheck; +import org.eclipse.microprofile.health.HealthCheckResponse; + +@Liveness +public class HelloWorld implements HealthCheck { + @Override + public HealthCheckResponse call() { + return HealthCheckResponse + .named("liveness check") + .build(); + } + + public String helloWorld() { + return "helloWorld"; + } +} diff --git a/liberty-maven-plugin/src/it/binary-scanner-it/resources/basic-dev-project10/src/main/liberty/config/server.xml b/liberty-maven-plugin/src/it/binary-scanner-it/resources/basic-dev-project10/src/main/liberty/config/server.xml new file mode 100755 index 000000000..7256d051f --- /dev/null +++ b/liberty-maven-plugin/src/it/binary-scanner-it/resources/basic-dev-project10/src/main/liberty/config/server.xml @@ -0,0 +1,5 @@ + + + +