Commit Graph

266 Commits

Author SHA1 Message Date
Stephane Nicoll
b6657211f6 Review TemplateRenderer abstraction
Closes gh-818
2019-02-08 10:53:49 +01:00
Stephane Nicoll
6e9f542560 Polish 2019-02-08 10:24:59 +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
0d5efd24ba Add support for customizable project generation
This commit adds a project generation infrastructure based on the
abstraction defined thus far. Each project is described by a
`ProjectDescription` that provides the basic information about the
project such as language, build system, packaging, platform version
and more.

Each project runs in a dedicated `ProjectApplicationContext` where
contributors and customizers are elected to generate the project.

Customizers are meant to update the model based on the
`ProjectDescription` and other factors while contributors consume
models to generate project assets (build files, source files, etc).

Because project generation runs in a dedicated context, components can
be flagged with special conditions that enable them only when necessary.
Several conditions are provided in this commit to enable a component
based on the language, build system, packaging, platform version or
requested dependency.

See gh-340

Co-authored-by: Andy Wilkinson <awilkinson@pivotal.io>
Co-authored-by: Madhura Bhave <mbhave@pivotal.io>
2019-02-08 09:50:34 +01:00
Andy Wilkinson
2cb1f3e647 Add packaging abstraction
Closes gh-815

Co-authored-by: Stephane Nicoll <snicoll@pivotal.io>
2019-02-08 09:50:34 +01:00
Andy Wilkinson
3f585337da Add Maven build support
This commit provides a Maven build system implementation with a writer
that can generate `pom.xml` files based on a configurable model.

Closes gh-814

Co-authored-by: Stephane Nicoll <snicoll@pivotal.io>
2019-02-08 09:50:34 +01:00
Andy Wilkinson
2bd64ed6ed Add Gradle build support
This commit provides a Gradle build system implementation with a writer
that can generate `build.gradle` and `settings.gradle` files based on a
configurable model.

See gh-814
2019-02-08 09:50:34 +01:00
Andy Wilkinson
1dbed8cdf8 Add build abstraction
This commit adds a build abstraction with a base model that concrete
build systems can reuse.

See gh-814

Co-authored-by: Stephane Nicoll <snicoll@pivotal.io>
2019-02-08 09:50:34 +01:00
Stephane Nicoll
b5ba883b02 Add Groovy language support
This commit provides a Groovy language implementation with a writer that
can generate a `.groovy` source file based on a configurable model.

Closes gh-813
2019-02-08 09:50:34 +01:00
Stephane Nicoll
bdfa852675 Add Kotlin language support
This commit provides a Kotlin language implementation with a writer that
can generate a `.kt` source file based on a configurable model.

See gh-813
2019-02-08 09:50:34 +01:00
Andy Wilkinson
d0d4809ee9 Add Java language support
This commit provides a Java language implementation with a writer that
can generate a `.java` source file based on a configurable model.

See gh-813

Co-authored-by: Stephane Nicoll <snicoll@pivotal.io>
2019-02-08 09:50:34 +01:00
Andy Wilkinson
77bb7eb3ac Add language abstraction
This commit adds a `Language` on the JVM abstraction with well known
concepts such as `Annotation`, `Parameter`, `CompilationUnit` and
`TypeDeclaration` that concrete language implementations can reuse.

See gh-813

Co-authored-by: Stephane Nicoll <snicoll@pivotal.io>
2019-02-08 09:50:34 +01:00
Stephane Nicoll
b6e675de40 Add writer with indent support
This commit adds an `IndentingWriter` with a factory that supports
different indenting option according to a content identifier (e.g. a
language).

Closes gh-812

