-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[issue 80] - Adding a new shared deployments module for EAP 7 and an …
…eap7-helloworld shared deployment
- Loading branch information
Showing
7 changed files
with
227 additions
and
0 deletions.
There are no files selected for viewing
44 changes: 44 additions & 0 deletions
44
.../intersmash-deployments-shared/intersmash-deployments-shared-eap7/eap7-helloworld/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,44 @@ | ||
<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>org.jboss.intersmash</groupId> | ||
<artifactId>intersmash-deployments-shared-eap7</artifactId> | ||
<version>0.0.1-SNAPSHOT</version> | ||
<relativePath>../pom.xml</relativePath> | ||
</parent> | ||
|
||
<artifactId>eap7-helloworld</artifactId> | ||
<packaging>war</packaging> | ||
|
||
<name>Intersmash Shared Deployments (EAP 7): Hello World Quickstart</name> | ||
|
||
<dependencies> | ||
<!-- Import the CDI API, we use provided scope as the API is included in WildFly --> | ||
<dependency> | ||
<groupId>jakarta.inject</groupId> | ||
<artifactId>jakarta.inject-api</artifactId> | ||
<scope>provided</scope> | ||
</dependency> | ||
<!-- Import the Servlet API, we use provided scope as the API is included in WildFly --> | ||
<dependency> | ||
<groupId>org.jboss.spec.javax.servlet</groupId> | ||
<artifactId>jboss-servlet-api_4.0_spec</artifactId> | ||
<scope>provided</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-war-plugin</artifactId> | ||
<configuration> | ||
<warName>ROOT</warName> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
31 changes: 31 additions & 0 deletions
31
...-eap7/eap7-helloworld/src/main/java/org/jboss/as/quickstarts/helloworld/HelloService.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,31 @@ | ||
/* | ||
* JBoss, Home of Professional Open Source | ||
* Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual | ||
* contributors by the @authors tag. See the copyright.txt in the | ||
* distribution for a full listing of individual contributors. | ||
* | ||
* 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 org.jboss.as.quickstarts.helloworld; | ||
|
||
/** | ||
* A simple CDI service which is able to say hello to someone | ||
* | ||
* @author Pete Muir | ||
* | ||
*/ | ||
public class HelloService { | ||
|
||
String createHelloMessage(String name) { | ||
return "Hello " + name + "!"; | ||
} | ||
|
||
} |
62 changes: 62 additions & 0 deletions
62
.../eap7-helloworld/src/main/java/org/jboss/as/quickstarts/helloworld/HelloWorldServlet.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,62 @@ | ||
/* | ||
* JBoss, Home of Professional Open Source | ||
* Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual | ||
* contributors by the @authors tag. See the copyright.txt in the | ||
* distribution for a full listing of individual contributors. | ||
* | ||
* 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 org.jboss.as.quickstarts.helloworld; | ||
|
||
import java.io.IOException; | ||
import java.io.PrintWriter; | ||
|
||
import javax.inject.Inject; | ||
import javax.servlet.annotation.WebServlet; | ||
import javax.servlet.http.HttpServlet; | ||
import javax.servlet.http.HttpServletRequest; | ||
import javax.servlet.http.HttpServletResponse; | ||
|
||
/** | ||
* <p> | ||
* A simple servlet taking advantage of features added in 3.0. | ||
* </p> | ||
* | ||
* <p> | ||
* The servlet is registered and mapped to /HelloServlet using the {@linkplain WebServlet | ||
* @HttpServlet}. The {@link HelloService} is injected by CDI. | ||
* </p> | ||
* | ||
* @author Pete Muir | ||
* | ||
*/ | ||
@SuppressWarnings("serial") | ||
@WebServlet("/HelloWorld") | ||
public class HelloWorldServlet extends HttpServlet { | ||
|
||
static String PAGE_HEADER = "<html><head><title>helloworld</title></head><body>"; | ||
|
||
static String PAGE_FOOTER = "</body></html>"; | ||
|
||
@Inject | ||
HelloService helloService; | ||
|
||
@Override | ||
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { | ||
resp.setContentType("text/html"); | ||
PrintWriter writer = resp.getWriter(); | ||
writer.println(PAGE_HEADER); | ||
writer.println("<h1>" + helloService.createHelloMessage("World") + "</h1>"); | ||
writer.println(PAGE_FOOTER); | ||
writer.close(); | ||
} | ||
|
||
} |
22 changes: 22 additions & 0 deletions
22
...ared/intersmash-deployments-shared-eap7/eap7-helloworld/src/main/webapp/WEB-INF/beans.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,22 @@ | ||
<!-- | ||
JBoss, Home of Professional Open Source | ||
Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual | ||
contributors by the @authors tag. See the copyright.txt in the | ||
distribution for a full listing of individual contributors. | ||
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. | ||
--> | ||
<!-- Marker file indicating CDI should be enabled --> | ||
<beans xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/beans_1_1.xsd" | ||
bean-discovery-mode="all"> | ||
</beans> | ||
|
23 changes: 23 additions & 0 deletions
23
...ents-shared/intersmash-deployments-shared-eap7/eap7-helloworld/src/main/webapp/index.html
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,23 @@ | ||
<!-- | ||
JBoss, Home of Professional Open Source | ||
Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual | ||
contributors by the @authors tag. See the copyright.txt in the | ||
distribution for a full listing of individual contributors. | ||
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. | ||
--> | ||
<!-- Plain HTML page that kicks us into the app --> | ||
|
||
<html> | ||
<head> | ||
<meta http-equiv="Refresh" content="0; URL=HelloWorld"> | ||
</head> | ||
</html> |
44 changes: 44 additions & 0 deletions
44
deployments/intersmash-deployments-shared/intersmash-deployments-shared-eap7/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,44 @@ | ||
<?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>org.jboss.intersmash</groupId> | ||
<artifactId>intersmash-deployments-shared</artifactId> | ||
<version>0.0.1-SNAPSHOT</version> | ||
</parent> | ||
<packaging>pom</packaging> | ||
|
||
<artifactId>intersmash-deployments-shared-eap7</artifactId> | ||
|
||
<properties> | ||
<!-- EAP 7 deployments must run on JDK 8 too --> | ||
<maven.compiler.source>1.8</maven.compiler.source> | ||
<maven.compiler.target>1.8</maven.compiler.target> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
<!-- Default EAP 7 version --> | ||
<jboss-eap7.version>7.4.13.GA</jboss-eap7.version> | ||
<!-- Default EAP `ee` BOMs version is set here for pulling the right EAP BOM --> | ||
<bom.jboss-eap7-jakartaee.groupId>org.jboss.bom</bom.jboss-eap7-jakartaee.groupId> | ||
<bom.jboss-eap7jakartaee.artifactId>jboss-eap-jakartaee8</bom.jboss-eap7jakartaee.artifactId> | ||
<bom.jboss-eap7-jakartaee.version>${jboss-eap7.version}</bom.jboss-eap7-jakartaee.version> | ||
</properties> | ||
|
||
<modules> | ||
<module>eap7-helloworld</module> | ||
</modules> | ||
|
||
<dependencyManagement> | ||
<dependencies> | ||
<!-- Lock all the provided dependencies to match the WildFly/EAP version --> | ||
<dependency> | ||
<groupId>${bom.jboss-eap7-jakartaee.groupId}</groupId> | ||
<artifactId>${bom.jboss-eap7jakartaee.artifactId}</artifactId> | ||
<version>${bom.jboss-eap7-jakartaee.version}</version> | ||
<type>pom</type> | ||
<scope>import</scope> | ||
</dependency> | ||
</dependencies> | ||
</dependencyManagement> | ||
</project> |
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