Commit Graph

680 Commits (c71b661d7949564152dc55d4a7a201d1d764ccad)

Author SHA1 Message Date
Stephane Nicoll e0dfe9fb86 Add start/stop goals to maven plugin
SpringApplicationLifecycle provides basic lifecycle operations on the
current Spring Boot application (that is checking if the application has
fully started and gracefully terminate the app). It can be registered as
an MBean of the platform MBean server if a specific property is set.

The Maven plugin uses that MBean to check that the application is ready
before ending the "start" phase. It uses it to trigger a proper shutdown
of the application during the "stop" phase.

If the process has to be forked, the platform MBean server is exposed on
a configurable port so that the maven plugin can connect to it.

Such change permits the maven plugin to integrate a classical integration
test scenario where the "start" goal is invoked during the
pre-integration phase and the "stop" goal during the post-integration
phase.

Closes gh-2525
10 years ago
Andy Wilkinson e3a53cb087 Remove classes and methods deprecated since 1.2 and earlier
Closes gh-2697
10 years ago
Stephane Nicoll b20d11fe9c polish
Rework 155c60b7 to structure the code consistently, in particular with a more
natural order of attributes. Update test to use non-default values to ensure
that the customization has been applied.

See gh-2793
10 years ago
Eddú Meléndez 0b8fd67507 Add extra attributes to the init command
Update the CLI init command to expose additional attributes supported
by Spring Initializr. These are: groupId, artifactId, version, name,
description and language.

Closes gh-2793 and gh-2907
10 years ago
Andy Wilkinson 2053f4b2bf Clear JAVA_OPTS in CLI tests; avoid permsize config error with Java 8
When a Java 8 JVM is launched with -XX:MaxPermSize a warning message
is output indicating that the option will be ignored. This causes the
CLI tests that assert that no error output has been produced to fail.

This commit updates the CLI's integration test harness to remove
JAVA_OPTS from the environment of the CLI process. This prevents any
unwanted max perm size configuration from leaking into that
environment and breaking the build.
10 years ago
Andy Wilkinson a5e9a38b76 Clear JAVA_OPTS in CLI tests; avoid permsize config error with Java 8
When a Java 8 JMV is launched with -XX:MaxPermSize a warning message
is output indicating that the option will be ignored. This causes the
CLI tests that assert that no error output has been produced to fail.

This commit updates the CLI's integration test harness to remove
JAVA_OPTS from the environment of the CLI process. This prevents any
unwanted max perm size configuration from leaking into that
environment and breaking the build.
10 years ago
Andy Wilkinson 51c49b69c5 Support bom-based dependency management in the CLI
Previously, the CLI’s dependency management used proprietary Properties
file-based metadata to configure its dependency management. Since
spring-boot-gradle-plugin’s move to using the separate dependency
management plugin the CLI was the only user of this format.

This commit updates the CLI to use Maven boms to configure its
dependency management. By default it uses the spring-boot-dependencies
bom. This configuration can be augmented and overridden using the new
@DependencyManagementBom annotation which replaces @GrabMetadata.

Closes gh-2688
Closes gh-2439
10 years ago
Andy Wilkinson ee7c86a07d Start building against Reactor 2.0.1 snapshots
See gh-2719
10 years ago
Phillip Webb a8d099f6b8 Revert "Add start/stop goals to maven plugin"
This reverts commit 54e12a07e6.
10 years ago
Stephane Nicoll 54e12a07e6 Add start/stop goals to maven plugin
SpringApplicationLifecycle provides lifecycle operations on the current
Spring Boot application. It can be registered as an MBean of the platform
MBean server if a specific property is set. Besides, the JMX name can
also be customized via a property in case more than one Spring Boot
application is started in the same process.

The Maven plugin uses that MBean to check that the application is ready
before ending the "start" phase. It uses it to trigger a proper shutdown
of the application during the "stop" phase.

If the process has to be forked, the platform MBean server is exposed on
a configurable port so that the maven plugin can connect to it.

Such change permits the maven plugin to integrate a classical integration
test scenario where the "start" goal is invoked during the
pre-integration phase and the "stop" goal during the post-integration
phase.

Closes gh-2525
10 years ago
Andy Wilkinson a9adb85333 Merge branch '1.2.x' 10 years ago
Andy Wilkinson 0141f50ec8 Wait for stream reading threads to finish when awaiting CLI invocation
Closes gh-2787 (I hope)
10 years ago
Andy Wilkinson 8b1022effa Upgrade to Spring Batch 3.0.4 snapshots
Closes gh-2712
10 years ago
Phillip Webb 59692cd938 Polish formatting 10 years ago
Dave Syer c9c1e8b517 Add animal sniffer for Java 6 and jdk1.8 to actuator
The build now requires java 8 (although no language features are yet
in use). Bamboo has been updated.

Fixes gh-716
10 years ago
Spring Buildmaster e03c11dda8 Next development version 10 years ago
Andy Wilkinson bc99ad2120 Ignore Batch tests that use JDBC as they don’t work with Spring 4.2
Spring Framework’s ParamterizedRowMapper has been deprecated since
3.1 and has been removed in 4.2. Spring Batch currently relies on
ParameterizedRowMapper, making it incompatible with 4.2. To allow us to
build successfully against 4.2, this commit ignores Spring Boot’s tests
that use Spring Batch’s JDBC support.

See gh-2575
10 years ago
Phillip Webb a57a88f5cf Move master to 1.3.0.BUILD-SNAPSHOT 10 years ago
Spring Buildmaster 8f0ad02237 Next development version 10 years ago
Phillip Webb 56e31a8c6b Polish 10 years ago
Stephane Nicoll 9d0e50c6ac Support of spring initializr meta-data v2.1
Update the `init` command to support the latest meta-data format. Recent
Spring Initializr version also supports Spring Boot CLI now and generates
a textual service capabilities when requested. The command no longer
generates the capabilities of the service unless said service does not
support it.

Closes gh-2515
10 years ago
Andy Wilkinson 54e90c03fc Polish the javadoc in spring-boot-cli
Add missing @param and @return elements
10 years ago
Phillip Webb 072f873f34 Polish 10 years ago
Stephane Nicoll 4bee1b0e1b Fix wrong help page for archive detection logic
Fixes gh-2355
10 years ago
Andy Wilkinson 16cb44f890 Merge branch '1.1.x' 10 years ago
Andy Wilkinson 376de01636 Don't remove @GrabResolver in JarCommand, disable initClass instead
Previously, JarCommand removed all @GrabResolver annotations in an
AST transformation. This was being performed as custom resolver
configuration is not necessary in a jar as all of the dependencies are
available from the jar. Furthermore, leaving the annotations in place
caused a failure when the jar was run due to a missing Ivy dependency
that's required by Groovy's default GrapeEngine, GrapeIvy.

The removal of @GrabResolver annotations was being done before they
could be used by Groovy's GrabAnnotationTransformation to configure
the GrapeEngine's resolvers. This resulted in the annotations having
no effect such that a dependency that was only available from a
repository made available by @GrabResolver would fail to resolve if
it was not cached locally.

This commit updates the AST transformation to leave the @GrabResolver
annotations in place but to set their initClass attribute to false.
This allows the annotation to be used while the jar's being compiled,
but supresses the generation of the static initializer that adds the
custom resolver to the GrapeEngine when the compiled code's run via
java -jar.

