Commit Graph

190 Commits

Author SHA1 Message Date
Stephane Nicoll
2a183354b2 Tune metadata caching
This commit reduces the cache metadata lookup to 2h so that clients can
see new Spring Boot version faster. It also offers an option for
custom instance to override the cache strategy any way they like.

Closes gh-979
2019-09-06 12:00:47 +02:00
Stephane Nicoll
cff60c397d Improve custom project request arrangement
This commit improves the use case of configuring a custom ProjectRequest
by enforcing consistently a particular type using a generic.

As a result, `ProjectGenerationInvoker` is no longer exposed as a bean
as it is the responsibility of the custom `ProjectGenerationController`
to provide one that matches the requested `ProjectRequest` type.

See gh-990
2019-08-29 10:52:02 +02:00
Stephane Nicoll
f74370eb63 Allow binding of custom ProjectRequest
This commit allows a custom instance to easily bind incoming request
attributes to a custom ProjectRequest instance and map it to a custom
ProjectDescription as well.

Closes gh-990
2019-08-27 09:48:47 +02:00
Stephane Nicoll
d9a20ed68c Split controller endpoints
This commit splits MainController to a number of controllers with
dedicated responsibilities. This is a first step to make these features
more modular and potentially opt-in in the future.

Closes gh-994
2019-08-27 08:30:15 +02:00
Stephane Nicoll
282c92f76d Polish 2019-08-25 17:16:18 +02:00
Stephane Nicoll
c36ae847fb Harmonize ProjectDescription name 2019-08-25 03:17:25 +02:00
Stephane Nicoll
286e38888c Migrate ProjectDescription to an interface
This commit migrates ProjectDescription to an interface with read-only
accessors and create a MutableProjectDescription implementation that can
be used for both purposes.

As a result, the type separation between ResolvedProjectDescription and
ProjectDescription is no longer necessary.

Closes gh-993
2019-08-25 03:03:57 +02:00
Stephane Nicoll
ddd609c639 Move assert to AssertJ
This commit moves project-based assertions to regular AssertJ Assert
classes. `ProjectStructure` is now an assert provider so that it can
be used with the standard `assertThat` method.

Specialized assertions are provided for the supported build systems as
well as text-based content.

Closes gh-764
2019-08-22 15:24:28 +02:00
Stephane Nicoll
1082ac7bf7 Extract project generation test utility to dedicated module
This commit extracts various test utilities to a dedicated
initializr-generator-test module for easier consumption. The previous
test-jar are no longer published and a dependency to this new module
should be equivalent.

This commit also cleans various resources that were located in the wrong
place. In particular initializr-generator does not know anything about
metadata anymore.

Closes gh-988
2019-08-21 16:10:06 +02:00
Stephane Nicoll
976f290144 Harmonize logging test configuration 2019-08-18 14:35:51 +02:00
Stephane Nicoll
cd59699644 Polish 2019-08-18 14:11:31 +02:00
Stephane Nicoll
dee5467bd1 http -> https 2019-08-18 14:07:02 +02:00
HaiTao Zhang
76e6271e8e Add empty line when content is wrapped
See gh-984
2019-08-17 17:28:04 +02:00
Stephane Nicoll
ff6e26463b Add Bill Of Materials
Closes gh-981
2019-08-15 07:53:46 +02:00
Stephane Nicoll
9520100703 Add missing package-info.java files
Closes gh-886
2019-08-14 15:19:06 +02:00
Stephane Nicoll
536e1830e7 Polish "Rename versionRange attribute to compatibilityRange"
See gh-968
2019-08-09 11:34:02 +02:00
HaiTao Zhang
71364408fa Rename versionRange attribute to compatibilityRange
See gh-968
2019-08-09 11:20:02 +02:00
Stephane Nicoll
e67f2bb0ac Polish "Make sure project descriptions line-wrap at a decent length"
See gh-966
2019-07-31 18:14:26 +02:00
HaiTao Zhang
4772f4219f Make sure project descriptions line-wrap at a decent length
See gh-966
2019-07-31 16:11:43 +02:00
Andy Wilkinson
7cb3462d1b Add support for mapping a dependency's starter setting
Closes gh-955
2019-07-14 08:45:10 +01:00
Andy Wilkinson
45536e51a9 Fix setting file permissions on Windows
See gh-951
2019-07-11 15:58:22 +01:00
Andy Wilkinson
b769c8d6a0 Migrate from Ant to Commons Compress
Closes gh-951
2019-07-11 15:34:33 +01:00
Andy Wilkinson
aad9ce07d7 Broaden usage of Path in place of File
Closes gh-950
2019-07-11 15:34:22 +01:00
Stephane Nicoll
449b22403a Upgrade to spring-javaformat 0.0.15
Closes gh-949
2019-07-10 14:57:35 +02:00
Andy Wilkinson
deed4863fb Adopt Spring Java Format's JUnit 5 check
Closes gh-941
2019-07-04 09:57:35 +01:00
wonwoo
bcc11c80d5 Reduce visibility of test class and its methods
See gh-939
2019-07-04 09:57:17 +01:00
HaiTao Zhang
66ea0cb66b Ensure executable bit is set on wrapper when baseDir has space
See gh-933
2019-07-03 17:18:17 -07:00
HaiTao Zhang
292e47e98b Refactor support for testing executable files
Previously, hasExecutableFile only checked if the
file exists and not if it was executable. This commit
ensures that the file exists and is executable using
ExecTask as Unzip and Untar do not preserve file permissions.

See gh-937
2019-07-02 14:25:24 -07:00
Madhura Bhave
06286e4fe9 Polish "Clean artifactId and groupId"
Closes gh-924
2019-06-17 16:19:02 -07:00
HaiTao Zhang
10c7a4f32e Clean artifactId and groupId
Maven allows alphanumeric characters and `.`, `_`
and `-` for group id and artifact id. This commit cleans
the artifact id and group id if invalid characters are
found. For artifact id, the invalid characters are replaced
with a hyphen and for group id a dot is used. In cases where
the base directory matches the artifact id, the base directory
is also cleaned.

See gh-924
2019-06-17 16:00:57 -07:00
Stephane Nicoll
918fe40dd9 Polish 2019-06-17 15:37:06 +02:00
Stephane Nicoll
2f50cf1c8f Format source code
Closes gh-923
2019-06-12 14:46:53 +02:00
Stephane Nicoll
593b9ec878 Properly handle spring boot version metadata failure
See gh-145
2019-06-07 16:40:15 -04:00
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