https://github.com/dervism/java-archetype
Archetype for generating minimal Java projects with configuration for enabling/disabling preview features.
https://github.com/dervism/java-archetype
archetype archetype-java java maven
Last synced: 9 months ago
JSON representation
Archetype for generating minimal Java projects with configuration for enabling/disabling preview features.
- Host: GitHub
- URL: https://github.com/dervism/java-archetype
- Owner: dervism
- License: mit
- Created: 2020-12-06T20:52:37.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2024-09-17T16:34:02.000Z (over 1 year ago)
- Last Synced: 2024-09-18T16:41:16.411Z (over 1 year ago)
- Topics: archetype, archetype-java, java, maven
- Language: Shell
- Homepage:
- Size: 55.7 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# A simple Maven Archetype for Java

Generates a minimal Maven project for Java with
- JDK 23 (or any version you specify, read below)
- JUnit 5.10.x
## How to use
### Selecting Java version
Change the `jdkVersion` property to change the JDK version. Default value is currently `22`.
### Activate/deactivate Java preview features
Change the `javaPreviewFeatures` property to `no` or `n` if you want to disable preview features. Default value is `yes`, which means this archetype will generate a `pom.xml` file that allows you to use the newest preview features of Java.
### Generating a new Java project from CLI
Change the values of `DgroupId`, `-DartifactId` and `-Dversion` to match your own project details. These properties are required. `archetypeGroupId`, `archetypeArtifactId` and `archetypeVersion` must remain as is.
```
mvn archetype:generate -DarchetypeGroupId=no.dervis \
-DarchetypeArtifactId=java-starter \
-DarchetypeVersion=1.0.13 \
-DgroupId=org.mygroup \
-DartifactId=demoapp \
-Dversion=1.0.0 \
-DjdkVersion=23 \
-DjavaPreviewFeatures=yes \
-DinteractiveMode=false
```
### Maven Central
[https://central.sonatype.com/artifact/no.dervis/java-starter/1.0.13](https://central.sonatype.com/artifact/no.dervis/java-starter/1.0.13)
### Useful Maven commands for beginners
#### Clean and compile
- mvn clean compile
#### Clean, compile and install
- mvn clean install
#### Check if there is newer versions of your dependencies
- mvn versions:display-dependency-updates
#### Upgrade snapshot versions to the closest release
- mvn versions:use-releases
#### Updating dependencies to the next version
- mvn versions:use-next-releases
#### Updating dependencies to the latest version
- mvn versions:use-latest-releases