-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1655 from cherylking/handleVarsInAppLocation
Resolve variables in app location and fix app configuration validation logic
- Loading branch information
Showing
26 changed files
with
877 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
...maven-plugin/src/it/appsdirectory-apps-configured-variables-include-it/invoker.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# prove the variables in server.xml can be resolved correctly | ||
invoker.goals.1 = clean liberty:create resources:copy-resources install |
217 changes: 217 additions & 0 deletions
217
liberty-maven-plugin/src/it/appsdirectory-apps-configured-variables-include-it/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,217 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>io.openliberty.tools.it</groupId> | ||
<artifactId>tests</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
</parent> | ||
|
||
<artifactId>appsdirectory-apps-configured-variables-include-it</artifactId> | ||
<packaging>war</packaging> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.apache.geronimo.specs</groupId> | ||
<artifactId>geronimo-servlet_3.0_spec</artifactId> | ||
<version>1.0</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>commons-logging</groupId> | ||
<artifactId>commons-logging</artifactId> | ||
<version>1.0.4</version> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>junit</groupId> | ||
<artifactId>junit</artifactId> | ||
<version>4.13.1</version> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<finalName>${project.artifactId}</finalName> | ||
<filters> | ||
<filter>${project.basedir}/src/main/filters/test.properties</filter> | ||
</filters> | ||
|
||
<pluginManagement> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-war-plugin</artifactId> | ||
<version>3.3.2</version> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-failsafe-plugin</artifactId> | ||
<version>2.5</version> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-surefire-plugin</artifactId> | ||
<version>2.5</version> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.felix</groupId> | ||
<artifactId>maven-bundle-plugin</artifactId> | ||
<version>2.3.7</version> | ||
</plugin> | ||
</plugins> | ||
</pluginManagement> | ||
<plugins> | ||
<plugin> | ||
<artifactId>maven-war-plugin</artifactId> | ||
<configuration> | ||
<archive> | ||
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile> | ||
</archive> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.felix</groupId> | ||
<artifactId>maven-bundle-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<id>bundle-manifest</id> | ||
<phase>process-classes</phase> | ||
<goals> | ||
<goal>manifest</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
<configuration> | ||
<supportedProjectTypes> | ||
<supportedProjectType>war</supportedProjectType> | ||
</supportedProjectTypes> | ||
<instructions> | ||
<Web-ContextPath>/test-wab</Web-ContextPath> | ||
<Bundle-ClassPath>WEB-INF/classes</Bundle-ClassPath> | ||
<Import-Package> | ||
javax.servlet.jsp.el, | ||
javax.servlet.jsp, | ||
javax.servlet.jsp.tagext, | ||
* | ||
</Import-Package> | ||
</instructions> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>io.openliberty.tools</groupId> | ||
<artifactId>liberty-maven-plugin</artifactId> | ||
<version>@pom.version@</version> | ||
<extensions>true</extensions> | ||
<configuration> | ||
<stripVersion>true</stripVersion> | ||
<assemblyArtifact> | ||
<groupId>${project.groupId}</groupId> | ||
<artifactId>assembly-server</artifactId> | ||
<version>${project.version}</version> | ||
<type>zip</type> | ||
</assemblyArtifact> | ||
<serverName>test</serverName> | ||
<looseApplication>false</looseApplication> | ||
</configuration> | ||
<executions> | ||
<execution> | ||
<id>install-artifact</id> | ||
<phase>package</phase> | ||
<goals> | ||
<goal>deploy</goal> | ||
</goals> | ||
<configuration> | ||
<looseApplication>false</looseApplication> | ||
<appsDirectory>apps</appsDirectory> | ||
<stripVersion>true</stripVersion> | ||
</configuration> | ||
</execution> | ||
<execution> | ||
<id>start-server</id> | ||
<phase>pre-integration-test</phase> | ||
<goals> | ||
<goal>start</goal> | ||
</goals> | ||
</execution> | ||
<execution> | ||
<id>clean-server</id> | ||
<phase>post-integration-test</phase> | ||
<goals> | ||
<goal>stop</goal> | ||
<!-- goal>clean</goal --> | ||
</goals> | ||
<configuration> | ||
<cleanDropins>false</cleanDropins> | ||
<cleanApps>false</cleanApps> | ||
<cleanLogs>false</cleanLogs> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-resources-plugin</artifactId> | ||
<version>3.2.0</version> | ||
<executions> | ||
<execution> | ||
<id>default-cli</id> | ||
<phase>none</phase> | ||
<goals> | ||
<goal>copy-resources</goal> | ||
</goals> | ||
<configuration> | ||
<overwrite>true</overwrite> | ||
<!-- This location can persist across a server recreate, where the refresh can annoyingly wipe out your earlier copy --> | ||
<outputDirectory>target/liberty/usr/shared/config</outputDirectory> | ||
<resources> | ||
<resource> | ||
<directory>src/main/filtered-config</directory> | ||
<filtering>true</filtering> | ||
</resource> | ||
</resources> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-failsafe-plugin</artifactId> | ||
<configuration> | ||
<redirectTestOutputToFile>true</redirectTestOutputToFile> | ||
<forkMode>once</forkMode> | ||
<forkedProcessTimeoutInSeconds>300</forkedProcessTimeoutInSeconds> | ||
<argLine>-enableassertions</argLine> | ||
<workingDirectory>${project.build.directory}</workingDirectory> | ||
<includes> | ||
<include>**/*Test.java</include> | ||
</includes> | ||
</configuration> | ||
<executions> | ||
<execution> | ||
<id>integration-test</id> | ||
<goals> | ||
<goal>integration-test</goal> | ||
</goals> | ||
</execution> | ||
<execution> | ||
<id>verify</id> | ||
<phase>verify</phase> | ||
<goals> | ||
<goal>verify</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-surefire-plugin</artifactId> | ||
<configuration> | ||
<skip>true</skip> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
19 changes: 19 additions & 0 deletions
19
...plugin/src/it/appsdirectory-apps-configured-variables-include-it/src/main/WEB-INF/web.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<web-app xmlns="http://java.sun.com/xml/ns/javaee" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" | ||
metadata-complete="false" | ||
version="2.5"> | ||
|
||
<servlet> | ||
<display-name>TestServlet</display-name> | ||
<servlet-name>TestServlet</servlet-name> | ||
<servlet-class>net.wasdev.wlp.test.servlet.TestServlet</servlet-class> | ||
</servlet> | ||
|
||
<servlet-mapping> | ||
<servlet-name>TestServlet</servlet-name> | ||
<url-pattern>/TestServlet</url-pattern> | ||
<url-pattern>/TestServlet/*</url-pattern> | ||
</servlet-mapping> | ||
|
||
</web-app> |
4 changes: 4 additions & 0 deletions
4
...psdirectory-apps-configured-variables-include-it/src/main/filtered-config/environment.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<server description="environment"> | ||
<variable name="tidal.url" value="${tidal.url}"/> | ||
<variable name="project.artifactId" value="${project.artifactId}"/> | ||
</server> |
1 change: 1 addition & 0 deletions
1
...rc/it/appsdirectory-apps-configured-variables-include-it/src/main/filters/test.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
tidal.url=http://test.ibm.com:9080 |
24 changes: 24 additions & 0 deletions
24
...onfigured-variables-include-it/src/main/java/net/wasdev/wlp/test/servlet/TestServlet.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package net.wasdev.wlp.test.servlet; | ||
|
||
import java.io.IOException; | ||
import java.io.PrintWriter; | ||
import javax.servlet.ServletException; | ||
import javax.servlet.http.HttpServlet; | ||
import javax.servlet.http.HttpServletRequest; | ||
import javax.servlet.http.HttpServletResponse; | ||
|
||
public class TestServlet extends HttpServlet { | ||
|
||
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { | ||
doPost(request,response); | ||
} | ||
|
||
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { | ||
PrintWriter out = response.getWriter(); | ||
out.println("<html><head><title>Sample Wab Application Bundle</title></head></html>"); | ||
out.println("<body><h1>"); | ||
out.println("Web Application Bundle"); | ||
out.println("</h1></body></html>"); | ||
} | ||
|
||
} |
10 changes: 10 additions & 0 deletions
10
.../it/appsdirectory-apps-configured-variables-include-it/src/main/liberty/config/server.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<server description="default server"> | ||
<featureManager> | ||
<feature>jsp-2.3</feature> | ||
</featureManager> | ||
|
||
<include location="${shared.config.dir}/environment.xml"/> | ||
|
||
<!-- webApplication location="${project.artifactId}.war"/ --> | ||
<webApplication location="${server.config.dir}/apps/${project.artifactId}.war"/> | ||
</server> |
11 changes: 11 additions & 0 deletions
11
...lugin/src/it/appsdirectory-apps-configured-variables-include-it/src/main/webapp/index.jsp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<%@ page contentType="text/html;charset=UTF-8" language="java" %> | ||
<html> | ||
<head> | ||
<jsp:useBean id="datetime" class="java.util.Date" /> | ||
<title>Hello IBM WebSphere Application Server Liberty</title> | ||
</head> | ||
<body> | ||
<h2>Welcome to IBM Liberty</h2> | ||
<p>Congratulations on running this very simple demo application on ${datetime}.</p> | ||
</body> | ||
</html> |
Oops, something went wrong.