This clickstart sets up a build service, repository and a basic GlassFish app with continuous deployment. All built by maven.
Launch this clickstart and glory could be yours too ! Use it as a building block if you like. You can launch this on Cloudbees via a clickstart automatically, or follow the instructions below.
This is based on the GlassFish stack that you can read more about here.
bees app:create -a my-glassfish4-app -t glassfish4-full
bees db:create my-glassfish4-db
bees app:bind -a my-glassfish4-app -db my-glassfish4-db -as mydb
Supported JNDI names:
jdbc/mydb
: unqualified relative JNDI name is supported / OKjava:comp/env/jdbc/mydb
: qualified private name is supported / OKandjava:jdbc/mydb
: qualified relative names are not supported by Glassfish / KOjava:/jdbc/mydb
: qualified global name is not supported by Glassfish / KOjava:global/env/jdbc/mydb
Samples:
Context ctx = new InitialContext();
DataSource ds = (DataSource) ctx.lookup("jdbc/mydb");
DataSource ds = (DataSource) ctx.lookup("java:comp/env/jdbc/mydb");
bees config:set -a my-glassfish4-app -R glassfish4.auth-realm.database=mydb
bees app:deploy -a my-glassfish4-app path/to/my/app.war
Create a new Maven project in Jenkins, changing the following:
-
Add this git repository (or yours, with this code) on Jenkins
-
Also check "Deploy to CloudBees" with those parameters:
Applications: First Match Application Id: MYAPP_ID Filename Pattern: target/*.war
where MYAPP_ID
is the name of your application.
- The JMS sample relies on JMS2 features
- The
localdomain.localhost.JavaEEResourceDefinition
creates a JMS Queue (see the usage of the @JMSDestinationDefinition annotation) - The
localdomain.localhost.jms.MyQueueProducer
sends message at a fixed interval - The
localdomain.localhost.jms.MyQueueMdb
Message Driven Bean receives the JMS messages