Skip to content

Commit 31201de

Browse files
committed
Fix GH actions setup and readme.
1 parent d040226 commit 31201de

File tree

3 files changed

+27
-251
lines changed

3 files changed

+27
-251
lines changed

.github/workflows/maven.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ name: Build
55

66
on:
77
push:
8-
branches: [ main ]
8+
branches: [ 4.0.x ]
99
pull_request:
10-
branches: [ main ]
10+
branches: [ 4.0.x ]
1111

1212
jobs:
1313
build:

README.adoc

Lines changed: 21 additions & 245 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ Edit the files in the src/main/asciidoc/ directory instead.
55
////
66

77

8-
image::https://github.com/spring-cloud/spring-cloud-openfeign/workflows/Build/badge.svg?branch=main&style=svg["Build",link="https://github.com/spring-cloud/spring-cloud-openfeign/actions"]
8+
image::https://github.com/spring-cloud/spring-cloud-openfeign/workflows/Build/badge.svg?branch=4.0.x&style=svg["Build",link="https://github.com/spring-cloud/spring-cloud-openfeign/actions"]
99

10-
image:https://codecov.io/gh/spring-cloud/spring-cloud-openfeign/branch/main/graph/badge.svg["Codecov", link="https://codecov.io/gh/spring-cloud/spring-cloud-openfeign"]
10+
image:https://codecov.io/gh/spring-cloud/spring-cloud-openfeign/branch/4.0.x/graph/badge.svg["Codecov", link="https://app.codecov.io/gh/spring-cloud/spring-cloud-openfeign/tree/4.0.x"]
1111

1212
image:https://api.codacy.com/project/badge/Grade/97b04c4e609c4b4f86b415e4437a6484["Codacy code quality", link="https://www.codacy.com/app/Spring-Cloud/spring-cloud-openfeign?utm_source=github.com&utm_medium=referral&utm_content=spring-cloud/spring-cloud-openfeign&utm_campaign=Badge_Grade"]
1313

@@ -40,10 +40,10 @@ and binding to the Spring Environment and other Spring programming model idioms.
4040

4141
== Building
4242

43-
4443
:jdkversion: 17
4544

46-
=== Basic Compile and Test
45+
[[basic-compile-and-test]]
46+
== Basic Compile and Test
4747

4848
To build the source you will need to install JDK {jdkversion}.
4949

