An open API service indexing awesome lists of open source software.

https://github.com/cuioss/cui-java-module-template

Template repository for sinple java modules
https://github.com/cuioss/cui-java-module-template

java template

Last synced: about 1 month ago
JSON representation

Template repository for sinple java modules

Awesome Lists containing this project

README

          

= cui-java-module-template

== Status

image:https://github.com/cuioss/cui-java-module-template/actions/workflows/maven.yml/badge.svg[Java CI with Maven,link=https://github.com/cuioss/cui-java-module-template/actions/workflows/maven.yml]
image:http://img.shields.io/:license-apache-blue.svg[License,link=http://www.apache.org/licenses/LICENSE-2.0.html]
image:https://img.shields.io/maven-central/v/de.cuioss/cui-java-module-template.svg?label=Maven%20Central["Maven Central", link="https://central.sonatype.com/artifact/de.cuioss/cui-java-module-template"]

https://sonarcloud.io/summary/new_code?id=cuioss_cui-java-module-template[image:https://sonarcloud.io/api/project_badges/measure?project=cuioss_cui-java-module-template&metric=alert_status[Quality
Gate Status]]
image:https://sonarcloud.io/api/project_badges/measure?project=cuioss_cui-java-module-template&metric=ncloc[Lines of Code,link=https://sonarcloud.io/summary/new_code?id=cuioss_cui-java-module-template]
image:https://sonarcloud.io/api/project_badges/measure?project=cuioss_cui-java-module-template&metric=coverage[Coverage,link=https://sonarcloud.io/summary/new_code?id=cuioss_cui-java-module-template]

https://cuioss.github.io/cui-java-module-template/about.html[Generated Documentation on github-pages]

== What is it?

This is a template repository for creating java-modules for cui-open-source-projects. This incorporates all necessary java-structures, including `pom.xml`, sensible project-documentation,
an predefined github pipelines.

It is meant to be used as copy-paste-template.

=== Maven Coordinates

[source,xml]
----

de.cuioss
cui-java-module-template

----

== Customization

=== Automated Customization

This template provides an automated customization process to easily update all relevant project files:

1. Configure your project properties in `customization.properties`
2. Run the customization script: `./customize.sh`

The script will update all required files with your project-specific information.

After running the script, you can review the changes in your git repository. The script will not commit or push any changes automatically, allowing you to verify them first.

After reviewing the changes,
you delete the files `customization.properties` and `./customize.sh` you can commit them to your repository.

=== Names / Keys

Create a new Repository by clicking "Use this template"
If not using the automated customization process, manually replace all occurrences of `cui-java-module-template` with the new project 'key' / name, e.g. `my-java-module`. Relevant Files are:

[CAUTION]
====
The key must *not* contain spaces. They are used for creating urls as well.

====

* `README.adoc` -> the badges on top
* `pom.xml`
* `SECURITY.adoc`
* `.github/project.yml`
* `src/site/site.xml`
* `src/site/asciidoc/about.adoc`

=== Credentials

All secrets (GPG, Sonatype, Sonar, Pages, Release App) are managed at the https://github.com/cuioss/cuioss-organization[cuioss organization level] and inherited automatically via `secrets: inherit` in the reusable workflows. No repo-level secrets need to be configured.

=== Further Steps

* Verify that the customization was applied correctly to all files
* If you're using manual customization:
** `pom.xml`: Adjust `name` and `description` elements
** Adjust `module-info` accordingly
** `pom.xml`: Adjust property `maven.jar.plugin.automatic.module.name` according to your `module-info`
* `src/site/asciidoc/about.adoc`: Adjust content
* Review / Enable the elements under 'Security' Tab
* Review / Add Collaborators
* Add (link) the resulting maven-documentation: https://github.com/cuioss/cuioss.github.io/edit/main/README.md[github.io-documentation]

=== Customization Properties

The `customization.properties` file controls how the project is customized:

[source,properties]
----
# Used in pom.xml (artifactId), README.adoc (badges), .github/project.yml (name, pages-reference) src/site/site.xml (links), SECURITY.md (links)
project.key=cui-java-module-template

# Used in pom.xml ( tag)
project.name=cui java module template

# Used in pom.xml ( tag)
project.description=Template module for cuioss open source projects.

# Used in pom.xml (property maven.jar.plugin.automatic.module.name)
project.moduleName=de.cuioss.template

# Used in pom.xml (groupId, README.adoc (badges))
project.groupId=de.cuioss
----

The script automatically derives additional properties:
* `project.scm.url` - SCM URL based on the project key
* `project.pages.url` - GitHub Pages URL based on the project key
* `project.sonar.id` - Sonar ID based on the project key