Fixes gh-2330
10 years ago
Spring Buildmaster 60725cd8bd Next development version 10 years ago
Spring Buildmaster 63e6a25097 Next development version 10 years ago
Spring Buildmaster 1a788c1741 Next development version 10 years ago
Phillip Webb a8ae4d1a3f Only include zip files when using `spring jar`
Update JarCommand to only include nested libraries that are actually
zip files. Similar to commit 38585bf3 which introduced the same
functionality to the Repackager.

Fixes gh-2094
10 years ago
Phillip Webb 3523bca79b Polish 10 years ago
Phillip Webb d3ccdc6319 Polish 10 years ago
Stephane Nicoll 9b598b49c2 Fix JMS support in the CLI
Partly back port changes from affb202e and 85c95744f to fix the usage
of JMS in the CLI. Restore the integration test using HornetQ and fix the
coordinates of the JMS API.

Fixes gh-2075
10 years ago
Phillip Webb 064fee38b1 Formatting 10 years ago
Stephane Nicoll 8efdffbc0e Smarter output detection for generated projects
Previously, specifying a simple target name for a regular project would
store the (zip) archive in a file matching the target name. Only adding a
slash at the end of the name allows to extract it as a directory. It
turns out that such convention is not easy to catch and if a simple name
is provided on the command-line, the user probably wants to create a
directory with such a name with the content of the project.

Note that if a build file is required and the name does not have any
extension, we still store a file with the required name as auto-detecting
the extension to use is not that easy.

Fixes gh-2056
10 years ago
Stephane Nicoll 61223e709c Fix error message 10 years ago
Phillip Webb 447c9ff204 Polish 10 years ago
Graeme Rocher dbcbebca4a Propagate exception / test failures so that the correct status code is returned.
Fixes gh-2048 and fixes gh-2051
10 years ago
Andy Wilkinson 8520554eb2 Allow the SpringApplication class used by the CLI to be configured
This commit adds support to the CLI for launching a custom
SpringApplication implementation. The class that is launched can be
configured using the spring.application.class.name System property
or the SPRING_APPLICATION_CLASS_NAME environment variable with the
former taking priority.

Closes gh-2030
10 years ago
Phillip Webb 2a8579026f Polish 10 years ago
Andy Wilkinson 0e2300cf85 Disable check of Groovy template location by default for CLI apps
In 1.1, the Groovy template support did not check that its configured
template location exists. A check was added in 1.2, however this
breaks CLI web applications that don't have the expected templates
location.

Rather than reintroducing 1.1's behaviour by removing the check, this
commit updates the CLI to set
spring.groovy.template.check-template-location to false by default.
This allows flow-blown applications to benefit from the check, while
allowing CLI apps to behave as they did in 1.1.

Closes gh-1959
10 years ago
Phillip Webb c34cfb27a3 Polish 10 years ago
Stephane Nicoll 8f488bd019 Update init to new metadata format
Spring initializr now declares an improved metadata format (v2).

InitializrServiceMetadata has been updated to parse this format. Note
that the client could be further improved by using HAL generated links.

Closes gh-1953
10 years ago
Spring Buildmaster 46b7738334 Next development version 10 years ago
Phillip Webb 4fa8a94dd4 Update to latest Maven plugins
Fixes gh-1899
10 years ago
Phillip Webb 6027b2405c Add 'User-Agent' header to CLI REST calls
Update the InitializrService so that a 'SpringBootCli' User-Agent header
is sent with each request. This should allow the server-side code to
gracefully evolve the JSON format if needed.

Fixes gh-1869
10 years ago
Phillip Webb e76a571dd3 Add @SpringBootApplication annotation
Add a new @SpringBootApplication which is equivalent to @Configuration,
@EnableAutoConfiguration and @ComponentScan.

See gh-1842
10 years ago
Phillip Webb b6bacd5e8a Upgrade to Servlet 3.1, Tomcat 8 and Jetty 9
Upgrade to latest versions of Tomcat and Jetty and to the latest Servlet
API whilst will remaining compatible with Tomcat 7 and Jetty 8.

Fixes gh-1832, gh-369
10 years ago
Phillip Webb a973fd41f4 Polish 10 years ago
Stephane Nicoll 0061f237b8 Add examples to the CLI
This commit updates the help command to also show some example(s) to
illustrate how the command can be used. The commit also defines useful
examples for the init command

Fixes gh-1809
10 years ago
Stephane Nicoll 6a18ece6a2 Explicit type takes precedence over build and format
Prior to this commit, specifying the --format and/or --build options
alongside --type did not use the explicit type as it should. This commit
ignores the --build and --format options if a type is explicitly set.

Fixes gh-1807
10 years ago
Stephane Nicoll 2e07f003c9 Init command takes the output as last argument
This commit moves the --output switch to a regular argument. This aligns
to other command, i.e. spring init my-project.zip would save the project
to "my-project.zip" in the current directory.

This commit also auto-detects the --extract option if the location ends
with a slash, i.e. spring init demo/ would extract the content of the
project in a demo directory that is local to the current directory.

Fixes gh-1802
10 years ago
Stephane Nicoll 96198e2999 polishing 10 years ago
Phillip Webb aa2e32a041 Restore CLI startup performance
Change InitializrService to use a late binding CloseableHttpClient
since the calling `HttpClientBuilder.create().build()` is slow.

Fixes gh-1764
10 years ago
Phillip Webb 830ce80824 Polish CLI init command
Rename a few classes and methods and extract some logic into helper
classes. Also change 2 char shortcuts to a single char.

Closes gh-1751
10 years ago
Phillip Webb b89e5e0ab7 Apply eclipse formatting rules
Apply eclipse formatting rules to b2fe2dd9.

See gh-1751
10 years ago
Stephane Nicoll b2fe2dd912 Add init command to the CLI
This commit adds a new command to the CLI that allows to initialize a new
project from the command line. It uses the Spring initializr service to
actually generate the project.

The command offers two main operations:

1. Listing the capabilities of the service (--list or -l). This basically
dumps the defaults of a given service and the list of dependencies and
project types it supports
2. Generating a project. By default, http://start.spring.io is used and
its configured defaults are applied. Running spring init would therefore
have the same effect as clicking the 'generate project' on the UI without
entering any extra information. No file is overwritten by default.

The generation can be customized with the following options:

* --boot-version (-bv) Spring Boot version the project should use
* --dependencies (-d) comma separated list of dependencies to add to the
generated project
* --java-version (-jv) Java version to use
* --packaging (-p) the packaging for the project (jar, war)
* --target the url of the service to use

The actual type of the project can be defined in several ways:

1. Using the --type (-t) option that identifies a type that is supported
by the service
2. A combination of --build and/or --format that can be used to uniquely
identify matching these tags. Build represents the build system to use
(e.g. maven or gradle) while --format defines the format of the generated
project.

The project is saved on disk with the name provided by the server through
the Content-Disposition header, if any. It is possible to force it with
the --output option. It is possible to overwrite existing files by adding
the --force (-f) flag.

The --extract (-x) option allows to extract the project instead of saving
the zip archive. By default, the project is extracted in the current
working directory but it is possible to specify an alternate directory
using the --output option.

Fixes gh-1751
10 years ago
Phillip Webb cf24af0bfb Rework logging to prevent double initialization
Prior to this commit LoggingSystem initialization would happen multiple
times. Once to configure "quiet" logging, and again to configure correct
settings once the Application was initialized. This could cause problems
if `logging.groovy` logback files were used.

The logging system is now only initialized once (when possible) by
following these steps:

- Standard logging initialization occurs via the actual logging
  implementation used (e.g. logback will load a logback.xml file if it
  exists)
- beforeInitization() is called to prevent early log output.
  Implementations now either use a Filter or simply set the root logging
  level.
- initialize() is called with an optional log configuration file (e.g
  a custom logback.xml location) and an optional log output file (the
  default is null indicating console only output).

The initialize() method will attempt to prevent double initialization
by checking if a standard configuration file exists. Double
initialization now only occurs in the following situations:

- The user has a standard configuration file (e.g. classpath:logback.xml)
  but also specifies a logging.config property. Double initialization is
  required since the specified configuration file supersedes the default.
- The user has a standard configuration file (e.g. classpath:logback.xml)
  and specifies a logging.file property. Double initialization is
  required since the standard configuration may use a ${LOG_FILE}
  reference.

In addition this commit removes the `logging.console` option and now
assumes that logging either occurs only to console or to both the
console and a file. This restriction helps simplify the LoggingSystem
implementations. If file only logging is required a custom logback.xml
can be used.

Fixes gh-1091
See gh-1612, gh-1770
10 years ago
Phillip Webb 2e7aa4685b Polish 10 years ago
Andy Wilkinson a2c5b6a7bb Preserve dependencies when uninstalling from the CLI
Previously, the CLI did not keep track of a dependency's users. This
meant that installing two extensions with a common dependency and
then unistalling one extension would break the other extension as the
common dependency would be deleted:

 1. Install a that depends on c
 2. Install b that depends on c
 3. Uninstall b
 4. a is now broken as c has been deleted

This commit updates the CLI to maintain a count for each artifact
that's installed into /lib. An artifact is now only deleted when the
count reaches zero.

As part of this change the code has been
extensively refactored to bring the structure into line with other CLI
commands and to improve testability.

Closes gh-1410
10 years ago
Andy Wilkinson f6bf32c3ee Add option help to the CLI's install and uninstall commands
Closes gh-1704
10 years ago
Dave Syer f9010c18cc Fix install command on Windows
Windows absolute paths cannot be processed by the CLI compiler, so the install
command wasn't working on Windows. This change converts ths path to a URI first
and then it works as a Spring Resource.
10 years ago
Spring Buildmaster 3e71a21b30 Next development version 10 years ago
Spring Buildmaster edb4b7ed7d Next development version 10 years ago
Stephane Nicoll 8ed461947f Improve RabbitMQ support in CLI
This commit deprecates the proprietary EnableRabbitMessaging annotation
in favour of the standard @EnableRabbit introduced as of Spring Rabbit
1.4.

Fixes gh-1494
10 years ago
Andy Wilkinson f5ab0cf2dc Update CLI install to prefer local snapshots to those in a remote repo
Previously, InstallCommand used a custom Grape root and then walked
the tree of files downloaded by Aether to determine which files it
should install or uninstall. In some scenarios two files for the
same module would be present: one named foo-1.0.0.BUILD-SNAPSHOT.jar
and one named foo-1.0.0.BUILD-20140905.091809-2.jar. The former is
from the local repository and the later is from a remote repository.
In this case, the visitor would do the wrong thing and the latter
would be installed into lib.

This commit updates InstallCommand to determine the jars that it
should process by consulting GroovyCompiler's classpath, rather than
by walking Aether's cache. This approach selects the correct jar as
Aether has already figured this out as part of resolving the
dependency. It also brings InstallCommand into line with JarCommand.

The previous implementation used Java 7-specific File APIs. As part
of the above-described change this usage has been removed. The
install command can now be used on Java 6.

Fixes gh-1515
10 years ago
Spring Buildmaster d63e4b4329 Next development version 10 years ago
Phillip Webb 8bf1f9567a Apply eclipse formatting and cleanup rules 10 years ago
Dave Syer 378f6b78ce Add ServiceLoader for AST transformations
The loading is via a marker interface SpringBootAstTransformation
to avoid clashing with other services registered as org.groovy.*

Fixes gh-1392
10 years ago
Stephane Nicoll 85c95744f9 Avoid duplicate script
This commit avoids a script duplication: the integration test runs the
sample instead of a copy of it in the repro directory.

Also switched the sample from ActiveMQ to HornetQ as #323 revealed
some locking on CI. Hopefully that should fix it as HornetQ is non
persistent and can be embedded several times in the same VM.

Fixes gh-1456
10 years ago
Phillip Webb f8a4df0838 Polish 10 years ago
Stephane Nicoll dd6bf5730d Add support for EnableCaching in the cli
Fixes gh-1431
10 years ago
Stephane Nicoll affb202e74 Improve JMS support in cli
This commit deprecates the proprietary EnableJmsMessaging annotation in
favour of the standard @EnableJms introduced as of Spring 4.1. This
commit also updates the sample and adds an integration test as the
feature was actually broken.

Fixes gh-1456
10 years ago
Phillip Webb de7ff0670d Polish 10 years ago
Andy Wilkinson 90b12d738b Merge branch '1.1.x' 10 years ago
Andy Wilkinson 896a85b575 Add settings.xml used by AetherGrapeEngineTests 10 years ago
Andy Wilkinson cee8c9f4ea Merge branch '1.1.x' 10 years ago
Andy Wilkinson 5f9fddd44a Explicitly apply mirror and auth settings to remote repos in the CLI
Previously, the CLI relied on Aether using the session's mirror
selector and authentication selector to customize the configured
repositories. These selectors are only used to configure what Aether
calls recessive repositories (repositories discovered when resolving
an artifact), rather than the explicitly configured repositories that
are typically used.

This commit updates AetherGrapeEngine to apply mirror and
authentication configuration to every added repository, bringing its
behaviour for these two settings into line with what it already does
for proxy configuration.

Fixes #1354
10 years ago
Dave Syer eb4aee6c45 Improve error logging in InstallCommand 10 years ago
Dave Syer 1fe1399959 Add install command
Fixes gh-1393
10 years ago
Dave Syer 457cea60e6 Add ServiceLoader for AST transformations
The loading is via a marker interface SpringBootAstTransformation
to avoid clashing with other services registered as org.groovy.*