@@ -70,31 +70,36 @@ source control.
7070
The projects that require middleware (i.e. Redis) for testing generally
7171
require that a local instance of [Docker](https://www.docker.com/get-started) is installed and running.
7272

73-
74-
=== Documentation
73+
[[documentation]]
74+
== Documentation
7575

7676
The spring-cloud-build module has a "docs" profile, and if you switch
77-
that on it will try to build asciidoc sources from
78-
`src/main/asciidoc`. As part of that process it will look for a
79-
`README.adoc` and process it by loading all the includes, but not
77+
that on it will try to build asciidoc sources using https://docs.antora.org/antora/latest/[Antora] from
78+
`modules/ROOT/`.
79+
80+
As part of that process it will look for a
81+
`docs/src/main/asciidoc/README.adoc` and process it by loading all the includes, but not
8082
parsing or rendering it, just copying it to `${main.basedir}`
81-
(defaults to `${basedir}`, i.e. the root of the project). If there are
83+
(defaults to `$\{basedir}`, i.e. the root of the project). If there are
8284
any changes in the README it will then show up after a Maven build as
8385
a modified file in the correct place. Just commit it and push the change.
8486

85-
=== Working with the code
87+
[[working-with-the-code]]
88+
== Working with the code
8689
If you don't have an IDE preference we would recommend that you use
8790
https://www.springsource.com/developer/sts[Spring Tools Suite] or
8891
https://eclipse.org[Eclipse] when working with the code. We use the
8992
https://eclipse.org/m2e/[m2eclipse] eclipse plugin for maven support. Other IDEs and tools
9093
should also work without issue as long as they use Maven 3.3.3 or better.
9194

92-
==== Activate the Spring Maven profile
95+
[[activate-the-spring-maven-profile]]
96+
=== Activate the Spring Maven profile
9397
Spring Cloud projects require the 'spring' Maven profile to be activated to resolve
9498
the spring milestone and snapshot repositories. Use your preferred IDE to set this
9599
profile to be active, or you may experience build errors.
96100

97-
==== Importing into eclipse with m2eclipse
101+
[[importing-into-eclipse-with-m2eclipse]]
102+
=== Importing into eclipse with m2eclipse
98103
We recommend the https://eclipse.org/m2e/[m2eclipse] eclipse plugin when working with
99104
eclipse. If you don't already have m2eclipse installed it is available from the "eclipse
100105
marketplace".
@@ -108,7 +113,8 @@ add the "spring" profile to your `settings.xml`. Alternatively you can
108113
copy the repository settings from the "spring" profile of the parent
109114
pom into your `settings.xml`.
110115

111-
==== Importing into eclipse without m2eclipse
116+
[[importing-into-eclipse-without-m2eclipse]]
117+
=== Importing into eclipse without m2eclipse
112118
If you prefer not to use m2eclipse you can generate eclipse project metadata using the
113119
following command:
114120

@@ -121,239 +127,9 @@ The generated eclipse projects can be imported by selecting `import existing pro
121127
from the `file` menu.
122128

123129

124-
125130
== Contributing
126131

127-
:spring-cloud-build-branch: master
128-
129-
Spring Cloud is released under the non-restrictive Apache 2.0 license,
130-
and follows a very standard Github development process, using Github
131-
tracker for issues and merging pull requests into master. If you want
132-
to contribute even something trivial please do not hesitate, but
133-
follow the guidelines below.
134-
135-
=== Sign the Contributor License Agreement
136-
Before we accept a non-trivial patch or pull request we will need you to sign the
137-
https://cla.pivotal.io/sign/spring[Contributor License Agreement].
138-
Signing the contributor's agreement does not grant anyone commit rights to the main
139-
repository, but it does mean that we can accept your contributions, and you will get an
140-
author credit if we do. Active contributors might be asked to join the core team, and
141-
given the ability to merge pull requests.
142-
143-
=== Code of Conduct
144-
This project adheres to the Contributor Covenant https://github.com/spring-cloud/spring-cloud-build/blob/master/docs/src/main/asciidoc/code-of-conduct.adoc[code of
145-
conduct]. By participating, you are expected to uphold this code. Please report
146-
unacceptable behavior to [email protected].
147-
148-
=== Code Conventions and Housekeeping
149-
None of these is essential for a pull request, but they will all help. They can also be
150-
added after the original pull request but before a merge.
151-
152-
* Use the Spring Framework code format conventions. If you use Eclipse
153-
you can import formatter settings using the
154-
`eclipse-code-formatter.xml` file from the
155-
https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-dependencies-parent/eclipse-code-formatter.xml[Spring
156-
Cloud Build] project. If using IntelliJ, you can use the
157-
https://plugins.jetbrains.com/plugin/6546[Eclipse Code Formatter
158-
Plugin] to import the same file.
159-
* Make sure all new `.java` files to have a simple Javadoc class comment with at least an
160-
`@author` tag identifying you, and preferably at least a paragraph on what the class is
161-
for.
162-
* Add the ASF license header comment to all new `.java` files (copy from existing files
163-
in the project)
164-
* Add yourself as an `@author` to the .java files that you modify substantially (more
165-
than cosmetic changes).
166-
* Add some Javadocs and, if you change the namespace, some XSD doc elements.
167-
* A few unit tests would help a lot as well -- someone has to do it.
168-
* If no-one else is using your branch, please rebase it against the current master (or
169-
other target branch in the main project).
170-
* When writing a commit message please follow https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html[these conventions],
171-
if you are fixing an existing issue please add `Fixes gh-XXXX` at the end of the commit
172-
message (where XXXX is the issue number).
173-
174-
=== Checkstyle
175-
176-
Spring Cloud Build comes with a set of checkstyle rules. You can find them in the `spring-cloud-build-tools` module. The most notable files under the module are:
177-
178-
.spring-cloud-build-tools/
179-
----
180-
└── src
181-
   ├── checkstyle
182-
   │   └── checkstyle-suppressions.xml <3>
183-
   └── main
184-
   └── resources
185-
   ├── checkstyle-header.txt <2>
186-
   └── checkstyle.xml <1>
187-
----
188-
<1> Default Checkstyle rules
189-
<2> File header setup
190-
<3> Default suppression rules
191-
192-
==== Checkstyle configuration
193-
194-
Checkstyle rules are *disabled by default*. To add checkstyle to your project just define the following properties and plugins.
195-
196-
.pom.xml
197-
----
198-
<properties>
199-
<maven-checkstyle-plugin.failsOnError>true</maven-checkstyle-plugin.failsOnError> <1>
200-
<maven-checkstyle-plugin.failsOnViolation>true
201-
</maven-checkstyle-plugin.failsOnViolation> <2>
202-
<maven-checkstyle-plugin.includeTestSourceDirectory>true
203-
</maven-checkstyle-plugin.includeTestSourceDirectory> <3>
204-
</properties>
205-
206-
<build>
207-
<plugins>
208-
<plugin> <4>
209-
<groupId>io.spring.javaformat</groupId>
210-
<artifactId>spring-javaformat-maven-plugin</artifactId>
211-
</plugin>
212-
<plugin> <5>
213-
<groupId>org.apache.maven.plugins</groupId>
214-
<artifactId>maven-checkstyle-plugin</artifactId>
215-
</plugin>
216-
</plugins>
217-
218-
<reporting>
219-
<plugins>
220-
<plugin> <5>
221-
<groupId>org.apache.maven.plugins</groupId>
222-
<artifactId>maven-checkstyle-plugin</artifactId>
223-
</plugin>
224-
</plugins>
225-
</reporting>
226-
</build>
227-
----
228-
<1> Fails the build upon Checkstyle errors
229-
<2> Fails the build upon Checkstyle violations
230-
<3> Checkstyle analyzes also the test sources
231-
<4> Add the Spring Java Format plugin that will reformat your code to pass most of the Checkstyle formatting rules
232-
<5> Add checkstyle plugin to your build and reporting phases
233-
234-
If you need to suppress some rules (e.g. line length needs to be longer), then it's enough for you to define a file under `${project.root}/src/checkstyle/checkstyle-suppressions.xml` with your suppressions. Example:
235-
236-
.projectRoot/src/checkstyle/checkstyle-suppresions.xml
237-
----
238-
<?xml version="1.0"?>
239-
<!DOCTYPE suppressions PUBLIC
240-
"-//Puppy Crawl//DTD Suppressions 1.1//EN"
241-
"https://www.puppycrawl.com/dtds/suppressions_1_1.dtd">
242-
<suppressions>
243-
<suppress files=".*ConfigServerApplication\.java" checks="HideUtilityClassConstructor"/>
244-
<suppress files=".*ConfigClientWatch\.java" checks="LineLengthCheck"/>
245-
</suppressions>
246-
----
247-
248-
It's advisable to copy the `${spring-cloud-build.rootFolder}/.editorconfig` and `${spring-cloud-build.rootFolder}/.springformat` to your project. That way, some default formatting rules will be applied. You can do so by running this script:
249-
250-
```bash
251-
$ curl https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/.editorconfig -o .editorconfig
252-
$ touch .springformat
253-
```
254-
255-
=== IDE setup
256-
257-
==== Intellij IDEA
258-
259-
In order to setup Intellij you should import our coding conventions, inspection profiles and set up the checkstyle plugin.
260-
The following files can be found in the https://github.com/spring-cloud/spring-cloud-build/tree/master/spring-cloud-build-tools[Spring Cloud Build] project.
261-
262-
.spring-cloud-build-tools/
263-
----
264-
└── src
265-
   ├── checkstyle
266-
   │   └── checkstyle-suppressions.xml <3>
267-
   └── main
268-
   └── resources
269-
   ├── checkstyle-header.txt <2>
270-
   ├── checkstyle.xml <1>
271-
   └── intellij
272-
      ├── Intellij_Project_Defaults.xml <4>
273-
      └── Intellij_Spring_Boot_Java_Conventions.xml <5>
274-
----
275-
<1> Default Checkstyle rules
276-
<2> File header setup
277-
<3> Default suppression rules
278-
<4> Project defaults for Intellij that apply most of Checkstyle rules
279-
<5> Project style conventions for Intellij that apply most of Checkstyle rules
280-
281-
.Code style
282-
283-
image::https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/{spring-cloud-build-branch}/docs/src/main/asciidoc/images/intellij-code-style.png[Code style]
284-
285-
Go to `File` -> `Settings` -> `Editor` -> `Code style`. There click on the icon next to the `Scheme` section. There, click on the `Import Scheme` value and pick the `Intellij IDEA code style XML` option. Import the `spring-cloud-build-tools/src/main/resources/intellij/Intellij_Spring_Boot_Java_Conventions.xml` file.
286-
287-
.Inspection profiles
288-
289-
image::https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/{spring-cloud-build-branch}/docs/src/main/asciidoc/images/intellij-inspections.png[Code style]
290-
291-
Go to `File` -> `Settings` -> `Editor` -> `Inspections`. There click on the icon next to the `Profile` section. There, click on the `Import Profile` and import the `spring-cloud-build-tools/src/main/resources/intellij/Intellij_Project_Defaults.xml` file.
292-
293-
.Checkstyle
294-
295-
To have Intellij work with Checkstyle, you have to install the `Checkstyle` plugin. It's advisable to also install the `Assertions2Assertj` to automatically convert the JUnit assertions
296-
297-
image::https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/{spring-cloud-build-branch}/docs/src/main/asciidoc/images/intellij-checkstyle.png[Checkstyle]
298-
299-
Go to `File` -> `Settings` -> `Other settings` -> `Checkstyle`. There click on the `+` icon in the `Configuration file` section. There, you'll have to define where the checkstyle rules should be picked from. In the image above, we've picked the rules from the cloned Spring Cloud Build repository. However, you can point to the Spring Cloud Build's GitHub repository (e.g. for the `checkstyle.xml` : `https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-build-tools/src/main/resources/checkstyle.xml`). We need to provide the following variables:
300-
301-
- `checkstyle.header.file` - please point it to the Spring Cloud Build's, `spring-cloud-build-tools/src/main/resources/checkstyle-header.txt` file either in your cloned repo or via the `https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-build-tools/src/main/resources/checkstyle-header.txt` URL.
302-
- `checkstyle.suppressions.file` - default suppressions. Please point it to the Spring Cloud Build's, `spring-cloud-build-tools/src/checkstyle/checkstyle-suppressions.xml` file either in your cloned repo or via the `https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-build-tools/src/checkstyle/checkstyle-suppressions.xml` URL.
303-
- `checkstyle.additional.suppressions.file` - this variable corresponds to suppressions in your local project. E.g. you're working on `spring-cloud-contract`. Then point to the `project-root/src/checkstyle/checkstyle-suppressions.xml` folder. Example for `spring-cloud-contract` would be: `/home/username/spring-cloud-contract/src/checkstyle/checkstyle-suppressions.xml`.
304-
305-
IMPORTANT: Remember to set the `Scan Scope` to `All sources` since we apply checkstyle rules for production and test sources.
306-
307-
=== Duplicate Finder
308-
309-
Spring Cloud Build brings along the `basepom:duplicate-finder-maven-plugin`, that enables flagging duplicate and conflicting classes and resources on the java classpath.
310-
311-
==== Duplicate Finder configuration
312-
313-
Duplicate finder is *enabled by default* and will run in the `verify` phase of your Maven build, but it will only take effect in your project if you add the `duplicate-finder-maven-plugin` to the `build` section of the projecst's `pom.xml`.
314-
315-
.pom.xml
316-
[source,xml]
317-
----
318-
<build>
319-
<plugins>
320-
<plugin>
321-
<groupId>org.basepom.maven</groupId>
322-
<artifactId>duplicate-finder-maven-plugin</artifactId>
323-
</plugin>
324-
</plugins>
325-
</build>
326-
----
327-
328-
For other properties, we have set defaults as listed in the https://github.com/basepom/duplicate-finder-maven-plugin/wiki[plugin documentation].
329-
330-
You can easily override them but setting the value of the selected property prefixed with `duplicate-finder-maven-plugin`. For example, set `duplicate-finder-maven-plugin.skip` to `true` in order to skip duplicates check in your build.
331-
332-
If you need to add `ignoredClassPatterns` or `ignoredResourcePatterns` to your setup, make sure to add them in the plugin configuration section of your project:
333-
334-
[source,xml]
335-
----
336-
<build>
337-
<plugins>
338-
<plugin>
339-
<groupId>org.basepom.maven</groupId>
340-
<artifactId>duplicate-finder-maven-plugin</artifactId>
341-
<configuration>
342-
<ignoredClassPatterns>
343-
<ignoredClassPattern>org.joda.time.base.BaseDateTime</ignoredClassPattern>
344-
<ignoredClassPattern>.*module-info</ignoredClassPattern>
345-
</ignoredClassPatterns>
346-
<ignoredResourcePatterns>
347-
<ignoredResourcePattern>changelog.txt</ignoredResourcePattern>
348-
</ignoredResourcePatterns>
349-
</configuration>
350-
</plugin>
351-
</plugins>
352-
</build>
353-
354-
355-
----
356-
132+
NOTE: Spring Cloud is released under the non-restrictive Apache 2.0 license. If you would like to contribute to this section of the documentation or if you find an error, please find the source code and issue trackers in the project at {github-project}[github].
357133

358134
== License
359135

docs/src/main/asciidoc/README.adoc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
image::https://github.com/spring-cloud/spring-cloud-openfeign/workflows/Build/badge.svg?branch=main&style=svg["Build",link="https://github.com/spring-cloud/spring-cloud-openfeign/actions"]
1+
image::https://github.com/spring-cloud/spring-cloud-openfeign/workflows/Build/badge.svg?branch=4.0.x&style=svg["Build",link="https://github.com/spring-cloud/spring-cloud-openfeign/actions"]
22

3-
image:https://codecov.io/gh/spring-cloud/spring-cloud-openfeign/branch/main/graph/badge.svg["Codecov", link="https://codecov.io/gh/spring-cloud/spring-cloud-openfeign"]
3+
image:https://codecov.io/gh/spring-cloud/spring-cloud-openfeign/branch/4.0.x/graph/badge.svg["Codecov", link="https://app.codecov.io/gh/spring-cloud/spring-cloud-openfeign/tree/4.0.x"]
44

55
image:https://api.codacy.com/project/badge/Grade/97b04c4e609c4b4f86b415e4437a6484["Codacy code quality", link="https://www.codacy.com/app/Spring-Cloud/spring-cloud-openfeign?utm_source=github.com&utm_medium=referral&utm_content=spring-cloud/spring-cloud-openfeign&utm_campaign=Badge_Grade"]
66

@@ -14,11 +14,11 @@ include::intro.adoc[]
1414

1515
== Building
1616

17-
include::https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/main/docs/src/main/asciidoc/building-jdk8.adoc[]
17+
include::https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/main/docs/modules/ROOT/partials/building.adoc[]
1818

1919
== Contributing
2020

21-
include::https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/main/docs/src/main/asciidoc/contributing.adoc[]
21+
include::https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/main/docs/modules/ROOT/partials/contributing-docs.adoc[]
2222

2323
== License
2424

0 commit comments

Comments
 (0)