Commit Graph

194 Commits (f48c02ccb56db87b112a160b00a0c9ce81768996)

Author SHA1 Message Date
Phillip Webb 6e29ee4557 Polish 9 years ago
Phillip Webb 4aa2fed48b Revert "configure JRE that is different from compiler target level"
This reverts commit 678f36cfef.
9 years ago
Dave Syer 9dec0971d6 Change restart to fail if not running 9 years ago
Dave Syer ff681adc5b Fix launch.script to not exit prematurely
Use "return" instead of "exit" where possible, especially in
function definitions.

Also fixed the exit codes to match the LSB spec for some specific
conditions (fixes gh-3521).

Fixes gh-3199, fixes gh-3535
9 years ago
Martin Lippert 678f36cfef configure JRE that is different from compiler target level 9 years ago
Stephane Nicoll 42e230192f Polish 9 years ago
izeye f4589e7cc3 Fix typos
Closes gh-3504
9 years ago
Phillip Webb e3b59774c8 Merge branch '1.2.x' 9 years ago
Phillip Webb 4b17f3ceef Formatting 9 years ago
Andy Wilkinson a2d58030dd Merge branch '1.2.x' 9 years ago
Andy Wilkinson 68e54e1d5d Favour entries in source jar over standard libraries when repackaging
When writing a jar, once an entry has been written it will never be
overwritten, i.e. the first write of a given entry will win. Previously,
when repackaging a jar, the existing contents were written followed by
any libraries. This caused a problem when repackaged a WAR file and
a library needed to be unpacked as the existing entry in WEB-INF/lib
would prevent the library with the UNPACK comment from being written.
This was addressed in f761916b by inverting the order so libraries
would take precedence over entries in the source jar.

It’s now become apparent that this change in the order causes a problem
for users who are obfuscating their code. The obfuscated code exists in
the source jar but is also provided to the repackager in its original
form as a library. When libraries take precedence, this means that the
code in its original form ends up in the repackaged war and the
obfuscation is lost.

This commit updates the repackager to write libraries that require
unpacking first. This allows the UNPACK comment to be written even if
there’s also a source entry for the library. Next, source entries are
written. This allows obfuscated source entries to take precedence over
any unobfuscated library equivalents. Lastly, standard libraries that
do not require unpacking are written into the repackaged archive.

Closes gh-3444
9 years ago
Andy Wilkinson 2263095bbb Update launch.script to match chkconfig start levels with defaults
Closes gh-3419
10 years ago
Spring Buildmaster 7ce391db4f Next development version 10 years ago
Phillip Webb 61fc4f3f12 Polish copyright headers 10 years ago
Phillip Webb f22c91ac94 Add chkconfig comment to launch script
Update the embedded launch script to include a `chkconfig` comment. This
solves the "Service doesn't support chkconfig" error when executing
the chkconfig command.

Fixes gh-3115
10 years ago
Phillip Webb f65dfe4bcb Fix javadoc errors and warnings 10 years ago
Johannes Stelzer f0bb60bf9d Improve executable jar launch script
Update the launch script used in fully executable jars to:

- Include LSB-Header comments
- Source `.conf` files either next to the jar for additional script
  configuration

Fixes gh-3243
10 years ago
Phillip Webb bce4bb8860 Polish start stop support 10 years ago
Spring Buildmaster 5d81c87b43 Next Development Version 10 years ago
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 63a7b24d27 Fix test that was broken in b24e736c 10 years ago
Dave Syer b24e736cfe Add env var parameters to launch.script
Some of the features of the launch.script were not exposed for users
to be able to control at runtime. It now accepts things like
PID_FOLDER and LOG_FOLDER as environment variables, and also adopts
a clear naming convention where only the inputs are UPPER_CASE.
10 years ago
Phillip Webb 2176afb49e Set timestamps of nested jars
Update JarWriter to set the entry timestamp for nested jars. The
timestamp is set to same time as the first (non directory) entry in
the nested jar.

This change should make it easier to created layered docker images.

Fixes gh-2807
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
Phillip Webb c2e2bc879e Fix broken RepackerTests on Windows
Update test to deal with the fact that POSIX operations aren't available
on Windows.

Fixes gh-1117
10 years ago
Phillip Webb 793481843c Support embedded jar initialization scripts
Update the Maven and Gradle plugin to generate fully executable jar
files on Unix like machines. A launcher bash script is added to the
front of the jar file which handles execution.

The default execution script will either launch the application or
handle init.d service operations (start/stop/restart) depending on if
the application is executed directly, or via a symlink to init.d.

See gh-1117
10 years ago
Phillip Webb 8143d1f36d Apply animal sniffer to entire build
Move animal sniffer configuration out of spring-boot-dependencies to
spring-boot-parent and apply it to all projects.

See gh-716
10 years ago
Spring Buildmaster e03c11dda8 Next development version 10 years ago
Andy Wilkinson 6a32519aa8 Merge branch '1.2.x' 10 years ago
Andy Wilkinson f761916b51 Honor unpack for war files
Previously repackaging of an archive was performed in three steps:

1. Write the manifest
2. Write entries from the source archive into the destination
3. Write any libraries into the destination if they’re not already there

This worked fine for jar files, but not for war files. In the war file
case the libraries are already in the source archive’s WEB-INF/lib
directory so they’re copied into the destination in step 2. This means
that step 3 largely becomes a no-op and, crucially, the UNPACK comment
is not applied to any libraries that require it.

This commit reorders steps 2 and 3 so that the libraries are copied into
the destination first (allowing the UNPACK comment to be written, if
required) and then any entries in the source are written into the
destination if they’re not already there.

