This commit fixes several issues with the initial java migration.
On MacOS, the name of the temp directory can be `T` and the new tgz API
requires a parent folder whose name has at least 3 characters.
The Selenium tests require a more precise element to show the advanced
section.
The integration tests were generation the docs snippet on the wrong
accept header.
If we don't re-use an existing factory, the label doesn't change and
all the snippets get generated with the same identifier.
Remove explicit version from wiremock test
Add snippets attribute to build config
See gh-295
This commit commit adds restdocs and stub generators and initiate
a reference guide for Initializr.
Most of the controller tests now use MockMvc via a custom version
of the MockMvcClientHttpRequestFactory (from spring-test). The
snippet names are auto-generated in the form
<HttpMethod>/<path>[/queries(/<name-value)*][/headers](/name-value)*]
when there is a comma-separated value in a header it is
abbreviated as <first-value>.MORE.
Wiremock stubs are generated in the same form under
snippets/stubs (with ".json" as the
file extension).
The controller tests that stayed as full stack use a different
base class AbstractFullStackInitializrIntegrationTests.
A long JSON body can be broken out into separate snippets
for each field (or rather a list of fields supplied by the
user). This feature was already used with hard-coded snippets
in the wiki.
See gh-295
This commit makes sure that each dependency link is HAL compliant (like
the project types in the metadata). Links are grouped by relation with
well known relations to be defined (i.e. 'how-to', 'reference', 'home'
and so forth).
Each link can be "templated" (in the HAL sense) and only `{bootVersion}`
is supported at the moment. This is useful if a precise documentation
section should reference to the actual Stpring Boot version chosen by the
user.
Closes gh-279
This commit adds an `order` attribute on `BillOfMaterials` that allows to
order BOMs in the generated project. Lowest value have higher priority.
When the project is generatede with a custom parent, the Spring Boot
dependencies BOM itself has an order of a 100. Any BOM that is added with
an order lower than 100 has higher priority, i.e. could potentially
override dependencies provided by the Spring Boot dependency mechanism.
This mechanism does not work reliably when using the
`spring-boot-starter-parent` so it should be used with care. However, it
can be useful when overriding dependencies that Spring Boot does not
manage itself.
Closes gh-343
This commit improves the version format so that the minor and patch
elements can hold a special 'x' character besides the version, i.e.
`1.x.x.RELEASE` or `2.4.x.BUILD-SNAPSHOT`. A `VersionParser` now takes
care to resolve those against a list of known Spring Boot versions.
This is particularly useful in version ranges that have to change when
the latest Spring Boot versions change. Spring Initializr already auto-
udpates itself based on the sagan metadata. When a range is using this
feature, it is also automatically updated.
It might be hard to track the actual range values on a given instance so
an `InfoContributor` is now automatically exposed to list them.
Closes gh-328
This commit configures a resource chain with
`resources.chain.strategy.content.enabled`, enabling cache busting for
static resources based on the hash of their content.
A template helper (here a Groovy Closure) is added to the model given to
the view for appending hashes to static links such as:
"/css/spring.css" -> "/css/spring-d35c4193cd32e7e44cda5737205c0c0e.css"
Fixes#321
This commit improves the generator so that a `.gitignore` is added to
every project. The basic content of that file is determined by the build
system. If an agent is recognized, specific build tool settings are
added as well. This commit adds support for STS, IntelliJ IDEA and
NetBeans.
Closes gh-131
This commit removes the dependency tag from the list of all dependencies
not supported by the selected Boot version. Previously, the dependency
input checkbox was unchecked, but the green tag was still present.
Instead of hiding incompatible dependencies in the full list, the
choices are now marked as "disabled"; it is impossible to select those
checkboxes and the cursor displays a "not-allowed" icon when hovering
the dependency.
Closes gh-109
Closes gh-286
This commit improves massively class loading performance by caching all
templates used by the generator. GroovyTemplate is now a bean rather than
a private utility.
Templates are cached by default and the cache is disabled automatically
if Devtools is in use (via a check of spring.groovy.template.cache).
Closes gh-288
This commit upgrades to Spring Boot 1.4.0.RELEASE and bumps to Java8. It
also migrate the cache library from Guava to Caffeeine.
The git and build information are now exposed via the `info` endpoint.
Closes gh-251
Previously, if the sagan meta-data did not provide a default, the live
instance wouldn't have one either. This means that all requests that
do not provide an explicit boot version will fail as well.
This commit sets the first version as the default if no default exists.
Closes gh-267
This commit introduces `ProjectRequestPostProcessor` as a mean to modify
an incoming `ProjectRequest` before and after its resolution against the
meta-data.
By default, all beans of that type are invoked automatically and they
are ordered against their `@Order` or `Ordered` settings.
Closes gh-260
This commit introduces a `buildProperties` property on the request that
can be used to specify Gradle/Maven build-specific properties as well as
an arbitrary number of version overrides.
Instead of hard-coding some properties in the templates, these defaults
are now inherited from the request itself.
Closes gh-259
Previously, if one invokes the service asking for dependency `foo` and
`foo` does not exist we created a starter for it, that is
`spring-boot-starter-foo`. This mechanism was put in place because we
don't know all starters and to offer a nice fallback for users who know
what they're doing.
That statement proved to be wrong since users actually discover new
starters via the service and don't seem to attempt to create such starter
that are located in the `org.springframework.boot` groupId anyway. Most
if not all of those are pilot errors.
This commit enables strict validation of dependencies and generate an
appropriate exception if it isn't defined in the meta-data.
Closes gh-234