Skip to content

Conversation

UgmaDevelopment
Copy link

This is the beginning of an attempt to use Spring Initializr's Rest Docs template to start off the tutorial instead of trying to get the right configuration by hand.

I've used untainted configuration directly from start.spring.io for both Maven and Gradle.

However this attempt is not finished because I'm new to unit and mock testing in Spring and I wouldn't want to make assumptions about those parts of the tutorial. I'll keep working on this later, but would welcome suggestions or additions in the mean time.

Previously, it said that Spring created a `main` class.
Now it says that Spring creates a `main` function in an Application class.
…tion to run the main method was lost; now it's back.
It appears that the tags were accidentally broken by Jay Bryant <jbryant@pivotal.io> in commit 42f92f2
* Adds a .gitignore
* Adds configuration to `pom` for asciidoctor and restdocs
* Updates the maven wrapper from 0.5.2 to 0.5.6
* Combine the .gitignores from maven and gradle
* Moves from Spring Boot `2.3.2.RELEASE` to `2.4.1`
* Adds asciidotor configuration to `build.gradle`
* No longer explicity excludes vintage; according to @dsyer, that's already taken care of by Spring Boot.
* Adds some updates to the gradle wrapper; moves from 6.5.1 to 6.7.1
People who know how to use an IDE will do so; providing brief instructions for people new to  spring boot (and probably build systems) seems warranted in this beginners' tutorial.
…documentation".

Also partially removed the instruction to add the dependencies as Spring Initializr
has already added them.
README.adoc Outdated
Comment on lines 127 to 138
=== Maven

If you use Maven, the following listing shows what to add to the `<dependencies>`
section of `pom.xml`:

====
[source,xml]
----
include::complete/pom.xml[tag=test]
include::complete/pom.xml[tag=restdocs-dependency]
----
====

Copy link
Author

@UgmaDevelopment UgmaDevelopment Dec 14, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This section about adding dependencies to Maven/Gradle would go away, because Initializr would've already added them—unless I'm mistaken.

Let us not forget to

  • remove the asciidoctor tags regarding adding a dependency

…cies are already included for you by Spring Initializr.

Also removes the tags from complete's pom.xml, though we'll likely replace the whole pom later.

Corrects paragraph about adding a contextLoads test as that test is already provided by Spring Initializr.
…were previously added to the initial folder.

Spring Boot from 2.3.2.RELEASE to 2.4.1
org.asciidoctor.convert from 1.5.6 to 1.5.8
Gradle Wrapper from 6.5.1 to 6.7.1
Maven Wrapper from 0.5.2 to 0.5.6

In 2.4+, Spring Initializr no longer has to exclude Junit Vintage. Spring Initialzr also now includes configuration for the asciidoctor-maven-plugin
…ll expect the snippets to be instead of the custom `target/snippets` folder.
…e place as maven: `src/main/asciidoc`.

Also mentioned where to find the generated docs for both Maven and Gradle.

For some reason gradle isn't generating the snippets; the folder yes, the snippets, no. ¯\_(ツ)_/¯ It does generate the asciidoc, but there's no snippets included.
@UgmaDevelopment
Copy link
Author

UgmaDevelopment commented Dec 30, 2020

Alright, I got through the whole thing, making some useful improvements and upgrading things to the latest template provided by Spring Initializr (Spring Boot 2.4.1).

@Buzzardo, @gregturn, @dsyer I'd be happy to make any changes you might request.

}

group = 'com.example'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '1.8'

asciidoctor {
sourceDir 'src/main/asciidoc'
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reinclude this line in one the next commits (9af112a)

… but I'd like to do it using whatever convention the plugin uses instead.

Note that the snippets are still not being generated for some reason, but if the snippets are manually copied into the `build/generated-snippets` folder, then this will pick them up and include them in the generated HTML.
@UgmaDevelopment
Copy link
Author

Any ideas why gradle isn't generating the snippets? It creates the generated-snippets folder, and it runs the tests, but no snippets appear.

@gregturn gregturn changed the base branch from master to main April 27, 2021 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant