Commit Graph

158 Commits

Author SHA1 Message Date
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
Sebastien Deleuze
d703f13601 Add kotlin-reflect dependency for Kotlin projects
Closes gh-361
2017-01-31 13:56:28 +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
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
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
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
5efc6dc947 Prepare for Spring Boot 1.5 compatibility 2017-01-06 13:06:31 +01:00
Kamil Szymanski
36c7d30f4b Remove redundant targetCompatibility from gradle buildscript
See gh-330
2017-01-03 14:55:12 +01:00
Stephane Nicoll
54c118ed70 Switch to Gradle 3 as of Spring Boot 2
This commit automatically switches Gradle-based project to Gradle 3 if
Spring Boot 2 or higher is selected. Other projects remain on 2.x

Closes gh-331
2017-01-03 14:52:16 +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
Stephane Nicoll
5149d0c965 Remove unecessary newline 2016-12-28 13:44:53 +01:00
Sebastien Deleuze
e6cf9cf658 Upgrade to Kotlin 1.0.6 with kotlin-spring plugin
The kotlin-spring plugin automatically opens classes annotated or
meta-annotated with annotations like @Component or @Transactional.

Closes gh-333
2016-12-28 13:41:01 +01:00
dev
a3a05000b0 template should load with utf-8 and save with utf-8 2016-12-07 09:29:58 +00:00
Stephane Nicoll
7a20b7f71b Polish
Closes gh-317
2016-11-25 16:04:13 +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
Stephane Nicoll
0a4f631b3a Harmonize metadata term 2016-11-22 01:43:36 +09:00
Stephane Nicoll
079f46f51c Support for compileOnly scope
start.spring.io exposes an annotation processor (Lombok) that's quite
popular but is exposed as a compile/transitive dependency. This commit
introduces a `compileOnly` scope that maps to Gradle's `compileOnly`
scope and Maven's `optional` flag.

There is a case to support optional dependencies in general but
unfortunately, Gradle doesn't have support for such feature.

Closes gh-128
2016-11-04 11:38:15 +01:00
Stephane Nicoll
cc44d346fd Add .apt_generated to .gitignore
Closes gh-303
2016-10-19 13:00:49 +03:00
Stephane Nicoll
91c9ad384b Use new gradle plugin ID as of Spring Boot 1.4.2
Closes gh-296
2016-10-07 15:59:02 +02:00
Stephane Nicoll
2be67fdba7 Polish .gitignore generation
See gh-131
2016-09-21 14:18:20 +02:00
Stephane Nicoll
7bd1253c5d Polish 2016-09-20 18:26:21 +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
99fbe8a5ad Add support for NetBeans agent
Closes gh-290
2016-09-20 14:20:54 +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
0d167411a8 Remove Eclipse workaround
Closes gh-275
2016-08-30 16:15:38 +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
fb7b8eb5cb Associate property to bom version
This commit allows to specify a property for the version of a BOM. If
that value is defined, a version property is automatically added to the
build to allow to easily configure the value.

Closes gh-181
2016-07-20 13:54:31 +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
42c62a7fd3 Make report encoding explicit
Closes gh-255
2016-07-13 09:12:38 +02:00
Stephane Nicoll
c3dfbc828e Polish custom maven parent pom support 2016-07-12 16:07:46 +02:00
Stephane Nicoll
6089f49c1a Add build-specific tests 2016-07-12 14:42:41 +02:00
Stephane Nicoll
6099a1c6bc Externalize dependency management plugin version
Closes gh-253
2016-07-12 14:29:58 +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
bd323680ea Fix test assertion
Make sure to normalize the content that's read from disk to ensure
to adapt any platform-specific characters.

Closes gh-247
2016-07-08 14:45:57 +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
a3e902b8f0 Prevent ArrayIndexOutOfBoundsException
This commit switches SingleSelectCapability content to
CopyOnWriteArrayList to prevent ArrayIndexOutOfBoundsException in case
of concurrent updates of boot versions.

Note that there is way to mitigate that in 1.4 with the use of the `sync`
attribute, see gh-251

Closes gh-229
2016-07-08 11:45:14 +02:00
Stephane Nicoll
4192e601fe Fix typo
See gh-243
2016-07-06 11:02:20 +02:00
Stephane Nicoll
f1322750b8 Fix SpringBootServletInitializr import
As of Spring Boot 1.4.0.M3, `SpringBootServletInitializer` has been
relocated to the `org.springframework.boot.web.support` package. This
commit makes sure to use the new location if a project is generated for
Spring Boot `1.4.0.M3` or higher.

Closes gh-243
2016-07-06 10:44:08 +02:00
Stephane Nicoll
1ac5e1c14b Polish contribution
Closes gh-226
2016-07-06 10:10:27 +02:00
Brian Devins
70c05ba246 Add dependency type attribute
See gh-226
2016-07-06 10:03:14 +02:00
Stephane Nicoll
6d8e57aaf0 Upgrade to dependency-management-plugin 0.6.0.RELEASE
Closes gh-242
2016-07-01 09:49:24 +02:00
Spencer Gibb
3824a8547e Upgrade maven-wrapper to use Maven 3.3.9
Closes gh-240
2016-06-25 11:47:52 +02:00
Stephane Nicoll
5f44f54e3a Upgrade to Gradle 2.13
Closes gh-233
2016-05-19 23:42:49 +02:00
Vedran Pavic
1dd264dd66 Remove explicit Gradle wrapper task
Closes gh-222
2016-05-01 08:28:53 +02:00
Stephane Nicoll
2d9ac9bd5a Improve dependency mapping to include coordinates
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
2016-04-24 05:20:59 +02:00
Stephane Nicoll
abf16f8b1a Fix typo 2016-04-14 16:09:18 +02:00
Stephane Nicoll
658475ad4f Add support for new test infrastructure
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
2016-04-08 18:24:50 +02:00
Stephane Nicoll
046e39f232 Improve test coverage
This commit improves the test coverage to add strict template assertion
for well known use cases. This allows to catch obvious template issues.
2016-04-08 16:57:44 +02:00
Stephane Nicoll
544f7482d3 Fix war kotlin project
This commit fixes the generation of a web-based project using Kotlin by
propertly detecting the `ServletInitializer` template.

Closes gh-217
2016-04-08 16:33:46 +02:00
Stephane Nicoll
faba863db3 Fix template glitch
The project structure change has introduced some glitch that broke most
of the template.
2016-04-08 14:28:14 +02:00
Stephane Nicoll
542ee7d91b Modularize project structure
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
2016-04-08 12:01:38 +02:00