Fixes gh-1392
10 years ago
Spring Buildmaster 74d0c5185a Next development version 10 years ago
Phillip Webb 7641f23f71 Merge branch '1.1.x' 10 years ago
Phillip Webb 92899474ac Polish 10 years ago
Dave Syer 26cc628535 Merge branch '1.1.x' 10 years ago
Dave Syer 0c6a0bde5f Export SPRING_HOME for commands to consume if needed 10 years ago
Dave Syer 67ba66dc4c Merge branch '1.1.x' 10 years ago
Dave Syer 6ba8269db8 Add public getter for dependency context 10 years ago
Dave Syer 59b8fc63d9 Scan for a valid MANIFEST.MF instead of taking the first one
Fixes gh-1321
10 years ago
Phillip Webb 53d24301d1 Merge branch '1.1.x' 10 years ago
Phillip Webb f8bf0e2031 Polish 10 years ago
Andy Wilkinson f97251b9cf Merge branch '1.1.x' 10 years ago
Andy Wilkinson f5c8a8879a Isolate CLI integration tests from any settings decryption failures 10 years ago
Andy Wilkinson 3c99bbf524 Merge branch '1.1.x' 10 years ago
Andy Wilkinson 4d4cc076c6 Don't fail hard when settings.xml can't be decrypted by the CLI 10 years ago
Stephane Nicoll 249e09d9bc Switch master to 1.2.0.BUILD-SNAPSHOT 11 years ago
Spring Buildmaster 40327e1ae6 Next development version 11 years ago
Phillip Webb fa88c481a5 Remote trailing whitespace 11 years ago
Phillip Webb 6fd244c28b Move m2e ignore configuration to parent POM 11 years ago
Dave Syer 54a23f9920 Make -q and -v do something more sensible
-q switches off all logging and the banner, -v switches logging to debug,
running with neither will be info.

Fixes gh-1108
11 years ago
Dave Syer fd757cb371 Add logging.level to application.properties
E.g.

logging.level.org.springframework: DEBUG
logging.level.org.hibernate: WARN

Fixed gh-788
11 years ago
Dave Syer 179ac6022a Remove @GrabResolvers before packaging jar in CLI
Since all dependencies are local in a jar there is no need for
a GrabResolver (and it breaks the app because the default ivy
GrapeEngine is used instead of the smart, pretty Boot one).

Fixes gh-1179
11 years ago
Spring Buildmaster 981669b7c0 Next development version 11 years ago
Phillip Webb 200cd535c2 Revert "Next development version"
This reverts commit 67189477fe.
11 years ago
Spring Buildmaster 67189477fe Next development version 11 years ago
Phillip Webb 9632abf825 Formatting and cleanup 11 years ago
Phillip Webb 1f36d4657f Fix various Windows related issues
Fixes gh-1168
11 years ago
Spring Buildmaster 542f3cbda8 Next development version 11 years ago
Phillip Webb f30b962ff9 Add support for unpacking nested JARs
Update the executable JAR code to automatically unpack any entries
which include an entry comment starting `UNPACK:` to the temp folder.
The existing Maven and Gradle plugins have been updated with new
configuration options and the `spring-boot-tools` project has been
updated to write the appropriate entry comment based on a flag passed
in via the `Library` class.

This support has been added to allow libraries such a JRuby (which
assumes that `jruby-complete.jar` is always accessible as file) to work
with Spring Boot executable jars.

Fixes gh-1070
11 years ago
Phillip Webb a374929c90 Polish 11 years ago
Dave Syer 2c691e5ae5 Enhance JarCommand to support lists of includes and excludes
The lists are comma separated. In addition, user can add prefixes
"+" or "-", to signal that those values should be removed from the
default list, not added to a fresh one. E.g.

$ spring jar app.jar --include lib/*.jar,-static/** --exclude -**/*.jar

