JBStrap maven archetypes

Maven archetypes help you create a project structure that contains all the necessary objects and settings. Once you have the project structure, you're set up and ready to start development right away.

Archetypes

There are different JBStrap archetypes available for implementing various tasks. Archetypes can be accessed through the JBStrap Maven repository .

Currently the following archetypes are provided:

Archetype Description
JBStrap-application

Use this archetype to create an application that contains private and public interfaces as well as a database. This archetype is the most common one.

JBStrap-application-without-database

Use this archetype to create an application that contains private and public interfaces, but does not contain a database.

JBStrap-public-application

Use this archetype to create an application that contains public pages only and also a database. No login screen is generated if you use this archetype.

JBStrap-public-application-without-database

Use this archetype to create an application that contains public pages only and does not use a database. No login screen is generated if you use this archetype.

JBStrap-plugin

Use this archetype to create a custom JBStrap plugin. The project you create using this archetype is not a standalone application, you'll have to include it as a plugin in an application.

Before starting to use the archetypes, you have to configure a setting in the Maven repository. To do this, navigate to the local repository folder:

For Windows: C:/Users/[username]/.m2/repository

For Linux and MacOS: $HOME/.m2/repository

If no archetype-catalog.xml exists in the specified folder, you have to create it, and insert the following:

If the archetype-catalog.xml already exists, you need to insert the following, before the </archetypes> tag at the end of the file:

Save the file.

Now you're all set to create JBStrap applications by giving the following commands.

On linux, MacOS Java8:

On Windows Java8:

On linux, MacOS Java9 and above:

On Windows Java9 and above:

The commands include the following:

Name Default Description
groupId -

The groupId of the project. This is a required parameter, because Maven is unable to compile the project without this.

artifactId -

The artifactId of the project. This is a required parameter, because Maven is unable to compile the project without this.

version -

This is the project version. This parameter is required.

package -

The name of the project's main package. The parameter is required. Here we generally specify the groudId and archetypeId values together.

contextRoot Application

The context root of the application to be created. If left unspecified, the default context root is "Application".

applicationName Application

Specify the application name here. It can be any text value. If left unspecified, it takes the default value "Application".

dataDescriptorName ApplicationDD

The DataSource to be used in the project. If left unspecified, it takes the value "ApplicationDS". Use the same name to set DataSource access in the database. The project can only use this setting if you generate the project from an archetype that supports databases.

javaVersion 17 Target java version, which will be included in the pom.xml compilation tag in the generated project. This parameter is only interpreted for Java 9 and above.

JBStrap dependencies

We recommend that you use only one of the provided archetypes to start a project. If you're not considering this option, just include the JBStrap repository in your project and set JBStrap dependencies. You can do this by inserting the following code snippet into the pom.xml file.