This commit improves the dependency mapping infrastructure to include the
groupId and artifactId attributes alongside the existing version. For
consistency, the attribute has been renamed from `versions` to
`mappings`.
This allows to better support the `redis` use case: the starter was
renamed from `spring-boot-starter-redis` to
`spring-boot-starter-data-redis` and previously we had two entries
excluding each other using version ranges.
Closes gh-219
Spring Boot `1.4.0.M2` brings a new test infrastructure with nice
defaults and deprecates `SpringBootConfiguration` in the process.
This commits automatically upgrades generated project to this new
infrastructure if Spring Boot `1.4.0.M2` or later is available.
Closes gh-215
This commit splits the feature of Spring Initializr in several modules:
* `initializr-generator` is a standalone library that is responsible for
generating projects based on a `File` directory. It has a minimal set of
dependencies and is not web-related
* `initializr-web` provides the web integration (project generation,
meta-data, etc)
* `initializr-actuator` is an optional module that can be added to
support project-generation-specific statistics
Closes gh-214
If an elastic instance is available, publish a document to a
configurable index every time a `ProjectRequest` is handled by the
service.
In practice, this means that every attempt to generate a project leads to
a new document in the index. The document gathers the settings of the
required project, including invalid ones if any. If an exception is
thrown, the message of the cause is made available.
CloudFlare is explicitely supported and the IP and country of the request
is added to the document. If that information is not available and the
request contains a `X-Forwarded-For` header, the value is also associated
with the document. If an IPv4 is detected, it is set in a separate
`requestIpv4` property.
If for some reason the document could not be indexed, we attempt to retry
a configurable amount of times.
Closes gh-185
Parse the `User-Agent` http request header to determine if the client is
known. If that is the case, increment the relevant `client_id` counter.
A `ProjectRequest` had now a generic `parameters` array with all the
request headers by default. Since we don't want to accidentally map any
of those from a form input, `BasicProjectRequest` contains only "public"
fields and is the type exposed at the controller level.
Closes gh-193
`1.3.2.RELEASE` is available now so there is no need to have a version
range on the snapshot. We don't need to copy/paste the version of the
bom in the actual dependency (that's the whole business of the bom
definition (including versions mapping according to the Spring Boot
version).
We want the `cloud-bom` to be automatically added when the data flow bom
is required so it is referenced as "additional BOM" as well.
Closes gh-189
BOMs are structured in such a way than adding one to the project may
require another one(s) to be added to the project.
This commit adds an `additionalBoms` property to `BillOfMaterials` that
can be used to refer the BOM(s) that should be automatically added if
said BOM is added to the project.
Closes gh-190
Previously, Spring Initializr was refering to
`spring-cloud-starter-parent` as the BOM source for any cloud-related
dependencies.
This pom actually inherits from a specific version of Spring Boot and
brings all its dependency management. If the chosen boot version and the
one that the cloud bom brings do not match, inconsistent versions can
appear in the project.
The underlying issue was fixed by providing a new BOM that only provides
dependency management for the cloud-related bits.
Closes gh-116
Previously, only an invalid type or an invalid dependency would lead to
an exception and in such case, no event is fired at all.
This commit adds validation for language and packaging as well as a new
event that is fired when the project could not be generated.
The metrics infrastructure has been updated to handle ProjectFailedEvent;
when such an event is fired, the 'failures' counter is increased and we
still record all the other metrics.
Closes gh-188
Replace `ProjectGenerationListener` by an event that is thrown via the
regular `ApplicationEventPublisher`. This allows any arbitrary bean to
listen to the event without the need of implementing an interface.
Closes gh-184
As of Spring Boot 1.4, lombok is managed and we should no longer provide
a version for it. This commit makes sure to remove the version as of
Spring Boot 1.4
Closes gh-182
Spring Boot 1.4 has renamed the `spring-boot-starter-redis` to
`spring-boot-starter-redis`. This commit adds support for the former up
to 1.4 (exclusive) and the later as from 1.4
Closes gh-174
If the `initializr.env.google-analytics-tracking-code` is specified with
the tracking code to use, the web UI automatically integrates with Google
Analytics.
Closes gh-180
GMavenPlus is not properly supported on Eclipse so a Groovy-based
project using Maven now breaks in that IDE. Let's revert the support
until we find a better solution.
Spring Initializr mostly uses tabs but some files were inconsistently
using spaces. This commit harmonizes the templates so that any generated
project uses tabs consistently.
A groovy-based project using Maven now builds with GMavenPlus as the
Groovy Eclipse maven compiler does not seem to be maintained anymore.
This commit also harmonizes the location of the code to be
`src/main/groovy` for both Gradle and Maven builds.
Joint compilation is enabled by default so that you can create pure Java
code in `src/main/java` and refer to any class within the project.
Users of IntelliJ IDEA may want to install a plugin that automatically
adds `src/main/groovy` to the sources when the GMavenPlus plugin is
added to the pom, see https://plugins.jetbrains.com/plugin/7442
Closes gh-90
Spring Initializr does not support the provided scope properly with
Gradle as it relies on the `providedRuntime` configuration added by the
war plugin.
Lombok should be added with an optional flag anyway so until the
service properly supports it, lombok is defined again with the default
(compile) scope.
Closes gh-171
Register an additional endpoint at `/dependencies` that returns the
necessary information about the registered dependencies for a Spring
Boot version. If the `bootVersion` request parameter is not specified,
the default Spring Boot version is used.
The json content contains the artifact coordinates as well as the
necesasry BOM or repository to add. This information should be useful
enough for any tool to add additional dependencies to an existing
project or create one from scratch.
Closes gh-140
If a dependency is fist managed by the service and later on by Spring
Boot, there is no way to keep a single entry that would change the
dependency according to the Spring Boot version.
A hack would consist of creating two entries that would have an exclusive
range but it's far from ideal.
This commit adds a `versions` attribute on each dependency that can
define an arbitrary number of mappings between a version and a range. If
one of those range matches, the related version is used (and the absence
of version means that no version need to be included). If no mapping
matched (or if there are no mappings at all), the default version is
used.
Closes gh-168
Update controllers to add an ETag information so that meta-data is cached
on the client.
Also enables the compression for json, css and html resources.
Closes gh-165
The new layout broke some integration tests as it is now necessary to
click on a link to display additional options.
Tests have also been rewritten to take the new design (and new features)
into account.
Make sure to register the necessary configuration entry for Gradle when
a provided dependency is added as the build will fail otherwise.
Interestingly enough, this was only taken care of if the packaging is war
as we add the tomcat starter explicitly. We rather now add any provided
dependencies to the build with no special handling there, adding the
tomcat server in the model if necessary.
Closes gh-164
Remove the cloud dependency until Spring Boot itself provides a
dependency management for it. Also fix the scope so that lombok does
not leak in other projects.
Closes gh-154
Previously, all dependencies were considered equal and enough to compile
and start the simple auto-generated boot application. There are some
corner cases such as the JDBC drivers and the new Ratpack integration.
This commit adds an extra flag on a dependency that determines if it is
a starter or not (the default is true). When no starter dependency has
been selected for the project, the root starter (`spring-boot-starter`)
is automatically added.
Closes gh-159