Commit Graph

443 Commits (6c6cf56e2d29e300164b7f07ce1d49865487a1dc)

Author SHA1 Message Date
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
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 4452bb1873 Revert "Upgrade Gradle plugin’s ID so it’s suitable for the Plugin Portal"
This reverts commit b1c0a7cda4.

The plugin publishing process has moved to a new plugin-based approach
that brings with it some significant limitations:

 - There's no staging to allow the promotion of good release builds
 - There's no easy way to upload an existing artifact
 - There's no control over the published pom.

The risk brought by these limitations, particularly the first, are
too great so we will no be publishing the Boot plugin to the Portal
until they're resolved.

Changing the plugin's ID was a breaking change that would require
users to do some work when they upgrade to Boot 1.3. The ID of the
plugin was changed purely so that it met the Portal's requirements.
Given that the plugin will not be published to the Portal for the
foreseaable future there's no need for us to inflict a breaking change
on people when there will be no benefit.

See gh-1567
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
Andy Wilkinson 02859cc2d4 Merge branch '1.2.x' 10 years ago
Andy Wilkinson ebb8d0c55f Read the time of a JarEntryData using MSDOS Date Time format
The format is rather unusual.

The time is 16 bits: 5 bits for the hour, 6 bits for the minutes, and 5
bits for the seconds. 5 bits only allows 32 values (0-31) so the number
must be doubled, meaning that the time is only accurate to the nearest
two seconds. Also, the JDK rounds this down by subtracting one. The
doubling and rounding is performed by shifting one place to the left
and masking off the right-most bit respectively.

The date is 16 bits: 7 bits for the year, 4 bits for the month, and 5
bits for the day. The year is from 1980, i.e. the earliest date that
can be represented is 1980-01-01.

See http://mindprod.com/jgloss/zip.html for more details of the format.

Fixes gh-2826
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
Sylvère Richard d8308cbf45 Support ANSI color from gradle bootRun
Update the BootRunTask to record the state of the System.console() so
that it can be picked up later by AnsiOutput.

Fixes gh-747
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 20a2f21493 Merge branch '1.2.x' 10 years ago
Andy Wilkinson c3a040acb3 Polishing
Remove unwanted System.out.println call
10 years ago
Andy Wilkinson b1c0a7cda4 Upgrade Gradle plugin’s ID so it’s suitable for the Plugin Portal
Gradle’s plugin portal requires each plugin’s ID to be in a namespace.
Our existing ID, spring-boot, does not meet this requirement. This
commit changes the plugin’s ID to org.springframework.boot.spring-boot.
Note that, as is recommended [1], the plugin’s ID does not include
“gradle”.

See gh-1567

[1] http://plugins.gradle.org/submit
10 years ago
Andy Wilkinson 0f51a53691 Remove manual Gradle plugin versionManagement test
Following the move to using the separate dependency management plugin
this test is no longer valid. It should have been removed as part of
2c3c62d7

See gh-2133
10 years ago
Andy Wilkinson 2c3c62d71c Replace basic Gradle dependency management with use of separate plugin
This commit replaces Spring Boot's basic dependency management support
with separate dependency management plugin. This has a number of
benefits including:

1. A Maven bom can be used rather than a custom properties file
2. Dependency management is applied transitively rather than only to
   direct dependencies
3. Exclusions are applied as they would be in Maven
4. Gradle-generated poms are automatically configured with the
   appropriate dependency management

Closes gh-2133
10 years ago
Andy Wilkinson 3649a89a03 Use maven-dependency-plugin 2.10 in Loader's integration test projects
Closes gh-2430
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 0174476ff1 Merge branch '1.1.x' into 1.2.x 10 years ago
Phillip Webb 50e1f80581 Remove .factorypath files 10 years ago
Phillip Webb 561ed99b5b Merge branch '1.1.x' into 1.2.x 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 8a49218e82 Fixup version numbers following release 10 years ago
Spring Buildmaster aea68f0c32 Next development version 10 years ago
Phillip Webb 56e31a8c6b Polish 10 years ago
Phillip Webb 1f0d45d795 Protect against NPE and improve error message
Update ConfigurationMetadataAnnotationProcessor so that `prefix` is
only obtained when the annotation is not null. Also improve exception
message by including the element.
10 years ago
Stephane Nicoll f8b191ff56 Revert "Add Version and VersionRange utilities"
This reverts commit 34ede2f31f.
10 years ago
Stephane Nicoll 34ede2f31f Add Version and VersionRange utilities
Parse a version using our version format or any version that complies
with Major.Minor.Patch. Also add a VersionRange utility that can
determine if a given version is withing that range.

