Playground: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
 
(13 intermediate revisions by the same user not shown)
Line 4: Line 4:


=New Project=
=New Project=
==New Gradle Project==
gradle-init --help
gradle-init <project-root-path> [path-to-project-to-use-as-template]
gradle-init source code:
{{External|[https://github.com/NovaOrdis/playground/tree/master/project-template-gradle gradle-init Source Code]}}
==New Maven Project==


Use the playground project template:
Use the playground project template:


<blockquote style="background-color: AliceBlue; border: solid thin LightSteelBlue;">
{{External|https://github.com/NovaOrdis/playground/tree/master/project-template}}
:<br>https://github.com/NovaOrdis/playground/tree/master/project-template<br><br>
</blockquote>


This template contains a basic structure and artifacts to be used when starting new playground project. In order to create a new project:
This template contains a basic structure and artifacts to be used when starting new playground project. In order to create a new project:


==1. Recursively copy the template under a new name, and customize it==
===1. Recursively copy the template under a new name, and customize it===


<pre>
<pre>
Line 21: Line 31:
</pre>
</pre>


==2. Edit <tt>pom.xml</tt>==
===2. Edit <tt>pom.xml</tt>===


===<tt>name</tt>===
====<tt>name</tt>====


===<tt>groupId</tt>===
====<tt>groupId</tt>====


The Maven group should follow the playground directory structure:
The Maven group should follow the playground directory structure:


<pre>
     <groupId>io.novaordis.playground.wildfly.hornetq</groupId>
     <groupId>io.novaordis.playground.wildfly.hornetq</groupId>
</pre>


===<tt>artifactId</tt>===
====<tt>artifactId</tt>====


Example:
Example:
    <artifactId>simple-hornetq-client</artifactId>
This will become the IntelliJ project name.
====<tt>finalName</tt>====
====Multi-Module Project====
For a multi-module project, add the following module section to the root pom:
  ...
  <artifactId>root</artifactId>
  <packaging>pom</packaging>
  ...
  <modules>
      <module>...</module>
  </modules>
... and the corresponding sub-module pom.xmls:


<pre>
<pre>
     <artifactId>simple-hornetq-client</artifactId>
<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/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>io.novaordis.playground.jboss.wildfly.global-jboss-valve</groupId>
        <artifactId>root</artifactId>
        <version>1</version>
    </parent>
     <artifactId>global-valve</artifactId>
    <packaging>jar</packaging>
    <build>
        <finalName>global-valve</finalName>
    </build>
</project>
</pre>
</pre>


===<tt>finalName</tt>===
===3. Create the IntelliJ project===


==3. Create the IntelliJ project==
Import Project from Maven.


Import Project from Maven.
Keep project files in <tt>.../.idea</tt>.
 
===4. Edit <tt>README.md</tt>===
 
By default, README contains generic content.


4. Edit <tt>README.md</tt>
It may be changed to contain a link to NOKB page about the subject.


=Operations=
=Operations=
==Run Locally==
Use:
<pre>
./bin/run
</pre>
The script will assemble the classpath automatically and will attempt to guess the main class.
==Deployment/Undeployment==


<pre>
<pre>

Latest revision as of 18:28, 28 June 2018

Reference Assets

Reference operations script: playground/project-template/bin/operations. Works with local and remote servers.

New Project

New Gradle Project

gradle-init --help
gradle-init <project-root-path> [path-to-project-to-use-as-template]

gradle-init source code:

gradle-init Source Code

New Maven Project

Use the playground project template:

https://github.com/NovaOrdis/playground/tree/master/project-template

This template contains a basic structure and artifacts to be used when starting new playground project. In order to create a new project:

1. Recursively copy the template under a new name, and customize it

cp -r .../project-template .../<your-project-name>
cd .../<your-project-name>
rm -r .idea

2. Edit pom.xml

name

groupId

The Maven group should follow the playground directory structure:

   <groupId>io.novaordis.playground.wildfly.hornetq</groupId>

artifactId

Example:

   <artifactId>simple-hornetq-client</artifactId>

This will become the IntelliJ project name.

finalName

Multi-Module Project

For a multi-module project, add the following module section to the root pom:

  ...
  <artifactId>root</artifactId>
  <packaging>pom</packaging>
  ...
  <modules>
     <module>...</module>
  </modules>

... and the corresponding sub-module pom.xmls:

<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/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>io.novaordis.playground.jboss.wildfly.global-jboss-valve</groupId>
        <artifactId>root</artifactId>
        <version>1</version>
    </parent>
    <artifactId>global-valve</artifactId>
    <packaging>jar</packaging>
    <build>
        <finalName>global-valve</finalName>
    </build>
</project>

3. Create the IntelliJ project

Import Project from Maven.

Keep project files in .../.idea.

4. Edit README.md

By default, README contains generic content.

It may be changed to contain a link to NOKB page about the subject.

Operations

Run Locally

Use:

./bin/run

The script will assemble the classpath automatically and will attempt to guess the main class.

Deployment/Undeployment

deploy --help
undeploy --help