Commit Graph

157 Commits

Author SHA1 Message Date
Brian Clozel
ba73613050 Prevent caching issues with browsers
The main metadata endpoint is available at the root "/" path, for JSON
compatible media types. This endpoint is often requested by CLI and
IDEs. Initializr is setting HTTP response headers to tell clients to
cache the response body.

With this current situation, several HTTP caching issues can happen.

1. Since many formats are available at the same path, proxies can cache
the response body and redistribute it to many clients, even if they
don't request the same media type. To fix that, we need to add a
`Vary: Accept` response header; with that, proxies will cache responses
but take into account that different Accept request headers might yield
different responses.

2. Browsers have very specific caching implementations, and exposing
that metadata endpoint on "/" and at the same time an HTML page will
create issues related to HTTP caching. Navigation and refreshes might
result with strange problems. To fix that, we need to reinstate the
`/metadata/client` endpoint as a first class citizen (and not just a
redirect). This way, Web UIs can freely use that path to request the
metadata, without risking caching issues.

See gh-914
2019-06-02 09:08:12 +02:00
Stephane Nicoll
e6f287b298 Fix compatiblity with Microsoft Windows
Closes gh-879
2019-05-29 16:10:54 +02:00
Stephane Nicoll
62d0a94364 Migrate ProjectAssert to java.nio.file.Path 2019-05-28 15:29:28 +02:00
jnizet
239116b29a Add Gradle Kotlin DSL support
This commit refactors the existing Groovy DSL writers in order to share
code between the Groovy DSL and Kotlin DSL writers.

See gh-851
2019-05-15 16:54:50 +02:00
Stephane Nicoll
910fddaaa7 Upgrade to spring-javaformat 0.0.9
Closes gh-882
2019-04-03 12:26:24 +02:00
Stephane Nicoll
e527172282 Polish "Remove default Web UI from Initializr library"
Closes gh-860
2019-03-20 17:36:21 +01:00
Brian Clozel
7e479e8297 Remove default Web UI from Initializr library
Given that Web UIs can be implemented in many different ways and that
the start.spring.io UI is about to change dramatically.
Since Web UIs can be rendered on the server, or on the client side (or a
mix of both), provivind a default UI or tools to build a generally
useful one is not easy.

This commit removes all the Web UI specific code and leaves the Web
endpoints for REST access and metadata access.

See gh-860
2019-03-20 17:36:21 +01:00
Stephane Nicoll
357313c7bf Upgrade to spring-javaformat 0.0.7
This commit upgrades to spring-javaformat 0.0.7 and checkstyle 8.18.
2019-03-20 17:34:50 +01:00
Stephane Nicoll
568ef5ed32 MetadataBuildItemResolver should use platform version
Closes gh-872
2019-03-17 14:41:03 +01:00
Stephane Nicoll
b80e3570d8 Switch initializr-generator-spring to test dependency where applicable
Closes gh-871
2019-03-17 11:26:29 +01:00
Stephane Nicoll
738cf0f55b Move BuildWriter to core module
See gh-871
2019-03-17 11:08:09 +01:00
Stephane Nicoll
9203e1bd61 Move metadata build support classes to the metadata module
See gh-871
2019-03-17 11:05:01 +01:00
Stephane Nicoll
1ad3dae770 Polish 2019-03-15 14:24:25 +01:00
Brian Clozel
bb4c3d21c5 Fix CSS and JS issues with new UI
* Fix stylesheet for Safari
* Fix quick links not displayed on a single line on Safari browser
* Improve responsive layout for quick links bar
* Fix "Generate project" keyboard shortcut information
* Fix the "Generate button" keyboard shortcut action
2019-03-05 18:45:30 +01:00
Brian Clozel
a72e672138 Apply new Web UI
This commit updates the design of the Web UI, with the following
changes:

* drop Twitter Bootstrap and the custom typeahead widget build
* use js-search, sass and a webpack build instead
* fully delegate version range management to the client application
* do not show the full list of dependencies anymore

This commit adds for now the packaged version of the application, but
this will change with gh-854 and the whole Web UI is likely to move to
start.spring.io proper.
2019-03-05 10:48:59 +01:00
Stephane Nicoll
924a73310a Project documentation infrastructure
This commit adds support for an `HelpDocument` that can be generated
alongside the project. Such document can hold an arbitrary number of
sections with pre-defined sections such as "Getting Started" and "Next
Steps".

A default contributor retrieves the links for requested dependencies
and add them to the document.

Closes gh-353

Co-authored-by: Madhura Bhave <mbhave@pivotal.io>
2019-02-19 21:10:58 -08:00
Andy Wilkinson
a049d6e4fc Polish 2019-02-19 10:03:40 +00:00
Stephane Nicoll
56187f571d Polish 2019-02-14 14:52:58 +01:00
Stephane Nicoll
701f3f6277 Map project version from version capability
Closes gh-832
2019-02-14 14:52:07 +01:00
Stephane Nicoll
24887e1ab3 Fix generation of filename with empty artifactId
Closes gh-831
2019-02-14 13:10:48 +01:00
Stephane Nicoll
75307eab0f Map whitespace input to default value
This commit checks if a request for any of the text capability is set
with only whitespaces and replaces it with the metadata default
counterpart.