to include a jar file specifically, and make sure it is not excluded,
and additionally not include the static/** resources that would otherwise
be included in the defaults. As soon as "+" or "-" prefixes are detected
the default entries are all added (except the ones exlcuded with "-").

Fixes gh-1090
11 years ago
Spring Buildmaster 4ca26a21dc Next development version 11 years ago
Spring Buildmaster 05ed7b3bcd Next development version 11 years ago
Phillip Webb 3007a777d0 Roll back to 1.1.0.BUILD-SNAPSHOT 11 years ago
Spring Buildmaster c650f2391e Next development version 11 years ago
Phillip Webb 9b982dabdb Restore dependency-tools API compatibility
Refactor dependency-tools to restore API compatibility with Spring
Boot 1.0. This should reduce reflection hacks that tools such as Gretty
would otherwise have to make.

See gh-1035
11 years ago
Phillip Webb e891aa3525 Polish 11 years ago
Dave Syer 32dff415c3 Rationalize the Reactor autoconfig
It didn't make sense not to do anything at all if a Reactor @Bean
was detected, so now we only back off creating the rootReactor if
one is present.
11 years ago
Andy Wilkinson 156dadaebe Initialize DependencyResolutionContext with default dependency mgmt
In the absence of a @GrabMetadata annotation,
DependencyResolutionContext provided no dependency management. This
was leading to incorrect dependency versions being pulled in. This
commit intializes the context with default dependency management that
will be replaced should @GrabMetadata be encountered.

Fixes #1021
11 years ago
Dave Syer efcbb32788 Remove some compiler warnings 11 years ago
Phillip Webb f95cb602cc Fix CLI command/option package tangle
Fix package tangle in CLI my extracting ExitStatus to a status package.

See gh-1004
11 years ago
Phillip Webb 5da23e9968 Fix grape -> compiler package tangle
Fix package tangle by moving DependencyResolutionContext from the
compiler package to grape.

See gh-1004
11 years ago
Andy Wilkinson 212c30f6c7 Enhance DependencyCustomer: allow type and classifier to be specified
Closes #1002
11 years ago
Andy Wilkinson 059d504fd7 Fix DependencyCustomizerTests following merge of 1.0.x 11 years ago
Andy Wilkinson 0d7da4375f Merge branch '1.0.x' 11 years ago
Andy Wilkinson abc1e5de8f Fix ifAnyMissingClasses to return false if no classes are missing
Fixes #1003
11 years ago
Phillip Webb 97acd20d62 Polish 11 years ago
Andy Wilkinson 2fec9c4790 Merge branch '1.0.x' 11 years ago
Andy Wilkinson 8f7c96e8f0 Honour ext and classifier on @Grabbed dependencies
We currently honour type, but ignore ext. Aether doesn't make a
distinction between the two so a Grab that specifies both type and ext
but with different values is considered to be an error.

Fixes #995
11 years ago
Phillip Webb 3541495041 Drop unused objectstyle.org maven repo
Looks like a hang over from some older code.
11 years ago
Dave Syer ed15f742fd Fix bug in GroovyTemplate convenience
It was ignoring the engine argument in the 3 arg version
of template().
11 years ago
Dave Syer 2f653f0616 Add support for Spring HTTP in CLI tests 11 years ago
Dave Syer ed0cfea6d2 Add SmartImportCustomizer
Only imports classes with names that are not already
imported into teh SourceUnit

Fixes gh-983
11 years ago
Phillip Webb 11a093bdc0 Polish 11 years ago
Dave Syer 48c1228253 Add support for groovy utilities in "spring jar"
Also an integration test that uses the (new)
@EnableGroovyTemplates to switch on the template conveniences
in a non-webapp

Fixes gh-990
11 years ago
Dave Syer 3c6dfb72c5 Add ExitStatus to Command.run()
The main difference for now is the removal of the --nohup
(slightly hacky) option in TestCommand. Now a TestCommand
can signal to its caller that it wants to be hung up.

Fixes gh-975
11 years ago
Dave Syer 5e3cc95ccf Adjust security.basic.enabled=false behaviour
Actually the web-secure sample is misusing
security.basic.enabled=false (IMO) - it should be a flag
to say that you want to temporarily disable the basic security
fallback on application endpoins, not  way to disable all
security autoconfiguration.

Added test case to web-secure sample to ensure a user
can log in.

Fixes gh-979
11 years ago
Phillip Webb bdcb9407eb Restore commons-logging dependency for spring-boot
Restore the dependency on commons-logging (transitively via spring-core)
for spring-boot. This means that we are not tied directly to SLF4J, but
it is still an option that can be used via `jcl-over-slf4j`.

The `spring-boot-starter-parent` continues to replace `commons-logging`
with `jcl-over-slf4j`.

Fixes gh-981
11 years ago
Phillip Webb 5a5a7be477 Polish 11 years ago
Andy Wilkinson 7a8be3d600 Use Spring Framework bom and fully exclude commons-logging
Closes #955
Closes #978
11 years ago
Dave Syer 6fbafc3ca4 Add RUNTME scope to transitive dependencies in CLI
Fixes gh-977
11 years ago
Dave Syer e7aa192d82 Add ConfigurationProperties to autoconfigs 11 years ago
Dave Syer 8436627598 Allow tests to System.exit() by default
Otherwise the ApplicationContext stays alive and if it's a
server app the JVM does not exit at the end of "spring test".
User can override with "spring test foo.groovy --nohup"
(which we have to do in our unit tests).
11 years ago
Phillip Webb 7fd26a556d Fix social property binding
Update Spring Social auto-configurations to read properties using
the `dashed` notation and with the appropriate prefixes. This allows
properties to be specified in any of the relaxed forms.

Also minor refactor to extract common logic to a new
SocialAutoConfigurerAdapter base class.

See gh-941
11 years ago
Phillip Webb 5df52d3e94 Polish 11 years ago
Dave Syer 05d1a104e4 Add spring-test annotations to auto imports 11 years ago
Andy Wilkinson 47e3a72390 Source code formatting 11 years ago
Craig Walls 5e1913576e Document Spring Social support 11 years ago
Craig Walls f006b1231c Add Spring Social autoconfiguration 11 years ago
Dave Syer 064998697d Ensure CLI adds @EnableAutoConfiguration in an appropriate place
Up to now we have been treating the *first* class to be compiled
as the "main" application and adding @EnableAutoConfiguration. This
isn't always appropriate (e.g. if it's a test case), so now we
look for an appropriate annotation before falling back to the old
behaviour.

In addition ensures classes with a field of type Reactor trigger
the reactor auto imports.

See gh-969
11 years ago
Dave Syer 3d9da64382 Add auto imports for integration testing
JUnit tests can now be @SpringApplicationConfiguration
and @IntegrationTest without any explicit imports. Also
makes @RunWith(SpringJUnit4ClassRunner) optional.

Fixes gh-969
11 years ago
Dave Syer f1f36cd002 Extract closure grabber into AstUtils 11 years ago
Dave Syer b71f07932e Support for explicit module path in dependency
Instead of *always* needing to pull auto-import dependencies
from the master parent pom, we now allow normal @Grab-style
module specifications, e.g. "io.ratpack:ratpack-groovy:0.9.2"
11 years ago
Phillip Webb 1a475102de Polish 11 years ago
Dave Syer 1e6a4f3f65 Remove duplicate JreProxySelector
Since we upgraded Aether we now have the native JreProxySelector
available so we don't need to keep a copy ourselves.
11 years ago
Dave Syer 0e2f9e74db Ensure a JreProxySelector is applied as a fallback
The issue was that the JreProxySelector was only applied
if the existing selector was null, but that hasn't been the case
since we added supporty for settings.xml. The strategy now is to
fallback to a JreProxySelector if the existing one is null
or not already a composite. Fixes gh-914.
11 years ago
Andy Wilkinson 1deeccda30 Revert "Work around Groovy compiler bug that can name classes incorrectly"
This reverts commit 46fc5c05e3.

Closes #598
11 years ago
Phillip Webb 8bcda1bcbe Polish 11 years ago
Dave Syer 334c8142c4 Enhance Groovy template support in CLI
to allow user to specify the TemplateEngine

Fixes gh-908
11 years ago
Andy Wilkinson d2fc80b818 Allow custom dependency metadata to be used with the CLI
Add support for a new annotation, @GrabMetadata, that can be used
to provide the coordinates of one or more properties files, such as
the one published by Spring IO Platform, as a source of dependency
metadata. For example:

@GrabMetadata("com.example:metadata:1.0.0")

The referenced properties files must be in the format
group:module=version.

Limitations:

 - Only a single @GrabMetadata annotation is supported
 - The referenced properties file must be accessible in one of the
   default repositories, i.e. it cannot be accessed in a repository
   that's added using @GrabResolver

Closes #814
11 years ago
Phillip Webb 506c0f50b9 Allow meta-data driven version overrides in Gradle
Add a `versionManagement` gradle configuration which can be used to
provide alternative version meta-data. Primarily added so that the
Spring IO platform can provide version overrides without causing a
cyclic build dependency.

Fixes gh-750
11 years ago
Dave Syer 894482df1a Initialize logback is it is present in CLI
This (empirically) fixes gh-726 using a new utility
(LogbackInitializer) in the loader tools. If anyone has enough
Gradle fu to understand where to put it (after the classpath is established
but before compilation) we could do the same thing in the Gradle plugin
(and that would fix gh-724).
11 years ago
Stephane Nicoll 33082fd56d Harmonized maven dependency management
This commit harmonizes the dependency management of internal modules
so that versions can be omitted everywhere. Update the maven coordinates
to provide the full groupId for consistency
11 years ago
Phillip Webb 34b7bb20fd Add maven implicit plugin group ID
Add previously implicit <groupId>org.apache.maven.plugins</groupId>
to plugin declarations.
11 years ago
Dave Syer 1b7d8d9ade Add SignalUtils to handle OS interrupts
Extract into a utility to be shared between Shell and RunMojo

Fixes gh-773
11 years ago
Gary Russell 9fc9523ce3 CLI Integration Sample Shutdown
Fixes gh-761

Also add some sugar to the println so that it stands
out a little against the logging.
11 years ago
Dave Syer b12631d75d Ensure Spring Integration 4.0 is used in CLI
There was an issue with the generated poms for the dependency
tools (I'm not sure the generation step works if you don't
do "mvn clean"). Anyway I verified that it works and removed
the (now) unnecessary provided dependency from spring-boot-cli.

Fixes gh-362
11 years ago
Artem Bilan ce3aafa7a9 Upgrade to Spring Integration 4.0
Closes #751
11 years ago
Dave Syer b884a73396 Share RunProcess with CLI 11 years ago
Dave Syer 12ede8689a Prevent duplicate files from getting onto sources 11 years ago
Dave Syer f46d281b22 Upgrade to Reactor 1.1
Fixes gh-706
11 years ago
sopov.ivan 174b654faf minor test fixes
Reverting arguments in assertEquals where constant was placed on
the "actual" place. Replacing assertEquals with assertFalse, assertTrue
and assertNull where applicable.

Fixes gh-735
11 years ago
Phillip Webb 64a835e91a Move master to 1.1.0.BUILD-SNAPSHOT 11 years ago
Spring Buildmaster d3954a1703 Next development version 11 years ago
Phillip Webb 51b0451ada Fix broken test due to random port change 11 years ago
Phillip Webb 4119ef5cf4 Use random ports for tests
Update remaining tests to use random ports.

Fixes gh-337
11 years ago
Dave Syer 0ed1642989 Tweak autoconfigs in websocket support 11 years ago
Dave Syer ac16aa1757 Add SpringWebsocketCompilerAutoConfiguration
Fixes gh-693
11 years ago
Spring Buildmaster a5864ebcd0 Next development version 11 years ago
Spring Buildmaster 15e9dbe98b Next development version 11 years ago
Phillip Webb 1e68b7e0a9 Remove superfluous <packaging> tags from POMs 11 years ago
Phillip Webb 0af7f7e347 Add missing POM info 11 years ago
Phillip Webb 488b03387f Polish POM formatting 11 years ago
Phillip Webb 6f9bb233ad Revert "Next development version"
This reverts commit b67bb70ee3.
11 years ago
Spring Buildmaster b67bb70ee3 Next development version 11 years ago
Phillip Webb ed3fc06d81 Remove non-working cli `--edit` option
Fixes gh-611
11 years ago
Phillip Webb 35b1a59bbd Fix cli `--watch` option
Fix SpringApplicationRunner to correctly locate files to watch for
reload.

Fixes gh-610
11 years ago
Phillip Webb ac4cdd33c3 Revert "Next development version"
This reverts commit 1d0eea12eb.
Returning to 1.0.0.BUILD-SNAPSHOT for an updated release.
11 years ago
Spring Buildmaster 1d0eea12eb Next development version 11 years ago
Andy Wilkinson 46fc5c05e3 Work around Groovy compiler bug that can name classes incorrectly
If a source URL is added to a CompilationUnit and that source URL does
not contain any slashes, the resulting ClassNode in the AST will be
incorrectly named. For example, a URL of 'file:foo.groovy' will produce
a ClassNode named 'file:foo'. The expected name is 'foo'.

This commit works around this problem by adding any URL sources with a
file protocol to the compilation unit as File instances. Any URL sources
that do not have a file protocol continue to be added as URL instances.
Such URLs are still prone to this bug should we be dealing with one
that contains no slashes. A fix for the underlying Groovy bug will
address this possibility.

Fixes #594
11 years ago
Phillip Webb beaddb2362 Polish 11 years ago
Phillip Webb 0960ac760e Check that cli `jar` command only writes `.jar`s
Update `JarCommand` to check that the file extension of the output is
`.jar`.

Fixes gh-581
11 years ago
Phillip Webb 44d708ef7a Polish 11 years ago
Andy Wilkinson b8858bdb8f Enable support for use of encryption in Maven's settings.xml
This commit updates the CLI so that it will decrypt any encrypted
passwords in a user's Maven settings.xml file.

The code that performs the decrytion has a transitive dependency on
three types in Plexus' logging API. There are tens of different
artifacts containing this API available in Maven Central. Rather than
bloating the API with a dependency on a complete Plexus container,
which could perhaps be considered the primary source, a dependency on
a considerably smaller artifact has been introduced.

Closes #574
11 years ago
Dave Syer 60fe468af9 Make JAR files on classpath a special case for archive
If the user adds a JAR file to the classpath in "spring jar -cp ..."
he expected it to end up in the classpath of the executable jar
(i.e. in the nested lib/ directory). Before this change it would
have gone in the root of the executable JAR, causing errors at runtime.

The fix is slightly awkward, since it assumes that any JAR in the
"roots" of the ResourceMatcher come from the classpath (which *is*
the case currently, but might not always be at least in principle).
Seems like a reasonable compromise given it's a quick change
and some tests have been included.

Fixes gh-565
11 years ago
Dave Syer a3a58e1e13 Move @EnableRabbitMessaging into the non-protected package
Fixes gh-573
11 years ago
Phillip Webb 47eb8180b3 Rename spring-boot-starter-shell -> remote-shell
Fixes gh-462
11 years ago
Phillip Webb 5ab88b2344 Automatically add schedule annotation imports 11 years ago
Phillip Webb 4024450c5f Rename `starter-shell-remote` to `starter-shell`
Fixes gh-462
11 years ago
Phillip Webb 98e4008b16 Don't display hint command in options help
Fixes gh-471
11 years ago
Phillip Webb c5ee3c7eba Remove duplicate documentation
Remove README files that have been since been migrated to the reference
documentation. Also updated remaining markdown files to asciidoctor to
save having a mix of different formats.

Fixed gh-503
11 years ago
Andy Wilkinson 44826812db Add templates/** to list of default includes for CLI jars
Boot promotes the use of a templates directory for housing view
templates. Include this directory by default when building a jar file
from a CLI app.

Fixes #455
11 years ago
Andy Piper 695b3917b2 fix link to install.txt
Explicitly link to install.txt in source repo to avoid issues on projects.spring.io with a broken relative link
... also fix this for rendered markdown on GH itself :-)
11 years ago
Phillip Webb 6934b340ce Update README to RC4 11 years ago
Spring Buildmaster b0d4e8ae69 Next development version 11 years ago
Spring Buildmaster cb8668a151 Release version 1.0.0.RC4 11 years ago
Sebastien Deleuze e9ead99e9c Make Spring Boot tests locale independent
Fixes gh-405
11 years ago
Dave Syer f0f73a4ead Current directory (lodaer.path=.) pathology workaround
It turns out that loader.path=. was pathological and before this
change ended up making the classpath empty (loader.path=.,lib/
would have fixed it). With this change the old behaviour is still
supported, but if the only user-supplied path entry is "." (or
empty) then it is now kept, and translates into the root of the
current archive if running as "java -jar ...".

Fixes gh-270
11 years ago
Christian Dupuis 703d7d3fd9 Prevent EmptyStackException in case no stack of prompts is empty 11 years ago
Phillip Webb e4376bc4a6 Update READMEs to 1.0.0.RC3 11 years ago
Spring Buildmaster 1367d57e8c Next development version 11 years ago
Spring Buildmaster eaff1677a7 Release version 1.0.0.RC3 11 years ago
Phillip Webb eaa05c6b6d Update READMEs to 1.0.0.RC2 11 years ago
Phillip Webb af93ae2dac Ignore failing JMS tests for now
Ignore JMS sample which intermittently fails to run on CI.

See gh-323
11 years ago
Phillip Webb 2d8f66e3c5 Add more JMS sample log output 11 years ago
Phillip Webb ed9735361e Apply source cleanup and formatting 11 years ago
Phillip Webb 0f083c2f9d Fix CLI class tangle 11 years ago
Phillip Webb 1061d582dc Fix CLI package tangles 11 years ago
Phillip Webb 70cb8cfed6 Fix CLI package and class tangles 11 years ago
Phillip Webb c65dc9063c Don't expose URLs from InnerLoader
Update the CLI Groovy InnerLoader to not expose URLs. This prevents the
'TLD skipped' log messages from Tomcat that occurred previously due to
the InnerLoader and parent returning the same URLs.

Fixes gh-277
11 years ago
Phillip Webb 208bf8fc96 Polish CLI Jar generation 11 years ago
Phillip Webb d648603634 Exclude *.jar and *.groovy from generated JARs
Update `JarCommand` to exclude `**/*.groovy` and `**/*.jar` by default.
11 years ago
Phillip Webb c852fb5a79 Update packaged JARs to use standard JarLauncher
Change CLI generated JARs to use the standard `JarLauncher` instead of
a custom `JarRunner`. The `PackagedSpringApplicationLauncher` is used
as the `Start-Class` which in turn calls `SpringApplication.run()`.
11 years ago
Andy Wilkinson 96e10104e4 Add a command to produce a self-contained executable JAR for a CLI app
A new command, jar, has been added to the CLI. The command can be
used to create a self-contained executable JAR file from a CLI app.

Basic usage is:

spring jar <jar-name> <source-files>

For example:

spring jar my-app.jar *.groovy

The resulting jar will contain the classes generated by compiling the
source files, all of the application's dependencies, and entries
on the application's classpath.

By default a CLI application has the current working directory on
its classpath. This can be overridden using the --classpath option.
Any file that is referenced directly by the classpath is always
included in the jar. Any file that is found a result of being
contained within a directory that is on the classpath is subject to
filtering to determine whether or not it should be included. The
default includes are public/**, static/**, resources/**,
META-INF/**, *. The default excludes are .*, repository/**, build/**,
target/**. To be included in the jar, a file must match one of the
includes and none of the excludes. The filters can be overridden using
the --include and --exclude options.

Closes #241
11 years ago
Ben Hale f2951b38d9 Ruby indentation conventions
By convention, Ruby code is indented using two spaces (  ) per-level.
The code used tabs (\t) previously and therefore wasn't idiomatic.
This change updates the indenting to use two spaces.
11 years ago
Ben Hale a3c398ca0a Add --HEAD support to Homebrew formula
This change adds support for --HEAD builds to the Homebrew formula. It
defines a conditional dependency on Maven and builds the -cli project
during install.  The location to install from is abstracted out so
that code is identical regardless of whether the build is --HEAD or
mainline.
11 years ago
Phillip Webb a624245b78 Remove dead code
Remove what appears to be unused CLI code.
11 years ago
Phillip Webb ac0ff3c0b8 Upgrade to Spring Framework 4.0.1 SNAPSHOT
Upgrade to the latest 4.0.x SNAPSHOT of the Spring Framework in
preparation for the 4.0.1 release.
11 years ago
Phillip Webb 49ef1cd236 Update CLI to use spring-boot-dependency-tools
Update `GroovyCompiler` and `AetherGrapeEngineFactory` to use the
recently added `spring-boot-dependency-tools` in favor of loading
dependency information from a generated properties file.
11 years ago
Dave Syer c5584b490a Add some more smarts around --debug
--verbose seems to be only for CLI logging (so really only
for dependency resolution). --debug is interpreted by SpringApplication
but up to now has been extracted and deleted from the command line
by the CommandRunner. This change makes --debug set a System property
*and* pass it down to the application (if used with -- separator).

Fixes gh-266
11 years ago
Phillip Webb 4a0ef9720b Update READMEs to reference latest version number 11 years ago
Phillip Webb 595cb6d55b Fix version-type logic to deal with RCx form 11 years ago
Phillip Webb f500e48e2c Fix version replacement in homebrew generation 11 years ago
Phillip Webb d0f3e33f21 Remove unused test dependency 11 years ago
Phillip Webb 43e54d38f7 Make fields private where possible 11 years ago
Phillip Webb 0160760568 Apply latest eclipse cleanup rules 11 years ago
Phillip Webb ac54d7fe3c Final polish before 1.0.0.RC1 11 years ago
Phillip Webb cdda330acd Update copyright header for files changed in 2014 11 years ago
Phillip Webb 7bb6bf6a54 Polish 11 years ago
Phillip Webb 68293f34af Upgrade version to 1.0.0.BUILD-SNAPSHOT
Fixes fg-243
11 years ago
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`.
11 years ago
Dave Syer 5627caa724 Move spring-boot tests utilities to main spring-boot.jar
Fixes gh-233
11 years ago
Phillip Webb 28a92d22dc Prevent CTRL-D from causing NPE in shell
Update the integrated shell to deal with a null line which can be
triggered with CTRL-D.

Fixes gh-229
11 years ago
Dave Syer 796816e8c3 Remove CleanCommand
Fixes gh-230
11 years ago
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
11 years ago
Phillip Webb cad9fbfdf0 Fix CLI help formatting issue with '-cp'
Ensure that '--cp' is replaced with a same length string to prevent
odd help text formatting.
11 years ago
Phillip Webb 3b259bc865 Polish 11 years ago
Andy Wilkinson 5fb42c3c33 Support @Grab when app has multiple groovy scripts
The AST transformation that processes @Grab annotations is driven once
per source file. Previously, this meant that if an app consisted of
multiple source files then multiple, discrete dependency resolutions
would be performed.

This commit updates AetherGrapeEngine to cache a previous resolution's
outcome and use its dependency to influence the outcome of subsequent
resolutions. For example if a one resolution results in spring-core
4.0.0.RELEASE being added to the classpath, subsequent resolutions
that depend upon spring-core will always get the 4.0.0.RELEASE
version. This is achieved by using the dependencies found by earlier
resolutions as dependency management configuration of the current
resolution. This removes the possibility of multiple versions of the
same dependency ending up on the classpath.

In addition to using the results of earlier resolutions to provide
dependency management configuration, default dependency management
configuration is also provided. This configuration is specified by
the springcli.properties file and ensures that, where Boot prescribes
certain versions of a dependency, that is the version that will be
resolved. For example, this ensures that spring-data-redis, which
depends upon Spring 3.1.4, pulls in the version of Spring that Boot
requires instead.

Fixes #224
11 years ago
Dave Syer 57ba6a40b6 Divert out/err streams while command runs
Actually System.in works fine, it's the output streams that get buffered.
We can fix it by diverting them for the duration of the command.

Fixes gh-217
11 years ago
Dave Syer 6b6bd37924 Add hint to user about 'stop' command
Improves gh-218
11 years ago
Dave Syer 1f5cba9e32 Clear prompt before clearing screen
Fixes gh-219
11 years ago
Dave Syer fa8e4768b9 Prevent JLine from expanding !history events
We might also want to rethink "!" as a shell exec command (since it means
something in a real shell and in JLine). E.g. use "exec" or something.

Partial fix for gh-220 (ideally we'd process the events and catch
and handle exceptions).
11 years ago
Dave Syer b07a1998df Remove InitCommand altogether
Related to gh-212
11 years ago
Dave Syer 8ff2a88712 Fix counting error in SourceOptions 11 years ago
Dave Syer a5f16d46fe Remove ScriptCommand support
InitCommand remains for now, so that you can @Grab a jar with
custom commands if you so choose.

Contributes to gh-212
11 years ago
Dave Syer 3e6eb6fec8 Remove support for InitCommand outside REPL
In this commit we retain "init" as a command inside the ShellCommand
but not on the bash command line.

Seems to have an impact on performance so relevant to gh-212.
11 years ago
Dave Syer 5b90e18564 More performance tweaks for SpringCli 11 years ago
Andy Wilkinson 895daacde9 Roll spring-boot-maven-settings into the CLI 11 years ago
Phillip Webb e3b352e0b5 Support 'headless' applications
Update SpringApplication to run by default in 'headless' mode. This
prevents the AWT system from creating a Java icon (for example in the
OSX dock).

Also update builds to run tests in 'headless' mode.
11 years ago
Phillip Webb ffe8bf5419 Remove unused .gitignore files 11 years ago
Andy Wilkinson e96fa79c31 Don't pull test and provided dependencies into the CLI jar 11 years ago
Dave Syer 165ba2eb45 Add some performance tests for InitCommand
Fixed gh-212 again
11 years ago
Dave Syer 420fc69983 Only run InitCommand if there is code to process
This appears to be a significant improvement in performance
(checking for the existence of init.grooy is cheap, but compiling
it is expensive).

I'm going to say this fixes gh-212.
11 years ago
Dave Syer 322af41d72 Revert CLI to JarLauncher
Affects gh-212
11 years ago
Phillip Webb 47da8a817a Polish 11 years ago
Phillip Webb 18a666caf8 Replaces references to 'files' with 'sources'
Replace references to 'files' throughout the code-base with 'sources'
following the rename of `FileOptions` to `SourceOptions`.

Also cleanup ResourceUtils a little
11 years ago
Phillip Webb 2c6231a0fc Restore eclipse settings to stop m2e errors 11 years ago
Dave Syer bd73705393 FileOptions -> SourceOptions to work with String paths instead of Files
We check for existence of the sources and (as before) resolve multiple
resources on the classpath if a path is not a File. In addition supports
Spring pseudo-URL prefixes as well as normal URLs as source locations.

In addition sources can now be specified as a directory (searched
recursively by default), or a resource pattern (e.g. app/**/*.groovy).