Co-authored-by: Andy Wilkinson <awilkinson@pivotal.io>
2019-02-08 09:50:34 +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
Madhura Bhave
1bd84fe0ce Use metadata used for project generation for stats
Closes gh-810
2019-02-06 11:39:05 -08:00
Stephane Nicoll
8a0d413a06 Clean build assertions 2019-02-05 16:36:56 +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
f5395c07e1 Split metadata specific exception from InitializrException 2019-01-31 11:14:18 +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
662c0b1e15 Remove reference to InitializrMetadataTestBuilder from metadata tests
This will ease the migration of the metadata to its own module
2019-01-30 14:33:41 +01:00
Rob Tompkins
96540f5bcd Upgrade generator to Maven 3.6.0
Closes gh-794
2019-01-29 15:30:48 +01: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
2816c21631 Migrate generator tests to JUnit5
Closes gh-802
2019-01-24 10:04:00 -08:00
Stephane Nicoll
4810d8aac2 Harmonize .gitignore generation 2019-01-22 20:54:19 +01:00
Stephane Nicoll
1fcf48e2fa Skip providedRuntime configuration block with war projects
Closes gh-796
2019-01-10 14:57:10 +01:00
Stephane Nicoll
e34720a35a Remove hard-coded reference to Eclipse plugin
Closes gh-795
2019-01-09 15:36:00 +01:00
Madhura Bhave
29a8e9b32c Remove redundant assertion 2019-01-09 15:21:59 +01:00
Madhura Bhave
52599b0600 Move Kotlin task customization to the bottom 2019-01-09 15:18:23 +01:00
Madhura Bhave
ed5d5398ad Remove unnecessary whitespace 2019-01-09 15:18:23 +01:00
Madhura Bhave
19301ed6ff Use single quotes where string interpolation not required 2019-01-09 14:57:27 +01:00
Madhura Bhave
395567ca1d Remove surrounding brackets for gradle dependencies
Closes gh-797
2019-01-09 14:57:18 +01:00
Stephane Nicoll
b17da2489c Polish 2019-01-08 09:32:41 +01:00
Madhura Bhave
3ceb608f87 Add a gradle assertion for build properties
See gh-781
2019-01-07 13:14:55 -08:00
Madhura Bhave
3982ceceeb Group build properties under ext
Closes gh-781
2019-01-07 12:43:51 -08:00
Stephane Nicoll
e23132747b Surround sourceCompatibility with single quotes
Closes gh-791
2019-01-05 10:13:06 +01:00
wonwoo
a515a49a68 Update examples to mention Java 11
Closes gh-787
2019-01-01 11:00:57 +01:00
Stephane Nicoll
af39236360 Harmonize Groovy code format
Closes gh-785
2018-12-13 13:42:11 +01:00
Stephane Nicoll
3868019f87 Simply repository definition with Maven
Closes gh-782
2018-12-12 11:25:13 +01:00
Stephane Nicoll
8e6b5e9cf5 Remove default packaging from generated pom
Closes gh-780
2018-12-11 10:25:05 +01:00
Stephane Nicoll
c3079c5609 Polish 2018-12-11 09:54:24 +01:00
Stephane Nicoll
87b6a320fc Polish Kotlin code format 2018-12-10 15:09:45 +01:00
Stephane Nicoll
fc7cc42d62 Polish code format 2018-12-10 15:02:22 +01:00
Stephane Nicoll
742db270d8 Stop registering java.version as a VersionProperty 2018-12-06 14:08:45 +01:00
Stephane Nicoll
bba9eb7a33 Polish generated pom
This commit removes two useless properties that are already contributed
by `spring-boot-starter-parent`.
2018-12-06 13:49:09 +01:00
Stephane Nicoll
4a75ad6b21 Polish Maven pom structure 2018-12-05 16:36:40 +01:00
Stephane Nicoll
185e18cd5e Prevent project prior to Spring Boot 1.5 to be generated
See gh-763
2018-11-29 10:35:06 +01:00
Stephane Nicoll
f5d440506e Simplify project generation version checks
This commit simplifies project generation by only checking for supported
Spring Boot version (i.e. 1.5 and later) and therefore removing any
logic that is specified to a non supported version.

Concretely, initializr is no longer able to generate a project for a
Spring Boot version prior to 1.5

Closes gh-763
2018-11-29 10:16:50 +01:00
Stephane Nicoll
dbd865a526 Adapt test suite to more recent Spring Boot versions
See gh-763
2018-11-29 10:16:50 +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
2a7b8f782d Upgrade to Gradle 4.10.2
Closes gh-779
2018-11-28 14:14:09 +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
Stephane Nicoll
9c5dfb34e9 Fix version format for Gradle versions
Closes gh-777
2018-11-27 17:57:36 +01:00
Stephane Nicoll
d5b616cdb2 Fix duplication of dependencies with alias
This commit fixes `getAllDependencies()` to stop returning duplicates
when a dependency declares an alias.

Closes gh-772
2018-11-20 17:54:05 +01:00
Stephane Nicoll
41f37027c6 Review jpa facet support
Closes gh-762
2018-11-05 17:47:48 +01:00
Andy Wilkinson
b009101aa6 Upgrade to Maven Wrapper 0.4.2
Closes gh-746
2018-10-31 11:04:30 +00:00
Paul Balogh
2d2ffe4013 Fix deprecated Gradle dependency configuration
See gh-730
2018-09-28 15:36:21 -04:00
Stephane Nicoll
c035244181 Polish "Enable kotlin jpa plugin if necessary"
Closes gh-728
2018-09-28 15:30:58 -04:00
Rui Figueira
5f79f9a0fe Enable kotlin jpa plugin if necessary
This commit add the jpa kotlin plugin in the generated project when a
dependencies has the jpa facet.

See gh-728
2018-09-28 15:23:59 -04:00
Stephane Nicoll
fc20447b21 Allow to override BOM's groupId/artifactId
Closes gh-723
2018-08-14 11:12:25 +03:00
Stephane Nicoll
f141927b7b Upgrade generator to Maven 3.5.4 2018-08-13 18:41:22 +03:00
Stephane Nicoll
fc0b9207f0 Upgrade to spring-javaformat 0.0.6 2018-07-31 18:01:40 +02:00
Stephane Nicoll
e208a9b1f1 Redirect browsers to https when forceSsl is set
This commit extends the forceSsl support to redirect any HTML content
to https. Practically speaking, this allows to redirect all browsers to
https when they land on the main page using https. Serving traffic via
http is still allowed as preventing this would break a lot of
existing clients.

