Playground: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
 
(8 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:


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


This will become the IntelliJ project name.
This will become the IntelliJ project name.


===<tt>finalName</tt>===
====<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>
<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>


==3. Create the IntelliJ project==
===3. Create the IntelliJ project===


Import Project from Maven.
Import Project from Maven.
Line 51: Line 87:
Keep project files in <tt>.../.idea</tt>.
Keep project files in <tt>.../.idea</tt>.


==4. Edit <tt>README.md</tt>==
===4. Edit <tt>README.md</tt>===


By default, README contains generic content.
By default, README contains generic content.

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