Commit Graph

30 Commits

Author SHA1 Message Date
Phillip Webb
51b0451ada Fix broken test due to random port change 2014-04-23 20:10:30 +01:00
Phillip Webb
2d8f66e3c5 Add more JMS sample log output 2014-02-06 15:30:32 -08:00
Phillip Webb
1bcd3de7b5 Polish 2014-01-02 12:10:37 -08:00
Dave Syer
4cfc7b6ad9 Make sure integration still works in CLI 2013-12-30 11:19:52 +00:00
Dave Syer
5d8e58d12c Remove support for Integration DSL (milestone only) 2013-12-30 07:39:36 +00:00
Dave Syer
75af18df7d Add support for beans{} in CLI scripts
User can add (a single) beans{} DSL declaration (see GroovyBeanDefinitionReader
in Spring 4 for more detail) anywhere at the top level of an application source
file. It will be compiled to a closure and fed in to the application context
through a GroovyBeanDefinitionReader. Cool!

The example spring-boot-cli/samples/beans.groovy runs in an integration test
and passes (see SampleIntegrationTests).
2013-12-19 17:11:01 +00:00
Dave Syer
e2c962ac28 Switch to thymeleaf-spring4 2013-12-19 13:40:24 +00:00
Andy Wilkinson
b0c5d3254a Make "." be the CLI's default classpath
Previously, the default classpath was empty. Now, in the absence of the
user providing a classpath via the -cp option, the default classpath
will be ".". If the user does specify a classpath, the classpath that's
used will be exactly what they have specified, i.e. "." will no longer
be on the classpath unless specified by the user.

The app sample integration test has been updated to verify that "." is
only the classpath by default.

Fixes #115
2013-12-04 11:13:49 +00:00
Dave Syer
0c1aa1942e Add tests for loading dependencies in starters without parent 2013-11-07 16:05:01 +00: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
Phillip Webb
d7ae8cafbf Move tests from 'samples' to 'test-samples' 2013-11-04 22:21:37 -08:00
Phillip Webb
bec1c8f00f Polish 2013-11-04 22:17:38 -08:00
Greg Turnquist
cc92ba1a5c Fix spring test to properly handle failures
Failing test cases weren't not properly handled and instead caused
test to break. Added a test case and verified it works for both JUnit
and Spock.
2013-11-04 10:09:48 +00: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
3adfdd34ec Use simplified @Grab where possible 2013-10-09 10:16:01 -04:00
Roy Clarkson
5cdaa43912 Add Spring Mobile Device Resolver autoconfiguration 2013-10-08 17:43:09 -04:00
Dave Syer
b5f0f97110 Clean up TestCommand paraphenalia 2013-10-08 15:39:37 -04: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
Greg Turnquist
941d163709 Add support for Spring Rabbit (via Spring AMQP) to Boot
- If RabbitTemplate is on the classpath, turn on autodetection.
- Create a RabbitTemplate, a Rabbit ConnectionFactory, and a RabbitAdmin is spring.rabbitmq.dynamic:true
- Enable some **spring.rabbitmq** properties like host, port, username, password, and dynamic
- Add tests to verify functionality
- Add Groovy CLI functionality. Base it on @EnableRabbitMessaging. Add spring-amqp to the path.
- Create rabbit.groovy test to prove it all works.
- Make Queue and TopicExchange top-level Spring beans in rabbit.groovy test script
2013-09-26 12:14:06 -04:00
Greg Turnquist
fa6e6fde6c Add JMS autoconfig support
* application.properties support for spring.jms and spring.activemq

* more tests to verify ActiveMQConnectionFactory pooling

* Groovy support and simple sample with activemq

* Groovy detection mechanism is @EnableJmsMessaging annotation
2013-09-26 11:53:06 -04:00
Greg Turnquist
97af88a8d8 Switch activemq to version 5.4.0 to avoid slf4j issue 2013-09-20 15:38:59 +01:00
Phillip Webb
b857a9001d Cleanup trailing whitespace 2013-09-18 12:17:56 -07:00
Greg Turnquist
5801e422cf [BS-48] Add autoconfigured JMS support
* Add ability to detect spring-jms on the path and create a JmsTemplate with
  ActiveMQConnectionFactory
* Create tests showing autoconfigured JmsTemplate with ActiveMQ, but prove it
  backs off if a separate ConnectionFactory exists.
* Add support to spring-boot-cli to that it detects JmsTemplate, DefaultMessageListenerContainer,
  or SimpleMessageListenerContainer, and turns on autoconfiguration as well as
  add proper @Grab's and import statements.
* Write a jms.groovy test showing proper CLI support

Simplify ActiveMQ configuration

Update ActiveMQ to 5.7.0
2013-09-18 17:52:14 +01:00
Dave Syer
621ecd3901 Added JDBC and @Transactional support to Groovy CLI
* @EnableTransactionManagement triggers spring-tx imports
* Field or method of type JdbcTemplate or NamedParameterJdbcTemplate
  of DataSource triggers spring-jdbc imports
2013-09-13 08:02:56 -07:00
Dave Syer
5fa0166dea Upgrade to Reactor 1.0.0.M2 2013-09-05 17:14:17 -07:00
Dave Syer
b720f7e688 Startup time for CLI app much quicker now
The Boot resolver didn't transfer enough of the settings
of the default ChainResolver. Adding a boolean flag was
enough to make the chatter die down for dependencies
that were unneeded.

[Fixes #55358344] [bs-291]
2013-09-05 17:14:08 -07:00
Phillip Webb
4c067a89fe Ops -> Actuator 2013-07-31 12:57:25 -07:00
Dave Syer
ec3c5b5321 Add auto compile tweaks for reactor 2013-07-31 09:21:16 +01:00
Phillip Webb
3bb79db579 Renamed spring-boot-ups -> spring-boot-starter 2013-07-31 01:11:10 -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