To allow to easily run the app locally, forceSsl is false and must be
enabled for any production environment.

Closes gh-473
2018-07-27 16:56:30 +02:00
Spring Buildmaster
34b518d49f Next Development Version 2018-07-10 12:29:54 +00:00
Stephane Nicoll
765385530e Upgrade to Gradle 4.8.1
Closes gh-688
2018-07-09 09:01:55 +02:00
Madhura Bhave
ec87ca3ace Support annotationProcessor scope
Fixes gh-653
2018-07-05 09:26:42 -07:00
Madhura Bhave
45e3b3399a Remove duplicate entry in generated gradle .gitignore
Fixes gh-700
2018-07-03 10:33:16 -07:00
Madhura Bhave
d38fa831e0 Expose resolved version range if .x present
Fixes gh-586
2018-06-28 10:55:44 -07:00
Phillip Webb
91a2db4176 Fix checkstyle violations 2018-05-31 16:19:02 -07:00
Phillip Webb
45688ffcd2 Format code 2018-05-31 16:19:02 -07:00
Phillip Webb
3f23096f27 Fix copyright header for files changed this year 2018-05-31 16:17:45 -07:00
Stephane Nicoll
492d227492 Make kotlin version mandatory only if Kotlin is enabled
Closes gh-617
2018-05-18 17:45:40 +02:00
Stephane Nicoll
8336ee6ef6 Use a fallback if no 'web' dependency is available
Closes gh-435
2018-05-18 17:24:56 +02:00
Stephane Nicoll
7802176faa Remove Java 9 support
To align with Oracle's support policy, this commit only keeps Java 8 and
10. This effectively removes 1.7 as well.

Closes gh-662
2018-05-18 16:32:42 +02:00
sdeleuze
71b8759f40 Ignore /out/ directory with Gradle
Closes gh-657
2018-04-20 07:07:24 +02:00
Stephane Nicoll
66f06be15b Add support for Jenkins X 2018-04-16 16:44:02 +02:00
Stephane Nicoll
432be66c5a Polish contribution
Closes gh-655
2018-04-16 16:21:30 +02:00
Phillip Webb
593759f321 Fix IDE warnings
Fix warnings shown in Eclipse
2018-04-13 12:36:06 -07:00
Phillip Webb
923fb58ffc Fix checkstyle violations
Fix checkstyle violations using a pre-release version of the
spring-javaformat rules.
2018-04-13 12:36:06 -07:00
Phillip Webb
eb5211960c Migrate tests to AssertJ
Refactor all existing tests to use AssertJ assertions.
2018-04-13 12:36:06 -07:00
Phillip Webb
6493eae015 Apply automatic cleanup rules
Apply code cleanup rules from Eclipse for better consistency.
2018-04-13 12:36:06 -07:00
Phillip Webb
3d4efbf525 Reformat code
Format code using a pre-release version of the spring-javaformat plugin.
2018-04-13 12:36:06 -07:00
Phillip Webb
0c0556c585 Add Eclipse IDE support files
Add additional files to make development with Eclipse easier.
2018-04-13 12:31:11 -07:00
Phillip Webb
6309b33ee5 Format POM.xml files
Reformat POM.xml files for consistency.
2018-04-13 12:30:14 -07:00
Andy Wilkinson
3e2ef6db10 Limit ignoring of directories in Git to the root of the repository
Closes gh-623
2018-04-06 14:15:08 +01:00
Stephane Nicoll
da5be4d1b2 Polish 2018-03-29 11:02:59 +02:00
Stephane Nicoll
ad785527f1 Move to assertJ 2018-03-29 10:59:40 +02:00
Stephane Nicoll
a99595bfae Remove dead code 2018-03-29 10:18:14 +02:00
Stephane Nicoll
5fef28a763 Polish "Create a settings.gradle file for Gradle projects"
Closes gh-643
2018-03-29 10:14:47 +02:00
Chris Vogel
aa75b1efaa Create a settings.gradle file for Gradle projects
See gh-643
2018-03-29 09:40:48 +02:00
Andrew Holland
5f9d80d0d7 Ignore the new .sts4-cache folder added as part of STS 4
Closes gh-624
2018-03-18 13:38:30 -04:00
Stephane Nicoll
39932bc0c5 Upgrade to Maven 3.5.3
Closes gh-622
2018-03-08 13:49:58 +01:00
Stephane Nicoll
c6951c45fb Polish test logging 2018-03-08 11:55:11 +01:00
Stephane Nicoll
fe7650f2c8 Upgrade to Spring Boot 2.0.0
This commit upgrades to Spring Boot 2.0.0.

Please note that this commit does not change metrics names to use new
features of Micrometer yet (see gh-526)

Closes gh-611
2018-03-01 08:00:49 +01:00
Stephane Nicoll
eb811a557e Avoid recursion in computeIfAbsent 2018-02-28 20:14:26 +01:00