Commit Graph

55 Commits

Author SHA1 Message Date
Dave Syer
ac20d04985 Migrate initializr-generator to Java 2017-02-25 09:31:03 +01:00
Stephane Nicoll
2c0269c96b Fix initial Java migration
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.
2017-02-25 09:31:03 +01:00
Dave Syer
ec5a7da507 Migrate initializr-web to Java 2017-02-25 09:31:03 +01:00
Dave Syer
1385e82eb5 Additional visibility changes needed in new Java code 2017-02-25 09:31:03 +01:00
Dave Syer
ad6430b92a Migrate initializr-actuator to Java 2017-02-25 09:31:03 +01:00
Spring Buildmaster
e8bf50e662 Next development version 2017-02-03 13:55:17 +00:00
Stephane Nicoll
e8dd74b8ed Polish contribution
Closes gh-295
2017-02-02 15:03:00 +01:00
Stephane Nicoll
b356e233a2 Polish reference guide
See gh-295
2017-02-02 14:55:59 +01:00
Dave Syer
6242df5b6e Fix bug with stale state in http request factory
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
2017-02-02 10:21:38 +01:00
Stephane Nicoll
c7953bf999 Polish contribution
Move documentation to a dedicated module (`initializr-docs`) with a test
that uses the stubs with the Spring Cloud Contract runner.

See gh-295
2017-02-02 10:21:38 +01:00
Dave Syer
b7d8d5c813 Initiate initializr documentation
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
2017-02-02 10:21:38 +01:00
Stephane Nicoll
ba3c82b064 Fix integration tests 2017-01-31 14:42:35 +01:00
Stephane Nicoll
981b726a12 Polish contribution
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
2017-01-30 17:26:25 +01:00
Dave Syer
d8a1927a36 Add optional links to a dependency
See gh-163
2017-01-30 15:30:41 +01:00
Stephane Nicoll
bda1376c23 Polish 2017-01-27 18:04:10 +01:00
Spring Buildmaster
dd02650e22 Next Development Version 2017-01-27 12:52:11 +00:00
Stephane Nicoll
b58c7a046b Switch version to 0.2.0.BUILD-SNAPSHOT
Closes gh-352
2017-01-27 13:40:45 +01:00
Stephane Nicoll
f0cdd856bf Upgrade to Spring Boot 1.4.4.RELEASE 2017-01-27 10:31:00 +01:00
Stephane Nicoll
3d0a3a7e14 Polish config metadata output 2017-01-27 10:22:15 +01:00
Stephane Nicoll
1aa10d39b0 Remove use of @since 2017-01-27 10:11:33 +01:00
Stephane Nicoll
5ca1d4d128 Polish 2017-01-25 14:29:10 +01:00
Stephane Nicoll
330cb13c64 Add support for BOM ordering
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
2017-01-17 19:18:52 +01:00
Stephane Nicoll
827b9d6e93 Auto-updatable version ranges
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
2017-01-03 14:02:33 +01:00
Brian Clozel
4de86e1401 Configure a cache busting resource chain
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
2016-12-01 12:07:47 +01:00
Brian Clozel
8ee8d72e62 Show version requirements for disabled starters
This commit writes the version range information in human readable
format and adds it to the starter list when starters are disabled.

Closes gh-293
2016-11-25 15:58:54 +01:00
Brian Clozel
009c9a1572 Show hint when more search results are available 2016-11-24 16:16:38 +01:00
Brian Clozel
c4bfbe755e Update to jquery 3.1.1 and mousetrap 1.6.0 2016-11-24 16:16:19 +01:00
Stephane Nicoll
0a4f631b3a Harmonize metadata term 2016-11-22 01:43:36 +09:00
Stephane Nicoll
e3112811b7 Prevent retrieval of Sagan metadata on startup
This commit makes sure that sagan metadata are only requested on first
use and when the cache infrastructure is active.

Closes gh-278
2016-11-03 16:00:24 +01:00
Stephane Nicoll
90d3704faa Fix formatting 2016-09-27 09:22:47 +02:00
Dave Syer
712003b436 Switch off smoke tests by default in IDE
The Maven build now sets a System property smoke.test=true. The tests
are skipped if this is not set, so by default the IDE will not run them.
2016-09-26 16:54:30 +01:00
Dave Syer
c702be0260 Remove wildcard imports 2016-09-26 16:33:52 +01:00
Dave Syer
13e6ec4431 Add MockRestServiceServer for spring.io boot version metadata test 2016-09-26 16:16:27 +01:00
Stephane Nicoll
040830e6f1 Upgrade to Spring Boot 1.4.1.RELEASE 2016-09-24 08:42:39 +02:00
Stephane Nicoll
d61bf18fa2 Generate .gitignore
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
2016-09-20 18:12:17 +02:00
Stephane Nicoll
2b505dd899 Polish contribution
Closes gh-289
2016-09-16 17:23:07 +02:00
Brian Clozel
4d78a62a65 Deselect incompatible deps when changing Boot version
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
2016-09-16 17:11:59 +02:00
Brian Clozel
6ab9b5573e Upgrade to JQuery 3.1.0 2016-09-16 14:22:42 +02:00
Stephane Nicoll
61cc7eb41d Cache templates
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
2016-09-13 14:34:10 +02:00
Stephane Nicoll
af2ae44b8d Upgrade to Spring Boot 1.4.0.RELEASE
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
2016-07-29 12:52:53 +02:00
Stephane Nicoll
d018782726 Always set a default boot version
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
2016-07-29 12:30:50 +02:00
Stephane Nicoll
56210d9bf2 Add project request post processing
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
2016-07-20 15:09:35 +02:00
Stephane Nicoll
d9c65a5a07 Add support for configurable properties
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
2016-07-20 13:42:57 +02:00
Stephane Nicoll
6089f49c1a Add build-specific tests 2016-07-12 14:42:41 +02:00
Stephane Nicoll
f45228376f Polish contribution
Closes gh-223
2016-07-08 17:09:21 +02:00
Ryan Gardner
625d5bee15 Customize the parent pom to use
See gh-223
2016-07-08 14:54:33 +02:00
Stephane Nicoll
0ac320e5ae Enable strict validation of dependencies
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
2016-07-08 14:37:41 +02:00
Stephane Nicoll
a3d072f20a Add aliases to the list of keywords
This commit makes sure that a dependency can be found in the UI via its
aliases, if any.

Closes gh-231
2016-07-08 12:01:46 +02:00
Stephane Nicoll
d8a0651ad4 Remove charset parameter check on textual resources
Closes gh-236
2016-07-06 09:08:55 +02:00
Stephane Nicoll
3f82ab06c6 Upgrade to Spring Boot 1.3.6.RELEASE 2016-07-04 16:56:04 +02:00