Fixes gh-207
11 years ago
Dave Syer edaaac8993 Fix broken test
Recent changes to the repository configuration for @Grab
didn't update the tests which use the GroovyCompiler as
a standalone. Fixed that by using the
RepositoryConfigurationFactory.
11 years ago
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.
11 years ago
Andy Wilkinson 9a5be9f4cd Revert "Test that auto configurations can be added by init scripts"
The test passes locally, both in Eclipse and on the command line, but
fails on the CI server. Revert the addition of the test while I
hopefully figure out why.

This reverts commit 2e81b1d0d0.
11 years ago
Andy Wilkinson a010de955d Reinstate ./repository as a "remote" repository
The grab command downloads the dependencies of one or more Groovy
scripts to ./repository. This commit ensures that those previously
downloaded dependencies can be used by a subsequent invocation of the
run command.

The location and behaviour of the local cache is unaffected by this
change. If the dependencies in ./repository do not exist in the local
cache, Aether will "download" them from ./repository and store them in
the local cache.

Fixes #191
11 years ago
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.
11 years ago
Andy Wilkinson 2e81b1d0d0 Test that auto configurations can be added by init scripts
When an init command is run, it may add entries to the classpath. This
commit adds a test that verifies that, if an entry that is added to
the classpath contains a CompilerAutoConfiguration file in
META-INF/services, then the CompilerAutoConfigurations declared in it
are found by subsequent ServiceLoader.load calls.
11 years ago
Dave Syer 4e1245d9ee Restore changes from 0332501 (fix class loader test failure) 11 years ago
Andy Wilkinson 3336b6da44 Remove redundant @GrabResolver transform
Previously, a transform was used to add @GrabResolver annotations
during compilation that added the Spring milestone and snapshot
repositories. This functionality is now handled by
RepositoryConfigurationFactory so the transform is no longer required.
11 years ago
Greg Turnquist b5b86d07ba Add Spring MVC's org.springframework.ui package to the list of automatic imports 11 years ago
Dave Syer ac34f9c993 First proper draft of DSL for Groovy Commands
Users can declare or Command, OptionHandler classes in an init script
or they can use a DSL, e.g.

