Skip to content

Commit b0a5838

Browse files
authored
build: switch project from formatter-maven-plugin to spotless-maven-plugin (#287)
Signed-off-by: David Sondermann <[email protected]>
1 parent 0bd1c46 commit b0a5838

File tree

9 files changed

+887
-814
lines changed

9 files changed

+887
-814
lines changed

.github/workflows/pr.yml

+2-3
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ jobs:
2727
cache: 'maven'
2828
- name: Check code format
2929
run: |
30-
./mvnw ${MAVEN_ARGS} formatter:validate -Dconfigfile=$PWD/contributing/eclipse-google-style.xml --file pom.xml
31-
./mvnw ${MAVEN_ARGS} impsort:check --file pom.xml
30+
./mvnw ${MAVEN_ARGS} spotless:check --file pom.xml
3231
- name: Run unit tests
3332
run: ./mvnw ${MAVEN_ARGS} -B test --file pom.xml
3433
spring-boot-e2e-tests:
@@ -92,4 +91,4 @@ jobs:
9291
./mvnw clean install -DskipTests
9392
cd samples/quarkus
9493
./mvnw install -Dquarkus.container-image.build=true -DskipTests
95-
./mvnw ${MAVEN_ARGS} test -Pend-to-end-tests
94+
./mvnw ${MAVEN_ARGS} test -Pend-to-end-tests

CONTRIBUTING.md

+98
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
# Contributing Guidelines
2+
3+
## How to contribute to kubernetes-webhooks-framework
4+
5+
We'd love to accept your patches! Since we **♥︎♥︎ LOVE ♥︎♥︎** Contributors and Contributions :-)
6+
7+
You can start contributing to this project by following the below guidelines:-
8+
9+
(We are assuming you know about git like resolving merge conflicts, squash, setting remote etc.)
10+
11+
### Getting Source Code
12+
13+
* Get the source code by doing a fork and then using the below command
14+
```
15+
git clone https://github.com/your_github_username/josdk-webhooks.git
16+
```
17+
18+
* If you want to build/run the project, use command
19+
```
20+
mvn clean install
21+
```
22+
23+
### Starting Development
24+
25+
Now you can start your contribution work.
26+
27+
#### * Finding the issue
28+
29+
There are lots of issues on kubernetes-webhooks-framework's [issue page](https://github.com/operator-framework/josdk-webhooks/issues). Please go through the issues and find a one which you want to fix/develop. If you want to implement something which is not there in the issues, please create a new issue. Please assign that new issue or already existing issue to yourself otherwise it may happen that someone else will fix the same issue.
30+
31+
#### Creating a new branch
32+
33+
Please create a new branch to start your development work. You can create the branch by any name but we will suggest you consider the naming convention like iss_issueNumber. Example - iss_989
34+
35+
```
36+
git checkout -b iss_issueNumber
37+
```
38+
39+
#### Create your PATCH
40+
41+
Do all your development or fixing work here.
42+
43+
#### Adding Unit and Regression Tests
44+
45+
After all your development/fixing work is done, do not forget to add `Unit Test` and `Regression Test` around that. It will be nice if you can add an example of the new feature you have added.
46+
47+
#### Check your work after running all Unit and Regression Tests
48+
49+
You should run all the unit tests by hitting the following command
50+
51+
```shell
52+
mvn clean install
53+
```
54+
55+
#### Commit your work
56+
57+
After all your work is done, you need to commit the changes.
58+
```
59+
git commit -am "Commit-Message"
60+
```
61+
Please add a very elaborative [commit message](https://www.conventionalcommits.org/en/v1.0.0/) for the work you have done. It will help the reviewer to understand the things quickly.
62+
63+
#### Rebase the PR
64+
65+
It may happen that during the development, someone else submitted another PATCH that is merged before yours. You need to rebase your branch with current upstream master.
66+
67+
#### Build the project
68+
69+
Before sending the PR, check whether everything is working fine. To build the project and run test
70+
```shell
71+
mvn clean install
72+
```
73+
74+
#### Format the files that you touched
75+
76+
```shell
77+
mvn spotless:apply
78+
```
79+
80+
#### Push the changes to your fork
81+
82+
```shell
83+
git push origin iss_issueNumber
84+
```
85+
86+
#### Create a Pull Request
87+
88+
Please create a Pull Request from GitHub to kubernetes-webhooks-framework:main. Do not forget to provide very brief Title and elaborative description of PR. Please link the PR to issue by adding `Fix #issueNumber` at the end of the description.
89+
90+
### PR Review
91+
92+
Your PR will get reviewed soon from the maintainers of the project. If they suggest changes, do all the changes, commit the changes, rebase the branch, squash the commits and push the changes. If all will be fine, your PR will be merged.
93+
94+
That's it! Thank you for your contribution!
95+
96+
### Note
97+
98+
Contribution can be very small, that does not matter. We even love to receive a typo fix PR. Adding feature or fixing a bug is not the only way to contribute. You can send us PR for adding documentation, fixing typos or adding tests.

core/pom.xml

+36-40
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<project xmlns="http://maven.apache.org/POM/4.0.0"
3-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
2+
<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/xsd/maven-4.0.0.xsd">
53
<modelVersion>4.0.0</modelVersion>
64
<parent>
75
<groupId>io.javaoperatorsdk</groupId>
@@ -10,44 +8,8 @@
108
</parent>
119

1210
<artifactId>kubernetes-webhooks-framework-core</artifactId>
13-
<name>Kubernetes Webhooks Framework - Core</name>
1411
<packaging>jar</packaging>
15-
16-
<build>
17-
<plugins>
18-
<plugin>
19-
<groupId>org.apache.maven.plugins</groupId>
20-
<artifactId>maven-surefire-plugin</artifactId>
21-
</plugin>
22-
<plugin>
23-
<!-- Used to generate the version / commit information -->
24-
<groupId>io.github.git-commit-id</groupId>
25-
<artifactId>git-commit-id-maven-plugin</artifactId>
26-
<version>${git-commit-id-maven-plugin.version}</version>
27-
<executions>
28-
<execution>
29-
<id>get-the-git-infos</id>
30-
<goals>
31-
<goal>revision</goal>
32-
</goals>
33-
<phase>initialize</phase>
34-
</execution>
35-
</executions>
36-
<configuration>
37-
<generateGitPropertiesFile>true</generateGitPropertiesFile>
38-
<generateGitPropertiesFilename>${project.build.outputDirectory}/version.properties
39-
</generateGitPropertiesFilename>
40-
<includeOnlyProperties>
41-
<includeOnlyProperty>^git.build.(time|version)$</includeOnlyProperty>
42-
<includeOnlyProperty>^git.commit.id.(abbrev|full)$</includeOnlyProperty>
43-
<includeOnlyProperty>git.branch</includeOnlyProperty>
44-
</includeOnlyProperties>
45-
<commitIdGenerationMode>full</commitIdGenerationMode>
46-
</configuration>
47-
</plugin>
48-
</plugins>
49-
</build>
50-
12+
<name>Kubernetes Webhooks Framework - Core</name>
5113

5214
<dependencies>
5315
<dependency>
@@ -105,4 +67,38 @@
10567
<scope>test</scope>
10668
</dependency>
10769
</dependencies>
70+
71+
<build>
72+
<plugins>
73+
<plugin>
74+
<groupId>org.apache.maven.plugins</groupId>
75+
<artifactId>maven-surefire-plugin</artifactId>
76+
</plugin>
77+
<plugin>
78+
<!-- Used to generate the version / commit information -->
79+
<groupId>io.github.git-commit-id</groupId>
80+
<artifactId>git-commit-id-maven-plugin</artifactId>
81+
<version>${git-commit-id-maven-plugin.version}</version>
82+
<configuration>
83+
<generateGitPropertiesFile>true</generateGitPropertiesFile>
84+
<generateGitPropertiesFilename>${project.build.outputDirectory}/version.properties</generateGitPropertiesFilename>
85+
<includeOnlyProperties>
86+
<includeOnlyProperty>^git.build.(time|version)$</includeOnlyProperty>
87+
<includeOnlyProperty>^git.commit.id.(abbrev|full)$</includeOnlyProperty>
88+
<includeOnlyProperty>git.branch</includeOnlyProperty>
89+
</includeOnlyProperties>
90+
<commitIdGenerationMode>full</commitIdGenerationMode>
91+
</configuration>
92+
<executions>
93+
<execution>
94+
<id>get-the-git-infos</id>
95+
<goals>
96+
<goal>revision</goal>
97+
</goals>
98+
<phase>initialize</phase>
99+
</execution>
100+
</executions>
101+
</plugin>
102+
</plugins>
103+
</build>
108104
</project>

0 commit comments

Comments
 (0)