Closes gh-2494
10 years ago
Stephane Nicoll e8e39e4bcf polish 10 years ago
Phillip Webb 636898f9ad Polish 10 years ago
Phillip Webb 8e398dc6a7 Polish Javadoc
Update Javadoc to add missing @return and @param elements.
10 years ago
Andy Wilkinson a88f27168a Add support to the Gradle plugin for disabling direct use of resources
The Maven plugin allows spring-boot:run to be configured so that
resources are loaded from their output location rather than from
src/main/resources. This commit adds an equivalent configuration
option to the Gradle plugin. To disable source resources from being
added to the classpath in place of those in the output location
the configure the bootRun tasks like this:

bootRun {
	addResources = false
}

Closes gh-2431
10 years ago
Phillip Webb 0696695e16 Add package javadoc 10 years ago
Phillip Webb ccdbfd274f Fix Java 8 Javadoc compatibility
Update Javadocs to fix errors caused by Java 8 aggressive linting.

Fixes gh-2233
10 years ago
Phillip Webb 072f873f34 Polish 10 years ago
Phillip Webb 3328c1369f Merge branch '1.1.x'
Conflicts:
	spring-boot/src/main/java/org/springframework/boot/logging/LoggingApplicationListener.java
10 years ago
Phillip Webb 555827cad7 Polish 10 years ago
Andy Wilkinson 23c175f674 Polish metadata annotation processor’s incremental build support
The main change in this commit is to introduce a new BuildHandler
abstraction. A BuildHandler is responsible for producing the metadata
for a build. Two implementations are provided; one for standard builds
and one for incremental builds. This change means that the annotation
processor is no longer concerned with the two different build types
and can use the same logic in each case.

The code for reading and writing metadata files has also been moved
out into a separate class, MetadataStore, to allow it to be easily
utilised from multiple places.

Closes gh-2313
10 years ago
Kris De Volder 8df43a8a79 Update the metadata annotation processor to support incremental builds
This commit udpdates the metadata annotation processor so that change
data from an incremental build is merged with the metadata from the
previous build.

Closes gh-2321
10 years ago
Andy Wilkinson 528a632fd1 Allow XA DataSource and ConnFactory pools to be configured via the env
This commit adds support for configuring the XA DataSource and
ConnectionFactory pools created by Atomikos and Bitronix via the
environment. The property prefixes vary depending on the transaction
manager that’s in use. They are:

Bitronix:
 - spring.jta.bitronix.datasource
 - spring.jta.bitronix.connectionfactory

Atomikos:
 - spring.jta.atomikos.datasource
 - spring.jta.atomikos.connectionfactory

The configuration processor has been updated to ignore
javax.jms.XAConnectionFactory and javax.sql.XADataSource as neither of
these types can be created via property binding.

Closes gh-2027
10 years ago
Andy Wilkinson 2665ef0692 Merge branch '1.1.x' 10 years ago
Andy Wilkinson 93b2a17fb8 Make repackage depend on jar tasks from runtime project dependencies
By default, when building a project's jar its runtime dependencies
are not taken into account as they are not needed to successfully
compile the code that will be packaged in the jar. A side-effect of
this was that, if a project that was being repackaged had a runtime
dependency on another project, then the repackaged jar would not
include the jar of the project on which it has the runtime dependency
as the jar had not been built.

This commit updates Boot's repackage task to have a dependency on the
jar task of any project dependencies in the runtime configuration
thereby ensuring that those dependencies' jars will have been built
before the repackaging occurs.

Fixes gh-2344
10 years ago
Andy Wilkinson ca69156afd Merge branch '1.1.x' 10 years ago
Andy Wilkinson bbd2486c04 Run invoker plugin with a single thread to avoid build failures
Running the invoker plugin with multiple threads against an empty
Maven cache results in strange build failures where Maven claims that
it cannot find a jar or pom file for an artifact that it should be
able to find. It would appear that Maven is unable to cope with
concurrent writes to its cache.

This commit removes the usage of multiple threads that was introduced
in 4e907f1.

Fixes gh-2389
10 years ago
Andy Wilkinson 606ea4979a Add a test to cover the merging of an additional metadata file
This test covers the code path that caused gh-2361 and also checks that,
when an additional metadata file is found, it’s correctly merged with
the other metadata.

Closes gh-2361
10 years ago