https://github.com/interviewstreet/springboot-rest-api-archetype
An archetype which contains a sample Spring Boot REST API project
https://github.com/interviewstreet/springboot-rest-api-archetype
Last synced: over 1 year ago
JSON representation
An archetype which contains a sample Spring Boot REST API project
- Host: GitHub
- URL: https://github.com/interviewstreet/springboot-rest-api-archetype
- Owner: interviewstreet
- Created: 2018-12-26T00:52:42.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-05-29T17:02:16.000Z (about 7 years ago)
- Last Synced: 2025-02-07T23:26:58.403Z (over 1 year ago)
- Language: Shell
- Size: 46.9 KB
- Stars: 0
- Watchers: 81
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# springboot-rest-api-archetype
An archetype which contains a sample Spring Boot REST API project
## Sample Usage
- If the project `groupId`, `artifactId`, and `version` is not specified the default values `com.hackerrank.projects`, `springboot-rest-api-sample`, and `1.0.0-SNAPSHOT` respectively are used:
```bash
mvn archetype:generate \
-DarchetypeGroupId=com.hackerrank.archetypes \
-DarchetypeArtifactId=springboot-rest-api \
-DarchetypeVersion=1.0.0
```
The generated project strucure is:
```text
springboot-rest-api-sample
├── pom.xml
└── src
├── main
│ ├── java
│ │ └── com
│ │ └── hackerrank
│ │ └── projects
│ │ ├── Application.java
│ │ └── controllers
│ │ └── GreetingsController.java
│ └── resources
│ └── application.properties
└── test
└── java
└── com
└── hackerrank
└── projects
└── requests
└── GreetingsControllerTest.java
```
The POM configuration is:
```xml
com.hackerrank.projects
springboot-rest-api-sample
1.0
jar
```
- The project `groupId`, `artifactId`, and `version` could also be specified:
```bash
mvn archetype:generate \
-DarchetypeGroupId=com.hackerrank.archetypes \
-DarchetypeArtifactId=springboot-rest-api \
-DarchetypeVersion=1.0.0 \
-DgroupId=my.group.id \
-DartifactId=my-artifact-id \
-Dversion=1.0
```
```text
my-artifact-id
├── pom.xml
└── src
├── main
│ ├── java
│ │ └── my
│ │ └── group
│ │ └── id
│ │ ├── Application.java
│ │ └── controllers
│ │ └── GreetingsController.java
│ └── resources
│ └── application.properties
└── test
└── java
└── my
└── group
└── id
└── requests
└── GreetingsControllerTest.java
```
The POM configuration is:
```xml
my.group.id
my-artifact-id
1.0
jar
```
## Archetype Testing
The archetype testing is done using the `maven archetype plugin`. The tests are present in `src/test/resources/projects` directory. The first test validates the project generation and runs code style checks and the second test validates build success by running tests on the generated project.
```text
src/test/resources/projects
├── checkstyle
│ ├── archetype.properties
│ ├── goal.txt
│ └── verify.bsh
├── package
│ ├── archetype.properties
│ ├── goal.txt
│ └── verify.bsh
└── settings.xml
```