Fixes gh-2588
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 8e398dc6a7 Polish Javadoc
Update Javadoc to add missing @return and @param elements.
10 years ago
Phillip Webb 0696695e16 Add package javadoc 10 years ago
Spring Buildmaster 60725cd8bd Next development version 10 years ago
Phillip Webb d7a12a8791 Remove superfluous semi-colons 10 years ago
Andy Wilkinson 843ee14cea Merge branch '1.1.x' 10 years ago
Andy Wilkinson 5c67e6f141 Update war layout to package custom scope dependencies in WEB-INF/lib/
Fixes gh-2187
10 years ago
Andy Wilkinson ff714f6c17 Update module layout to package custom scope dependencies in lib/
Fixes gh-2187
10 years ago
Spring Buildmaster 63e6a25097 Next development version 10 years ago
Spring Buildmaster 1a788c1741 Next development version 10 years ago
Phillip Webb 3523bca79b Polish 10 years ago
Phillip Webb e0a0af436f Add 'module' repacker layout
Add a 'module' layout for the repackager which includes all 'compile'
and 'runtime' scope dependencies and does not require a main class.

Fixes gh-1941
10 years ago
Spring Buildmaster 46b7738334 Next development version 10 years ago
Spring Buildmaster 3e71a21b30 Next development version 10 years ago
Spring Buildmaster edb4b7ed7d Next development version 10 years ago
Spring Buildmaster d63e4b4329 Next development version 10 years ago
Phillip Webb 6f62fc854b Merge branch '1.1.x' 10 years ago
Stephane Nicoll f46fe32264 Add group discriminant in case of conflict
Prior to this commit, the repackage goal silently ignored the case of
two libraries having the same name and version but a different group.
As a result, the second library was overwriting the first one in the
repackaged jar.

This commit adds support for custom Library names and updates the
Maven and Gradle plugins so that the name includes the group ID
when there would otherwise be a duplicate.

Fixes gh-1475
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
Andy Wilkinson be2803a776 Merge branch '1.1.x' 10 years ago
Andy Wilkinson 6f8d4778ad Prevent a jar from being repackaged more than once
Previously, Repackager would repackage a jar file as many times as
it was asked to do so. This lead to problems if a user made a mistake
when using Maven that led to the package phase being driven twice,
for example by running "mvn clean install package".

This commit updates Repackager so that a repackage call becomes a
no-op if the source jar's manifest already contains the
Spring-Boot-Version attribute which is added by repackaging.

Fixes #1251
10 years ago
Dave Syer fc9b160a72 Merge branch '1.1.x' 10 years ago
Dave Syer 8853c7c352 Ensure properties that are not enumerable can be resolved from placeholders
Before this change a property whose key was in a non-enumerable property source would
not resolve placeholders, leading to ${style} values in @ConfigurationProperties beans
even if the placeholders ere resolvable.
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
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
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 5f8fbfd73a Add Library abstraction
Add a Library class update the LibraryCallback interface and
implementations to use it. This change is in preparation for
an addition `unpack` flag that will be required to allow the
automatic unpacking of certain nested jars.

See gh-1070
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 f0c0f00089 Polish 11 years ago
Andy Wilkinson 02de6e3531 Remove signal handling race condition from RunProcess
Fixes #1061
11 years ago
Phillip Webb b5d267ca89 Polish 11 years ago
Dave Syer bc5a4bcc1e Compiler warnings 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
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
Andy Wilkinson 7a8be3d600 Use Spring Framework bom and fully exclude commons-logging
Closes #955
Closes #978
11 years ago
Phillip Webb d4d3ffa93c Unify versions in POMs started by the invoker
Unify the versions used in integration tests launched by the
maven-invoker-plugin. Allows for already cached local copies to be
used, hopefully speeding up the build.
11 years ago
Phillip Webb 7b170368e5 Require single main class
Update run tasks to ensure that only a single main class is required
when performing a class search.

See gh-886
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
Dave Syer 8b251e546a Monkey with process forking for Windoze
There were several problems to fix. 1) a bug in the
JDK (1.7 up to 7_60):

https://bugs.openjdk.java.net/browse/JDK-8023130

which we can work around by detecting buggy VMs and not trying
to use inheritIO. 2) File<->URL conversion is platform dependent
and we shouldn't make any assumptions. The problem in this case
was that file URLs contain a ":" so they can 't be added to a
path in UNIX, but on Windows you need the absolute path with the
colon. Solution: use Files on the classpath for spring-boot:run.

Hopefully also fixes gh-767
11 years ago
Dave Syer 329010d29e Normalize paths in JvmUtils
Fixes problem in Windoze where file paths cannot be so easily
converted to URLs.

Fixes gh-767
11 years ago
Dave Syer b04304b691 Add @since 11 years ago
Dave Syer b884a73396 Share RunProcess with CLI 11 years ago
Dave Syer 240788862e Make RunMojo fork a new process
By forking a new process we get to attach the agent
much earlier and JPA can co-exist.

Fixes gh-648
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
Spring Buildmaster a5864ebcd0 Next development version 11 years ago
Phillip Webb 2bb0f744e0 Polish 11 years ago
Dave Syer 2b616fb7d9 Extract logic for duplicate file removal so it can be shared
.. between Maven and Gradle plugins. Also fixed bug in recursive
scanning logic.

Really fixes gh-614
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 ac4cdd33c3 Revert "Next development version"
This reverts commit 1d0eea12eb.
Returning to 1.0.0.BUILD-SNAPSHOT for an updated release.
11 years ago