Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker javaee #4

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
212 changes: 112 additions & 100 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,117 +1,129 @@
<?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>
<modelVersion>4.0.0</modelVersion>

<groupId>de.chkal.todo</groupId>
<artifactId>todo-mvc</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>war</packaging>
<groupId>de.chkal.todo</groupId>
<artifactId>todo-mvc</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>war</packaging>

<name>todo-mvc</name>
<name>todo-mvc</name>

<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<jersey.version>2.22.2</jersey.version>
</properties>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<jersey.version>2.22.2</jersey.version>
<version.docker-maven-plugin>0.20.0</version.docker-maven-plugin>
</properties>

<build>
<finalName>todo-mvc</finalName>
</build>
<build>
<finalName>todo-mvc</finalName>
</build>

<dependencies>
<dependencies>

<!-- Servlet API -->
<dependency>
<groupId>org.jboss.spec.javax.servlet</groupId>
<artifactId>jboss-servlet-api_3.1_spec</artifactId>
<version>1.0.0.Final</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>javax</groupId>
<artifactId>javaee-web-api</artifactId>
<version>7.0</version>
<scope>provided</scope>
</dependency>


<!-- Required dependencies if you deploy to a plain Servlet container like Tomcat -->
<dependency>
<groupId>org.glassfish.jersey.containers</groupId>
<artifactId>jersey-container-servlet</artifactId>
<version>${jersey.version}</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.ext.cdi</groupId>
<artifactId>jersey-cdi1x</artifactId>
<version>${jersey.version}</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.ext</groupId>
<artifactId>jersey-bean-validation</artifactId>
<version>${jersey.version}</version>
</dependency>
<dependency>
<groupId>javax.enterprise</groupId>
<artifactId>cdi-api</artifactId>
<version>2.0-EDR1</version>
</dependency>
<dependency>
<groupId>org.jboss.weld.servlet</groupId>
<artifactId>weld-servlet-core</artifactId>
<version>3.0.0.Alpha12</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator-cdi</artifactId>
<version>5.2.1.Final</version>
</dependency>
<!-- The MVC API + RI -->
<dependency>
<groupId>javax.mvc</groupId>
<artifactId>javax.mvc-api</artifactId>
<version>20160715</version>
</dependency>
<dependency>
<groupId>org.glassfish.ozark</groupId>
<artifactId>ozark</artifactId>
<version>20160715</version>
</dependency>

<!-- The MVC API + RI -->
<dependency>
<groupId>javax.mvc</groupId>
<artifactId>javax.mvc-api</artifactId>
<version>20160715</version>
</dependency>
<dependency>
<groupId>org.glassfish.ozark</groupId>
<artifactId>ozark</artifactId>
<version>20160715</version>
</dependency>
<!-- This example uses JSP as the view technology -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>

<!-- This example uses JSP as the view technology -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<!-- CSS + JavaScript stuff -->
<dependency>
<groupId>org.webjars.bower</groupId>
<artifactId>jquery</artifactId>
<version>1.11.0</version>
</dependency>
<dependency>
<groupId>org.webjars.bower</groupId>
<artifactId>bootstrap</artifactId>
<version>3.3.4</version>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>bootstrap-datepicker</artifactId>
<version>1.4.0</version>
</dependency>

<!-- CSS + JavaScript stuff -->
<dependency>
<groupId>org.webjars.bower</groupId>
<artifactId>jquery</artifactId>
<version>1.11.0</version>
</dependency>
<dependency>
<groupId>org.webjars.bower</groupId>
<artifactId>bootstrap</artifactId>
<version>3.3.4</version>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>bootstrap-datepicker</artifactId>
<version>1.4.0</version>
</dependency>
</dependencies>

</dependencies>
<repositories>
<repository>
<id>bintray-mvc-spec-maven</id>
<name>bintray</name>
<url>http://dl.bintray.com/mvc-spec/maven</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>

<repositories>
<repository>
<id>bintray-mvc-spec-maven</id>
<name>bintray</name>
<url>http://dl.bintray.com/mvc-spec/maven</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<profiles>
<profile>
<id>payara</id>
<build>
<plugins>
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>${version.docker-maven-plugin}</version>
<configuration>
<images>
<image>
<alias>payara</alias>
<name>chkal/${project.artifactId}:payara</name>
<build>
<maintainer>Ivar Grimstad ([email protected])</maintainer>
<from>payara/server-web:163</from>
<assembly>
<basedir>/opt/payara41/glassfish/domains/domain1/autodeploy/</basedir>
<descriptorRef>artifact</descriptorRef>
</assembly>
<entryPoint>
<arg>/opt/payara41/bin/asadmin</arg>
<arg>start-domain</arg>
<arg>-v</arg>
</entryPoint>
</build>
<run>
<ports>
<port>8083:8080</port>
</ports>
</run>
</image>

</images>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>

</project>
11 changes: 11 additions & 0 deletions src/main/webapp/WEB-INF/glassfish-web.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE glassfish-web-app PUBLIC "-//GlassFish.org//DTD GlassFish Application Server 3.1 Servlet 3.0//EN" "http://glassfish.org/dtds/glassfish-web-app_3_0-1.dtd">
<glassfish-web-app error-url="">
<context-root>/</context-root>
<class-loader delegate="true"/>
<jsp-config>
<property name="keepgenerated" value="true">
<description>Keep a copy of the generated servlet class' java code.</description>
</property>
</jsp-config>
</glassfish-web-app>
5 changes: 1 addition & 4 deletions src/main/webapp/index.jsp
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
<%@ page import="javax.enterprise.inject.spi.CDI" %>
<%@ page import="javax.mvc.MvcContext" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
MvcContext mvc = CDI.current().select(MvcContext.class).get();
response.sendRedirect(mvc.getContextPath() + mvc.getApplicationPath() + "/items");
response.sendRedirect(request.getContextPath() + "/r/items");
%>