Commit Graph

315 Commits

Author SHA1 Message Date
Stephane Nicoll
50cb4f7c39 Harmonize service capabilities
Command line tools are invited to discover the HAL-compliant links
defined in the meta-data while Spring Boot CLI is a working client
application and requires a description of the capabilities in a more
high-level format.

Capabilities are now customized for those use cases.

Closes gh-77
2015-02-18 20:43:12 +01:00
Stephane Nicoll
3e7658c879 Improve command-line service capabilities
Provide a polished version of the command-line service capabilities
with tables and support for the new version range.

Also support SpringBootCli explicitly so that the service capabilities
are rendered directly by the server instead of having the client parsing
the meta-data manually.

Closes gh-76
2015-02-18 17:24:09 +01:00
Stephane Nicoll
a6afbd7960 Add version range in command-line help 2015-02-17 17:44:49 +01:00
Stephane Nicoll
0d1f920ea6 Improve test coverage
Validate that a client can request all the meta-data versions it support
to let the server choose the one it supports.
2015-02-17 16:57:10 +01:00
Stephane Nicoll
da2ced86f3 Add version range support for dependencies
Previously, it was not possible to define the Spring Boot version that
a dependency requires. As a result, many new starters implemented as part
of Spring Boot 1.2 are not available.

Each dependency can now define a `versionRange` attribute that defines
the Spring Boot version range that it supports. The range is defined
either as a single version, in which case it defines that version and
any later versions or using brackets. A square bracket (`[` or `]`)
denotes an inclusive range while a round bracket (`(` or `)`) denotes an
exclusive range.

Bumped the current-metadata format to 2.1 to include this additional
`versionRange` attribute, that is

application/vnd.initializr.v2.1+json

Existing clients requesting v2 will not get any dependency that defines
a `versionRange` attribute.

Closes gh-62
2015-02-17 15:05:28 +01:00
Brian Clozel
8c0dc68a51 Add version range support in web UI
This commit introduces zepto.js as a minimal front-end library to
manipulate the DOM and a lightweight library `Versions` to parse and
compare version ranges (OSGI style).

With this change, only Boot starter dependencies that are compatible
with the selected Boot version should be displayed in the UI.

Partial fix for #62
2015-02-17 13:58:42 +01:00
Stephane Nicoll
5a4a2b9f81 Migrate smoke tests to Geb
Since Htmlunit does not provide a complete support for Javascript, smoke
tests are migrated to Gab (i.e. using Selenium and an actual browser).

This present a major challenge: it is not easy to assert the content of
a file that the browser downloads when it submits a form. First, the
browser should be configured to download the file directly instead of
opening a (native) pop-up asking the users where to download it. Then,
the tests should be aware of the location of the file in order to assert
it.

Hopefully, Firefox can be configured to achieve this goal.

Closes gh-75
2015-02-17 13:52:39 +01:00
Stephane Nicoll
1a213cdbc7 Remove support for deprecated meta-data V1
Closes gh-74
2015-02-12 11:33:21 +01:00
Stephane Nicoll
0e5e825181 Update project layout for Groovy-based projects
A groovy-based project on Maven provides a better developer experience
if the sources are located in src/main/java and src/test/java.

This commit updates the generator to use this new location while keeping
the existing src/main/groovy project for Gradle builds.

Fixes gh-71
2015-02-12 11:32:26 +01:00
Stephane Nicoll
bd6d493f75 Improve HAL urls
Remove `type` as a template variable since each action actually defines
the related type. This commit however does not address all the concerns
raised in gh-69; since the configuration is generic, there is no way to
know that a particular action handles one and only one type so removing
the type because it is redundant is not really possible.

Besides, the zip and tgz endpoints aren't exposed via configuration
either so offering such choice via the HAL-urls is not possible either.

Partially fixes gh-69
2015-02-12 11:30:48 +01:00
Stephane Nicoll
634971ada4 Merge pull request #35 from bclozel/gh-35
* gh-35:
  Improve CSS layout