command("foo") { args -> println "Do stuff with ${args} array" }

or

command("foo") {
  options { option "bar", "Help text for bar option" ithOptionArg() ofType Integer }
  run { options -> println "Do stuff with ${options.valueOf('bar')}" }
}
11 years ago
Dave Syer 1e75c0a55b Extend programming model for script commands 11 years ago
Dave Syer b5db4d3ff4 Enhance FileOptions to support multiple classpath resources 11 years ago
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.
11 years ago
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).
11 years ago
Dave Syer e48ddaeb99 Fix grab test 11 years ago
Dave Syer df476bed1f Ensure local repository cache is always used 11 years ago
Phillip Webb bd6c672bba Drop jumping into shell when running without args
Change SpringCli so that running without arguments no longer jumps into
the embedded REPL shell. This restores the ability to obtain quick usage
help by simply typing `spring` from the command prompt.

Windows users or developers that prefer the embedded shell can still
launch it using `spring shell`.
11 years ago
Phillip Webb f56318e9b8 Polish embedded REPL shell 11 years ago
Phillip Webb 1bcd3de7b5 Polish 11 years ago
Phillip Webb 0f9c705980 Rework OptionHandler '-cp' argument support
Change OptionHandler to support '-cp' instead of '--cp'. This update
to the original fix (045088e8b) renders `help` output correctly and
should prevent potential issues if a `-p` command is added in the future.