Closes gh-769
2019-02-14 09:56:39 +01:00
Stephane Nicoll
8660fedd0b Polish 2019-02-14 09:29:08 +01:00
Madhura Bhave
fe66bbab78 Make sure dependencies are compatible with boot version
Closes gh-825
2019-02-11 13:39:04 -08:00
Stephane Nicoll
5ea041744c Remove magic string comparison for build systems
This commit removes the magic string comparision to identify the build
system in use. Rather than just returning the `Path` to the project, a
`ProjectGenerationResult` is now returned that contains the description
of the generated project.

Closes gh-817
2019-02-11 16:11:48 +01:00
Stephane Nicoll
1485d9af82 Stop setting executable flag outside of project generation 2019-02-11 15:27:53 +01:00
Stephane Nicoll
08c785b952 Use build tag to infer the build system
Stop using the type's prefix to infer the build system to use as the
build tag in the metadata is supposed to provide that information.

See gh-817
2019-02-11 14:37:35 +01:00
Stephane Nicoll
c98f59e8f2 Remove deprecated stsId
Closes gh-820
2019-02-11 12:46:00 +01:00
Stephane Nicoll
cbb60c45e1 Allow to filter available Spring Boot versions
This commit adds a new InitializrMetadataUpdateStrategy callback
interface that can be used to customize what should happen when the
metadata has to be refreshed.

Closes gh-816
2019-02-08 16:42:45 +01:00
Stephane Nicoll
b97b9f9350 Migrate from slf4j to spring-jcl logger
Closes gh-819
2019-02-08 13:16:23 +01:00
Stephane Nicoll
9dc3cc65d1 Polish module dependencies 2019-02-08 13:01:32 +01:00
Stephane Nicoll
d5580cd985 Remove unused ProjectResourceLocator 2019-02-08 11:03:47 +01:00
Stephane Nicoll
cd3b274112 Rationalize exception management 2019-02-08 11:00:04 +01:00
Stephane Nicoll
478c0c41c6 Relocate Agent to web module 2019-02-08 10:56:41 +01:00
Stephane Nicoll
b6657211f6 Review TemplateRenderer abstraction
Closes gh-818
2019-02-08 10:53:49 +01:00
Stephane Nicoll
5e04746746 Add Spring-based project contributors
This commit adds an optional module that gathers the opinions that are
used to generate a Spring Boot project.

Closes gh-340

Co-authored-by: Madhura Bhave <mbhave@pivotal.io>
Co-authored-by: Andy Wilkinson <awilkinson@pivotal.io>
2019-02-08 09:50:35 +01:00
Stephane Nicoll
3fa03b8438 Move metadata to a dedicated module
This commit moves the `metadata` package to a dedicated
`initializr-metadata` module so that it can be shared.

Closes gh-804
2019-02-08 09:50:34 +01:00
Stephane Nicoll
6ccfb69692 Promote version infrastructure to dedicated package
This commit moves `Version` and related support classes to a dedicated
package

Closes gh-811
2019-02-08 09:50:34 +01:00
Madhura Bhave
e281480426 Switch project structure to use the new generator
This commit removes the former `ProjectGenerator` api based on mustache
template in favour of a new DSL infrastructure to be detailed in further
commits.

Event handling is now web-specific with a `ProjectRequest` and a
`WebProjectRequest` that gathers the base input from the request and
some additional web-specific metadata, respectively. As a consequence
the `initializr-actuator` module has now a dependency on the
`initializr-web` module.

See gh-340

Co-authored-by: Stephane Nicoll <snicoll@pivotal.io>
2019-02-08 09:50:26 +01:00
Stephane Nicoll
0628829cd3 Upgrade to JUnit Jupiter 5.4.0-RC2 2019-02-07 10:53:31 +01:00
Stephane Nicoll
73415ea21d Remove Jackson dependency on Version infrastructure
Closes gh-808
2019-02-05 10:41:16 +01:00
Stephane Nicoll
ce2d210d75 Move CommandLineHelpGenerator to initializr-web
Closes gh-807
2019-02-04 17:21:12 +01:00
Stephane Nicoll
fab532ebd4 Upgrade to JUnit 5.4.0-RC1 2019-01-31 11:06:54 +01:00
Madhura Bhave
79dc5956d5 Fix POMS for the updated release process 2019-01-30 08:24:06 -08:00
Stephane Nicoll
2b6ab498cf Polish migration to JUnit5
See gh-802
2019-01-28 14:38:54 +01:00
Madhura Bhave
8ec763e0ba Polish 2019-01-24 10:08:30 -08:00
Madhura Bhave
ae937ca4bc Migrate tests to JUnit5
See gh-802
2019-01-24 10:04:00 -08:00
Stephane Nicoll
51dbc92297 Polish "Remove surrounding brackets for gradle dependencies"
Closes gh-797
2019-01-09 15:18:23 +01:00
Stephane Nicoll
b9000f322d Allow to configure elasticsearch service with only a URI
Closes gh-789
2019-01-03 13:56:14 +01:00
Stephane Nicoll
da1655d183 Adapt test suite to more recent Spring Boot versions
See gh-763
2018-11-29 10:16:40 +01:00
Stephane Nicoll
c96991382a Simplify Gradle support
Remove support for Gradle 2 and simplify script generation by only
supporting the recommended structure as of Gradle 3.4

Closes gh-778
2018-11-28 13:56:49 +01:00