Commit Graph

95 Commits

Author SHA1 Message Date
Phillip Webb
595cb6d55b Fix version-type logic to deal with RCx form 2014-01-21 22:15:11 -08:00
Phillip Webb
d0f3e33f21 Remove unused test dependency 2014-01-21 21:05:06 -08:00
Phillip Webb
68293f34af Upgrade version to 1.0.0.BUILD-SNAPSHOT
Fixes fg-243
2014-01-21 00:43:54 -08:00
Phillip Webb
18cecd077d Move CLI integration tests into spring-boot-cli
Use `maven-failsafe-plugin` to run CLI integration tests as part of
the `spring-boot-cli` project, removing the need for
`spring-boot-cli-integration-tests`.
2014-01-20 12:12:10 -08:00
Dave Syer
5627caa724 Move spring-boot tests utilities to main spring-boot.jar
Fixes gh-233
2014-01-17 18:31:08 +00:00
Phillip Webb
c8a1d8830c Refactor CLI internals for REPL shell
Numerous updates to the Spring CLI, primarily for better embedded REPL
shell support:

* Refactor the CLI application to help separate concerts between the
  main CLI and the embedded shell. Both the CLI and embedded shell now
  delegate to a new `CommandRunner` to handle running commands. The
  runner can be configured differently depending depending on need.
  For example, the embedded shell adds the 'prompt' and 'clear'
  commands.

* Most `Command` implementations have been moved to sub-packages so that
  they can be co-located with the classes that they use.

* Option commands are now only used in the CLI, the embedded shell
  does not user them and details have been removed from the Command
  interface.