Fixes gh-178
11 years ago
Dave Syer 045088e8b3 Add -cp to option help for compiler commands
Fixes gh-178
11 years ago
Dave Syer 4cfc7b6ad9 Make sure integration still works in CLI 11 years ago
Dave Syer aa2b020660 Refactor metrics to expose richer feature set
Main user-facing interface is still Counter/GaugeService but the
back end behind that has more options. The Default*Services write
metrics to a MetricWriter and there are some variants of that, and
also variants of MetricReader (basic read-only actions).

MetricRepository is now a combination of MetricReader, MetricWriter
and some more methods that make it a bit more repository like.

There is also a MultiMetricReader and a MultiMetricRepository for
the common case where metrics are stored in related (often open
ended) groups. Examples would be complex metrics like histograms
and "rich" metrics with averages and statistics attached (which
are both closed) and "field counters" which count the occurrences
of values of a particular named field or slot in an incoming message
(e.g. counting Twitter hastags, open ended).

In memory and redis implementations are provided for the repositories.
Generally speaking the in memory repository should be used as a
local buffer and then scheduled "exports" can be executed to copy
metric values accross to a remote repository for aggregation.
There is an Exporter interface to support this and a few implementations
dealing with different strategies for storing the results (singly or
grouped).

Codahale metrics are also supported through the MetricWriter interface.
Currently implemented through a naming convention (since Codahale has
a fixed object model this makes sense): metrics beginning with "histogram"
are Histograms, "timer" for Timers, "meter" for Meters etc.

Support for message driven metric consumption and production are provided
through a MetricWriterMessageHandler and a MessageChannelMetricWriter.

No support yet for pagination in the repositories, or for HATEOAS style
HTTP endpoints.
11 years ago
Dave Syer 5d8e58d12c Remove support for Integration DSL (milestone only) 11 years ago
Dave Syer de82557bd8 Change command set when entering shell
Fixes gh-147
11 years ago
Dave Syer d50d378c33 Prevent more than one app at a time from running 11 years ago
Dave Syer 0bca416d3b Remove CLI_APP name if in shell 11 years ago
Dave Syer cc8aa753da Add basic Banner to CLI Shell 11 years ago
Dave Syer cccb5d4610 Add ShellCommand and friends 11 years ago
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).
11 years ago
Dave Syer e2c962ac28 Switch to thymeleaf-spring4 11 years ago
Phillip Webb d04248a845 Use SHA1 checksum for homebrew 11 years ago