2015-01-27 14:00:55 +01:00
Brian Clozel
878087f235 Improve CSS layout
This commit improves the page layout:
* use lighter fonts for the curl command line
* align download buttons
* dependency choices are now using "col-xs-*" classes for mobile devices
2015-01-26 15:53:42 +01:00
Stephane Nicoll
81a5d80b2c Update README with recent command-line improvements 2015-01-21 08:35:03 +01:00
Stephane Nicoll
d2308a16b7 Fix typos in changelog 2015-01-21 08:31:05 +01:00
Stephane Nicoll
893966ad62 Add support for HTTPie
Closes gh-70
2015-01-20 18:59:45 +01:00
Stephane Nicoll
272db6ef7a Explicit support for curl
Add an explicit support for curl by returning a text description of the
service instead of the raw meta-data. curl users can still discover the
json metadata by setting the appropriate Accept header.

Also support for explicit "text/plain" if the user requires it. In this
case a generic text description is returned.

Closes gh-67
2015-01-20 18:52:32 +01:00
Stephane Nicoll
cb0c2b2e4e Improve project description 2015-01-17 10:29:26 +01:00
Stephane Nicoll
7680064421 Add license 2015-01-17 10:28:41 +01:00
Stephane Nicoll
4bb4372454 Merge pull request #68 from isopov/patch-1
* patch-1:
  Removing extra ) char from link
2015-01-16 16:49:36 +01:00
Ivan Sopov
e4a8e86047 Removing extra ) char from link 2015-01-16 16:49:23 +01:00
Stephane Nicoll
22e3567c42 Fix typo 2015-01-16 14:35:59 +01:00
Stephane Nicoll
3b0509a9bb Add baseDir option
Previously the generated archive wasn't self contained and the user had
to create a dedicated directory before extracting it in case the archive
utility does not handle that use case (MacOS supports that by default).