* The REPL shell has been significantly refactored to:
    - Support CTRL-C to cancel the running process. This is supported
      when running external commands and most internal commands.
    - Fork a new JVM when running commands (primarily for CTRL-C support
      but also for potential memory and classpath issues)
    - Change the "continue" trigger from `<<` to `\`
    - Support command completion of files
    - Add ANSI color output
    - Provide 'help' support for internal commands (such as 'clear')
    - Remove the now redundant `stop` command

Fixes gh-227
2014-01-15 14:03:18 -08:00
Andy Wilkinson
895daacde9 Roll spring-boot-maven-settings into the CLI 2014-01-14 10:06:45 +00:00
Andy Wilkinson
e96fa79c31 Don't pull test and provided dependencies into the CLI jar 2014-01-13 17:51:02 +00:00
Dave Syer
322af41d72 Revert CLI to JarLauncher
Affects gh-212
2014-01-11 07:15:47 +00:00
Phillip Webb
2c6231a0fc Restore eclipse settings to stop m2e errors 2014-01-10 10:47:49 -08:00
Andy Wilkinson
73b9899708 Use a single <manifestEntries> element
Previously, there were two <manifestEntries> elements in the CLI's
pom.xml. With certain versions of Maven, this appeared to cause the
first element to be ignored in favour of the second. The problem did
not occur when built locally with Maven 3.1.1, but did occur when built
by Bamboo which, I believe, uses 3.0.x

This commit combines the two <manifestEntries> into one.
2014-01-08 13:14:54 +00:00
Andy Wilkinson
a58e4cbb1f Add support for configuring Aether via settings.xml
Previously, Aether's configuration was largely hard-coded making it
impossible to configure a mirror, provide credentials for accessing
a repository, etc.

This commit adds support for configuring Aether via Maven's
settings.xml file. The support is optional and must be enabled by
grabbing spring-boot-maven-settings in an init script. The Aether
instance that's used when running the application will then be
configured using settings.xml. The settings file is expected to be
found in ${user.home}/.m2/settings.xml.

The configuration of the following items is currently supported:

 - Offline
 - Proxies
 - Mirrors
 - Server authentication
 - Local repository location

If the support is not enabled, settings.xml does not exist, or
settings.xml does not configure certain things then sensible defaults
are applied.
2014-01-08 11:21:56 +00:00
Dave Syer
4e1245d9ee Restore changes from 0332501 (fix class loader test failure) 2014-01-08 07:30:09 +00:00
Dave Syer
cd7b1b19c5 Add InitCommand to execute groovy script on startup
InitCommand runs on creation of SpringCli so it can search for additional
Commands in updated classpath. Also added as interactive command in Shell
session.
2014-01-06 11:40:21 +00:00
Dave Syer
033250195b Allow user to specify classLoader as loader property
PropertiesLauncher now supports creating its own class loader
from looader.classLoader property. It will succeed if the
implementation specified has a default constructor or one
that takes a parent class loader, or one that takes a URL[]
and a parent class loader (like URLClassLoader).
2014-01-06 11:40:20 +00:00
Dave Syer
4cfc7b6ad9 Make sure integration still works in CLI 2013-12-30 11:19:52 +00:00
Dave Syer
cccb5d4610 Add ShellCommand and friends 2013-12-23 22:13:50 +00:00
Phillip Webb
d04248a845 Use SHA1 checksum for homebrew 2013-12-18 23:19:24 -08:00
Phillip Webb
127da15c3c Add homebrew formula as generated artifact 2013-11-16 00:08:17 -08:00
Dave Syer
8cb0211dce Add "integration" profile in Maven build
By default it is on, but you can switch it
off (`-P '!integration'`) to ignore integration tests
and get a faster build.

.travis.yml uses this feature so that it doesn't keep
failing on a timeout.
2013-11-06 09:43:58 +00:00
Phillip Webb
aede0165a0 Favor groovy.jar instead of groovy-all.jar
Update CLI application to use groovy.jar rather than groovy-all.jar.
This prevents classloading issues when a user project @Grabs groovy-ant.
2013-11-05 09:56:59 -08:00
Phillip Webb
b19f6bb238 Isolate class loading for launched CLI apps
Rework classloading for launched applications so that CLI classes and
dependencies are not visible. This change allows many of the previous
hacks and workarounds to be removed.

With the exception of the 'org.springframework.boot.groovy' package
and 'groovy-all' all user required depndencies are now pulled in
via @Grab annotations.

The updated classloading algorithm has enabled the following changes:

- AetherGrapeEngine is now back in the cli project and the
  spring-boot-cli-grape project has been removed. The AetherGrapeEngine
  has also been simplified.

- The TestCommand now launches a TestRunner (similar in design to the
  SpringApplicationRunner) and report test failures directly using
  the junit TextListener. Adding custom 'testers' source to the users
  project is no longer required. The previous 'double compile' for
  tests has also been removed.

- Utility classes have been removed in favor of using versions from
  spring-core.

- The CLI jar is now packaged using the 'boot-loader' rather than using
  the maven shade plugin.

This commit also applied minor polish refactoring to a number of
classes.
2013-11-04 23:19:46 -08:00
Andy Wilkinson
e741557a38 Generate springcli.properties before resources are copied
Generate springcli.properties in generate-resources so that it can
be copied by the resources plugin in the process-resources phase.
2013-11-04 11:08:18 +00:00
Phillip Webb
a9c9c383f4 Polish pom.xml
Aplly consistent formatting, drop JDK 8 support and cleanup repo
locations to use spring.io.
2013-10-28 07:37:02 -07:00
Andy Wilkinson
1d5cb7731d Support transitive=false in AetherGrapeEngine
@Grab allows a dependency to be declared, but for its transitive
dependencies to be excluded by setting transitive to false. This
commit enhances AetherGrapeEngine to honour this setting by using a
wildcard exclusion on any dependency so declared.
2013-10-24 13:57:38 +01:00
Andy Wilkinson
c0ae78f3ec Isolate Aether in a separate class loader
Prior to this commit, the Aether-based GrapeEngine was loaded in the
same class loader as the rest of Boot. This led to Aether's and its
dependencies' types polluting the application's class path. Most
notably, this caused problems with logging as the logging framework
could be permaturely initialized.

This commit isolates AetherGrapeEngine, Aether and its dependencies
into a separate class loader. This is done by customizing the
packaging of the CLI's jar file with the internal directory housing
all of the types that will be loaded by the separate class loader.
2013-10-22 17:13:20 +01:00
Andy Wilkinson
39e8e46e2a Provide an Aether-based Grape Engine
Previously, @Grab annotations would use Ivy to download the
dependencies with some of Ivy's known limitations being worked around
by GrapeEngineCustomizer.

This commit adds a GrapeEngine implementation that uses Aether,
the dependency resolution 'engine' used by Maven and Grails. To ensure
consistent behaviour with a Maven build, the Aether-powered dependency
resolution uses the dependency management configuration from the
spring-boot-starter-parent pom file.
2013-10-22 16:06:53 +01:00
Andy Wilkinson
97f93bfa64 Support simple @Grab annotations everywhere
Previously, simple @Grab annotations only worked on classes. This commit
updates the simple @Grab support so that they can be used on anything
that can be annotated with @Grab.

The simplified @Grab support relies upon springcli.properties having
been generated. This commit adds an M2E lifecycle mapping for the
antrun plugin so that springcli.properties is generated as part of an
Eclipse build, thereby making it easier to run tests in Eclipse that
rely upon the simplified @Grab support.
2013-10-10 16:57:13 +01:00
Dave Syer
a72ab9eb7d Refactor cli properties into single project 2013-10-08 15:53:55 -04:00
Dave Syer
b5f0f97110 Clean up TestCommand paraphenalia 2013-10-08 15:39:37 -04:00
Greg Turnquist
1ce13cc2c2 Add 'spring test [files]' command to compile and test code automatically
- Look for JUnit test symbols, and add JUnit automatically
- Look for Spock test symbols, and add Spock automatically
- Based on what test libraries were used, invoke relevant embedded testers
  and accumulate results
- Make it so that multiple testers can be invoked through a single 'test' command
- Print out total results and write out detailed trace errors in results.txt
- Update based on the new artifact resolution mechanism
2013-10-08 12:09:54 -05:00
Andy Wilkinson
c1ec5e5c0e Support @Grab without a version or group
Usually, use of @Grab requires you to specify a group, module, and
version when identifying a dependency. This can be done in two
different ways:

@Grab(group='alpha', module='bravo', version='1.0.0')
@Grab('alpha:bravo:1.0.0')

This commit allows users to only specify a module: the group is
inferred and the version is the one dictated by the boot CLI. Both
forms are supported:

@Grab(module='bravo')
@Grab('bravo')

Groovy's global AST transformations, which is how Grab is implemented,
do not support ordering and we need to augment the AST for the Grab
annotation before its processed by the Grab AST transformation. To
work around this, reflection is used to get hold of the compile
operations in the conversion phase, and a new AST transformation is
inserted immediately before the first AST transformation operation.

To allow a module's groupId and version to be resolved consistently,
META-INF/springcli.properties has been enhanced to include properties
for each module that we want to support in the following form:

<module>.groudId = <groudId>
<module>.version = <version>

<groupId> and <version> are taken from the Maven project's
dependencies and VPP, a Velocity-based pre-processor, is used to
automatically generate the enhanced properties file.

To prevent pollution of spring-boot-cli's class path with the
dependencies that are only required to populate springcli.properties,
a separate project, spring-boot-cli-properties, has been created.
spring-boot-cli depends upon this now project causing it to, via the
shade plug, include the properties file in its jar.

Previously DependencyCustomizer allow a dependency to be added by
specifying its full coordinates, i.e. a group ID, artifact ID, and
version. This commit updates DependencyCustomizer to only require
an artifact/module ID. The group ID and version are then resolved
using the same mechanism as the enhanced @Grab support.

[#56328644] [bs-312] Allow @Grab without version
2013-10-08 10:41:35 +01:00
Dave Syer
38e565e920 Back to SNAPSHOT for dev 2013-09-05 17:15:15 -07:00
Dave Syer
b634b3bde6 Update to 0.5.0.M2 2013-09-05 17:15:15 -07:00
Phillip Webb
4ad3d30a40 Fixup CLI POM
Fix classloader issues by excluding spring JARs from test classpath
and also include spring-integration-groovy-dsl as a managed dependency.
2013-09-05 17:14:15 -07:00
Phillip Webb
5189d9d3e6 Don't generate dependency reduced POM 2013-08-06 00:14:49 -07:00
Phillip Webb
77455ec3dc Fix CLI test failures 2013-08-05 13:48:14 -07:00
Phillip Webb
4038b39496 Add OutputCapture test class 2013-08-05 13:48:14 -07:00
Phillip Webb
174427881a Revert "Attempt to sort out logging dependencies"
This reverts commit e99d2199d8.

The main spring-boot project should not have compile scope dependencies
to any org.slf4j artifacts.
2013-08-05 13:48:14 -07:00
Dave Syer
e99d2199d8 Attempt to sort out logging dependencies 2013-08-05 15:00:02 +01:00
Phillip Webb
1db22aca5c Rework POM structure
Rework main build POM to be an aggregator pom that does not inherit
from any parent. Introduce new spring-boot-dependencies module to
act as a parent for both spring-boot-starter-parent and
spring-boot-parent.
2013-08-02 21:58:24 -07:00
Dave Syer
4bb5de02e7 Switch back to SNAPSHOT for dev 2013-08-02 12:00:14 +01:00
Dave Syer
68e5a7e887 Bump version to 0.5.0.M1 2013-08-02 12:00:14 +01:00
Phillip Webb
3f2bb03fb8 Renamed some projects and polish POMs
Issue: #54095231
2013-07-26 12:31:37 -07:00
Dave Syer
2098e23fca Change package names zero->boot
* actuator -> boot-ops
* cli -> boot-cli
* launcher -> boot-load
* autoconfig -> boot-config
* bootstrap -> boot-strap
* starters -> boot-up

[#54095231] [bs-253] Refactor Zero->Boot
2013-07-26 14:13:41 +01:00