A baseDir request attribute has been added and generate a base directory
in the archive when set. It is enabled by default in the web UI and takes
the same value as the artifactId. Other clients are unaffected by this
change (and shouldn't probably).

Note that the legacy HTML form isn't impacted by this change either as
older STS versions expect the archive to have a very specific format.

curl-based tools can use that new baseDir request parameter to specify
that a base directory is required, something like

curl https://start.spring.io/starter.tgz -d baseDir=my-project

Closes gh-65
2015-01-16 14:29:57 +01:00
Stephane Nicoll
81df61931a Add changelog 2015-01-16 13:14:20 +01:00
Stephane Nicoll
d35482a61b Use SpringBootApplication when available
If Spring Boot 1.2 or later is used, the generated project uses the new
SpringBootApplication annotation as a replacement for what used to be
configured by Configuration, ComponentScan and EnableAutoConfiguration.

Also add an infrastructure to parse and compare versions.

Closes gh-46
2015-01-15 09:27:14 +01:00
Stephane Nicoll
b8e26a2d3a Move support test classes to io.spring.initializr.test
Previously, the Assert helpers were located in the support package that
is also used by some support classes in the production code. Having both
test helpers and tests in the same package is a bit confusing.

Those test helpers are now relocated to a dedicated test package.
2015-01-14 11:55:34 +01:00
Stephane Nicoll
6f4d940ff7 Uprade to Spring Boot 1.2.1 2015-01-08 16:26:00 +01:00
Stephane Nicoll
529f6dc5f1 Update to Groovy 2.3
Update Initializr and the Groovy-based projects it generates to the
groovy 2.3 compiler. This fixes a compatibility issue with Java 8

Fixes gh-64
2014-12-24 10:00:14 +01:00
Stephane Nicoll
5092e32a26 Add tests for Groovy-based projects
Closes gh-61
2014-12-19 16:13:45 +01:00
Stephane Nicoll
fd85022ef6 Use project name to infer the name of the app
The 'name' field can now be used to customize the name of the generated
application (and its test counterpart). A default application name is
used If no suitable identifier can be inferred from the specified name.

Concretely, this means that the default application name is no longer
`Application` but `DemoApplication` since the default name is `demo`.

Closes gh-60
2014-12-19 12:19:01 +01:00
Sebastien Deleuze
4ab189539e Add a link to the GitHub project
Closes gh-52
2014-12-15 12:21:09 +01:00
Sebastien Deleuze
7740640e4d Move <properties> element before <dependencies> one 2014-12-15 11:44:41 +01:00
Stephane Nicoll
64b62875c4 Upgrade to Spring Boot 1.2.0 2014-12-13 11:13:39 +01:00
Stephane Nicoll
7b79a37a66 Fix wrong dependency metric
Previously if a project was generated  with no defined dependency; a
metric with id 'counter.initializr.dependency.' was published. We now
make sure to properly identify that default use case and no metrics gets
published in such a case.

Fixes gh-57
2014-12-10 14:00:30 +01:00
Stephane Nicoll
9e01b9af71 Improve media type assertion
Instead of doing a strict equality between the expected media type
and the one received in the response, we use isCompatibleWith that
ensure that at least the expected capabilities are present.
2014-12-08 18:07:27 +01:00
Stephane Nicoll
627838cc44 Add contributing page 2014-12-08 15:59:12 +01:00
Stephane Nicoll
e86830df39 Migrate to asciidoc 2014-12-08 15:54:25 +01:00
Stephane Nicoll
1dca5d4630 Clarify the use of the milestone repository 2014-12-08 15:42:02 +01:00
Stephane Nicoll
6c5d7b68ee Merge pull request #51 from gregturn/switch-to-https
* switch-to-https:
  Switch to https for build files
2014-11-20 17:50:00 +01:00
Greg Turnquist
a87d53bef3 Switch to https for build files 2014-11-20 10:13:16 -06:00
Stephane Nicoll
0b88ebc3a4 Update to Spring Boot 1.1.9 2014-11-19 15:43:17 +01:00
Stephane Nicoll
addeb79bca Alias style to dependencies
Style is the only parameter that deviates from the default names in the
metadata. As 'dependencies' is the name used in the metadata, it can be
used as an alias of style. This simplifies the HAL-generated URLs

Fixes gh-50
2014-11-19 15:32:06 +01:00
Stephane Nicoll
6116ca94aa Update metadata format to v2
Update the metadata format in a non backward compatible way to ease
the use of the service from 3rd party clients. The updated metadata
format is now more descriptive and HAL-compliant and can be used with
Spring HATEOAS to build a client.

Metadata v1 is still served to preserve backward compatibility with
Spring Boot 1.2.0.RC1.

Closes gh-49
2014-11-19 15:30:39 +01:00
Dave Syer
8427b32a8e Add reference to springMilestone profile
Fixes gh-44
2014-11-05 16:09:25 +00:00
Stephane Nicoll
d1a51c431b More metadata for types
This commit adds a 'tags' attribute to each type. Two tags are currently
available:

1. build defines the build system that should be included in the project
(maven and gradle)
2. format defines the format of the project (build for the build file and
project for a project archive)

When a type id is specified, the build tag is used to figure out which
build system should be used. If no type is specified we fallback to Maven
as we were already doing.

Fixes gh-43
2014-10-30 11:15:47 +01:00
Stephane Nicoll
7350cd165d Proper exception management
This commit updates the service to throw dedicated exception types for
common user error and associates proper HTTP status codes to them.

Fixes gh-38
2014-10-30 10:45:43 +01:00
Stephane Nicoll
1136d76b1b Fix type id
This commit improves the structure of the type id as it may be used by
third party clients. The id now defines the build system and the nature
of the project.

Because STS hardcodes those IDs, a new (deprecated) property on type
has been introduced to keep track of them. When serving the legacy HTML
page that STS parses, those ids are used instead.

Fixes gh-39
2014-10-30 09:31:03 +01:00
Stephane Nicoll
4ebc50dda3 Revert "Fix type id"
This reverts commit 8f1ce31035.
2014-10-27 21:28:39 +01:00
Stephane Nicoll
5f0bb06e8f Fix potential NPE with unknown Spring Boot starter
Fixes gh-41
2014-10-25 15:15:46 +02:00
Stephane Nicoll
109f93424b Support for dependency description
This commit updates the configuration format and JSON metadata output
to support an additional description attribute.

The description attribute is meant to further describe the purpose of the
dependency. This is a minor update to the JSON format that is fully
backward compatible.

Fixes gh-40
2014-10-24 14:06:45 +02:00
Stephane Nicoll
09f91aa53b Add Content-Disposition to all endpoints
Prior to this commit, the browser was "guessing" the file name to use for
Maven and Gradle build files. This commit harmonizes the endpoints so
that they provide a Content-Disposition header with a preferred file
name.
2014-10-24 11:34:31 +02:00