Commit Graph

443 Commits (20cea2aefc6edd9943f8d1866aa23be6559be9c4)

Author SHA1 Message Date
Phillip Webb 608b1e65a1 Relax servlet check
Relax the servlet version check in Maven integration tests.

See gh-1797
10 years ago
Phillip Webb 3030ad42fc Merge branch '1.1.x'
Conflicts:
	pom.xml
	spring-boot-actuator/pom.xml
	spring-boot-autoconfigure/pom.xml
	spring-boot-cli/pom.xml
	spring-boot-dependencies/pom.xml
	spring-boot-docs/pom.xml
	spring-boot-full-build/pom.xml
	spring-boot-integration-tests/pom.xml
	spring-boot-parent/pom.xml
	spring-boot-samples/pom.xml
	spring-boot-samples/spring-boot-sample-actuator-log4j/pom.xml
	spring-boot-samples/spring-boot-sample-actuator-noweb/pom.xml
	spring-boot-samples/spring-boot-sample-actuator-ui/pom.xml
	spring-boot-samples/spring-boot-sample-actuator/build.gradle
	spring-boot-samples/spring-boot-sample-actuator/build.xml
	spring-boot-samples/spring-boot-sample-actuator/pom.xml
	spring-boot-samples/spring-boot-sample-amqp/pom.xml
	spring-boot-samples/spring-boot-sample-aop/pom.xml
	spring-boot-samples/spring-boot-sample-batch/pom.xml
	spring-boot-samples/spring-boot-sample-data-elasticsearch/pom.xml
	spring-boot-samples/spring-boot-sample-data-gemfire/pom.xml
	spring-boot-samples/spring-boot-sample-data-jpa/pom.xml
	spring-boot-samples/spring-boot-sample-data-mongodb/pom.xml
	spring-boot-samples/spring-boot-sample-data-redis/pom.xml
	spring-boot-samples/spring-boot-sample-data-rest/pom.xml
	spring-boot-samples/spring-boot-sample-data-solr/pom.xml
	spring-boot-samples/spring-boot-sample-flyway/pom.xml
	spring-boot-samples/spring-boot-sample-hornetq/pom.xml
	spring-boot-samples/spring-boot-sample-integration/pom.xml
	spring-boot-samples/spring-boot-sample-jetty/pom.xml
	spring-boot-samples/spring-boot-sample-liquibase/pom.xml
	spring-boot-samples/spring-boot-sample-parent-context/pom.xml
	spring-boot-samples/spring-boot-sample-profile/build.gradle
	spring-boot-samples/spring-boot-sample-profile/pom.xml
	spring-boot-samples/spring-boot-sample-secure/pom.xml
	spring-boot-samples/spring-boot-sample-servlet/pom.xml
	spring-boot-samples/spring-boot-sample-simple/build.gradle
	spring-boot-samples/spring-boot-sample-simple/pom.xml
	spring-boot-samples/spring-boot-sample-tomcat-jsp/pom.xml
	spring-boot-samples/spring-boot-sample-tomcat-multi-connectors/pom.xml
	spring-boot-samples/spring-boot-sample-tomcat-ssl/pom.xml
	spring-boot-samples/spring-boot-sample-tomcat/pom.xml
	spring-boot-samples/spring-boot-sample-traditional/pom.xml
	spring-boot-samples/spring-boot-sample-velocity/pom.xml
	spring-boot-samples/spring-boot-sample-web-freemarker/pom.xml
	spring-boot-samples/spring-boot-sample-web-groovy-templates/pom.xml
	spring-boot-samples/spring-boot-sample-web-jsp/pom.xml
	spring-boot-samples/spring-boot-sample-web-method-security/pom.xml
	spring-boot-samples/spring-boot-sample-web-secure-custom/pom.xml
	spring-boot-samples/spring-boot-sample-web-secure-jdbc/pom.xml
	spring-boot-samples/spring-boot-sample-web-secure/pom.xml
	spring-boot-samples/spring-boot-sample-web-static/build.gradle
	spring-boot-samples/spring-boot-sample-web-static/pom.xml
	spring-boot-samples/spring-boot-sample-web-ui/build.gradle
	spring-boot-samples/spring-boot-sample-web-ui/pom.xml
	spring-boot-samples/spring-boot-sample-web-velocity/pom.xml
	spring-boot-samples/spring-boot-sample-websocket/pom.xml
	spring-boot-samples/spring-boot-sample-ws/pom.xml
	spring-boot-samples/spring-boot-sample-xml/pom.xml
	spring-boot-starters/pom.xml
	spring-boot-starters/spring-boot-starter-actuator/pom.xml
	spring-boot-starters/spring-boot-starter-amqp/pom.xml
	spring-boot-starters/spring-boot-starter-aop/pom.xml
	spring-boot-starters/spring-boot-starter-batch/pom.xml
	spring-boot-starters/spring-boot-starter-data-elasticsearch/pom.xml
	spring-boot-starters/spring-boot-starter-data-gemfire/pom.xml
	spring-boot-starters/spring-boot-starter-data-jpa/pom.xml
	spring-boot-starters/spring-boot-starter-data-mongodb/pom.xml
	spring-boot-starters/spring-boot-starter-data-rest/pom.xml
	spring-boot-starters/spring-boot-starter-data-solr/pom.xml
	spring-boot-starters/spring-boot-starter-freemarker/pom.xml
	spring-boot-starters/spring-boot-starter-groovy-templates/pom.xml
	spring-boot-starters/spring-boot-starter-hornetq/pom.xml
	spring-boot-starters/spring-boot-starter-integration/pom.xml
	spring-boot-starters/spring-boot-starter-jdbc/pom.xml
	spring-boot-starters/spring-boot-starter-jetty/pom.xml
	spring-boot-starters/spring-boot-starter-log4j/pom.xml
	spring-boot-starters/spring-boot-starter-logging/pom.xml
	spring-boot-starters/spring-boot-starter-mobile/pom.xml
	spring-boot-starters/spring-boot-starter-parent/pom.xml
	spring-boot-starters/spring-boot-starter-redis/pom.xml
	spring-boot-starters/spring-boot-starter-remote-shell/pom.xml
	spring-boot-starters/spring-boot-starter-security/pom.xml
	spring-boot-starters/spring-boot-starter-social-facebook/pom.xml
	spring-boot-starters/spring-boot-starter-social-linkedin/pom.xml
	spring-boot-starters/spring-boot-starter-social-twitter/pom.xml
	spring-boot-starters/spring-boot-starter-test/pom.xml
	spring-boot-starters/spring-boot-starter-thymeleaf/pom.xml
	spring-boot-starters/spring-boot-starter-tomcat/pom.xml
	spring-boot-starters/spring-boot-starter-velocity/pom.xml
	spring-boot-starters/spring-boot-starter-web/pom.xml
	spring-boot-starters/spring-boot-starter-websocket/pom.xml
	spring-boot-starters/spring-boot-starter-ws/pom.xml
	spring-boot-starters/spring-boot-starter/pom.xml
	spring-boot-tools/pom.xml
	spring-boot-tools/spring-boot-dependency-tools/pom.xml
	spring-boot-tools/spring-boot-gradle-plugin/pom.xml
	spring-boot-tools/spring-boot-loader-tools/pom.xml
	spring-boot-tools/spring-boot-loader/pom.xml
	spring-boot-tools/spring-boot-maven-plugin/pom.xml
	spring-boot-versions/pom.xml
	spring-boot/pom.xml
10 years ago
Phillip Webb 3a9d6242ea Sync up versions used in Maven integration tests
Fixes gh-1797
10 years ago
Spring Buildmaster 46b7738334 Next development version 10 years ago
Phillip Webb b947d6001d Polish 10 years ago
Andy Wilkinson ade22c87ec Update WarLauncher to remove the root of the war from the classpath
Previously, WarLauncher included its root on the classpath. It also used
a filtered version of its root archive to hide both the WEB-INF and
META-INF directories. This meant that files in WEB-INF and META-INF
could be found by the classloader (as they were on the classpath) but
could not be read as the filtered archive was hiding them.

This commit updates WarLauncher to remove the root of the war file from
the classpath. It also removes the filtering of the archive, thereby
allowing files in META-INF and WEB-INF to be accessed via the
ServletContext.

Closes gh-1792
10 years ago
Phillip Webb e902f6b91d Fix annotation processor builder setter detection
Update TypeElementMembers to correctly detect builder style setters.
The previous logic could fail because of the crazy way that TypeMirror
implements its equals() method.

Fixes gh-1859
See gh-1854
10 years ago
Phillip Webb 7b09cbee35 Don't generate empty configuration meta-data
Update ConfigurationMetadataAnnotationProcessor to only write non-empty
meta-data files.

Fixes gh-1858
10 years ago
Phillip Webb 3c9476fbe6 Polish 10 years ago
Andy Wilkinson b99ffcc170 Merge branch '1.1.x' 10 years ago
Michael Cramer f62664534d Update maven-dependency-plugin to version 2.9
Closes gh-1862
10 years ago
Stephane Nicoll 2786234eb4 Detect builder-style setter
Previously, a setter method that was returning the current instance was
not identified as a "setter" by the configuration processor. As a result,
builder-style APIs were not covered by the configuration metadata.

If a setter returns either void or the current class, it is now
recognized as a valid setter.

Fixes gh-1854
10 years ago
Stephane Nicoll 5946a44b7b Fix typo 10 years ago
David Turanski c12ffe76be Add "include filter" support for the Maven plugin
Update AbstractDependencyFilterMojo to support include filters as
well as exclude filters.

Fixes gh-1824
10 years ago
Phillip Webb 2696d37097 Protect against transitive additional meta-data
Update ConfigurationMetadataAnnotationProcessor to ensure that only
local `additional-spring-configuration-metadata.json` files are merged
with the final output.

See gh-1830
10 years ago
Phillip Webb 7e5bb9697c Call meta-data processor regardless of annotations
Update ConfigurationMetadataAnnotationProcessor so that it gets called
even if the source code doesn't include any @ConfigurationProperties
items.

See gh-1830
10 years ago
David Liu 9bf1c89750 Add fork option for mvn spring-boot:run
Update RunMojo to include a `fork` option and change the default
to only fork if agent or jvmArguments are specified.

Fixes gh-1412
10 years ago
Stephane Nicoll a46396f691 Add @NestedConfigurationProperty meta-data support
Add a @NestedConfigurationProperty annotation which can be used to
customize how configuration mete-data is generated.

Prior to this commit only inner-classes where considered nested
(see Tomcat in ServerProperties). Using this new annotation, the Ssl
property in ServerProperties can be detected as well.

See gh-1001
10 years ago
Phillip Webb c73adcd198 Add a defaultValue attribute to config meta-data
Update `ConfigurationMetadataAnnotationProcessor` to include the
'defaultValue' of a property when possible. For example the
'defaultValue' or 'server.port' is '8080'.

Default values are detected by inspecting the field assignments of
@ConfigurationProperties items. In order to detect field values some
internals of the Java compiler are used. To save a dependency on
'tools.jar' internal javac classes are accessed using reflection.

See gh-1001
10 years ago
Stephane Nicoll 884c058e57 Add processor to generate configuration meta-data
Adds an annotation processor to generates a JSON meta-data file at
compile time from @ConfigurationProperties items. Each meta-data file
can include an array or 'properties' and 'groups'.

A 'property' is a single item that may appear in a Spring Boot
'application.properties' file with a given value. For example,
'server.port' and 'server.context-path' are properties. Each property
may optionally include 'type' and 'description' attributes to provide
the data type (e.g. `java.lang.Integer`, `java.lang.String`) and
some short documentation (taken from the field javadoc) about what the
property is for. For consistency, the type of a primitive is translated
to its wrapper counterpart, i.e. `boolean` becomes `java.lang.Boolean`.

A 'group' provides a higher level grouping of properties. For example
the 'server.port' and 'server.context-path' properties are in the
'server' group.

Both 'property' and 'group' items may additional have 'sourceType' and
'sourceMethod' attributes to indicate the source that contributed them.

Users may use `META-INF/additional-spring-configuration-metadata.json`
to manually provide additionally meta-data that is not covered by
@ConfigurationProperties objects. The contents of this file will be
read and merged with harvested items. The complete meta-data file is
finally written to `META-INF/spring-configuration-metadata.json`.

See gh-1001
10 years ago
Phillip Webb 2e7aa4685b Polish 10 years ago
Andy Wilkinson 886bbc3b41 Merge branch '1.1.x' 10 years ago
Andy Wilkinson 9a2d654eba Rename test classes so that their tests are run by Maven 10 years ago
Andy Wilkinson 7211571969 Fix some grammar issues in docs
Closes gh-1695
10 years ago
Eric Dahl 16937746a0 Fix some grammar issues in docs 10 years ago
Spring Buildmaster 3e71a21b30 Next development version 10 years ago
Phillip Webb 509c3aef4e Merge branch '1.1.x' 10 years ago
Phillip Webb 6028d92a4e Support Windows UNC paths with fat jars
Update `Launcher` and `JarFile` to correctly deal with Windows UNC
paths.

Fixes gh-1641
10 years ago
Andy Wilkinson f2812afb19 Merge branch '1.1.x' 10 years ago
Andy Wilkinson bcd4c8eee2 Produce a single library for multiple file dependencies on the same file
Previously, the Gradle plugin’s ProjectLibraries produced a new library
for every file dependency, even if the dependencies where on the same
file. This would lead to a repackaging failure due to multiple
libraries having the same name.

This commit updates ProjectLibraries to treat file dependencies on the
same file as a single library, thereby resolving the name clash.

Fixes gh-1646
10 years ago
Andy Wilkinson 316e5f78f9 Merge branch '1.1.x' 10 years ago
Andy Wilkinson f7d1f968b9 Improve error message when JarFile encounters a compressed nested jar
Closes gh-1643
10 years ago
Spring Buildmaster edb4b7ed7d Next development version 10 years ago
Phillip Webb 565e449d89 Merge branch '1.1.x'
Conflicts:
	spring-boot-docs/src/main/asciidoc/howto.adoc
10 years ago
Phillip Webb 5ba86a103d Polish 10 years ago
Andy Wilkinson 9b719ac58e Merge branch '1.1.x' 10 years ago
Andy Wilkinson 3c815f4014 Provide group in ResolvedArtifactLibrary to enable discrimination
The fix for gh-1475 introduced the use of an artifact's group to
discriminate between two libraries with the same name (artifact id)
and version. However, in the case of Gradle, a group name was not
provided for libraries that have been resolved from a repository.

This commit updates ResolvedArtifactLibrary to use the group obtained
from the underlying ResolvedArtifact as its discriminator.

Fixes gh-1543
10 years ago
Andy Wilkinson b146e76b63 Merge branch '1.1.x' 10 years ago
Andy Wilkinson 06ffd9dd86 Fix configuration of Spring Loaded on Gradle 1.6
The applicationDefaultJvmArgs property was added in Gradle 1.7. This
commit updates RunPluginFeatures to access the property defensively
so that the plugin can be used with Gradle 1.6.

Fixes gh-1511
10 years ago
Spring Buildmaster d63e4b4329 Next development version 10 years ago
Phillip Webb 9cc893cd35 Merge branch '1.1.x'
Conflicts:
	spring-boot/src/test/java/org/springframework/boot/bind/RelaxedPropertyResolverTests.java
10 years ago
Phillip Webb eaa3bd040d Apply eclipse formatting rules 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
Stephane Nicoll a98c7613bf Merge branch '1.1.x' 10 years ago
Stephane Nicoll 9a8d05bd43 Clarify addResources parameter description
This commit clarifies the role of the 'addResources' flag and makes
it explicit that any duplicate found in the target directory are
actually removed

Fixes gh-1479
10 years ago
Phillip Webb 0dc389f5b3 1.Z -> 1.2 10 years ago
Phillip Webb fdd79907e9 Polish 10 years ago
Phillip Webb 1381fe172e Polish 10 years ago
Andy Wilkinson 2b47d608f3 Merge branch '1.1.x' 10 years ago
Andy Wilkinson 28f7cf4487 Convert URL to File using a URI so that URL-encoding is removed
Fixes #1429
10 years ago
Stephane Nicoll d1f4fd0ecb Add skip parameter to repackage goal
This commit adds a 'skip' parameter to the 'repackage' goal that is
false by default. When this parameter is enabled, the repackage goal
does not run at all.

This can be used when repackaging should occur conditionally or
when a particular module in a hierarchy should not use this feature.

Fixes gh-1424
10 years ago
Andy Wilkinson 2ed24ddcd5 Merge branch '1.1.x' 10 years ago
Andy Wilkinson 9717b7d840 Preserve JVM args when auto-configuring a Java agent in Gradle bootRun
Fixes #1411
10 years ago
Andy Wilkinson 0e7757decd Merge branch '1.1.x' 10 years ago
Andy Wilkinson 69c61d0e8e Include transitive file dependencies during Gradle repackaging
Previously, ProjectLibraries only considered a configuration's
direct file dependencies. This meant that a transitive file
dependency that should have been pulled in via a project dependency
was not included in the repackaged jar's lib directory.

ProjectLibraries has been updated to walk down the tree of project
dependencies and create libraries for any file dependencies that
are found.

Fixes gh-1368
10 years ago
Dave Syer 399238384f Merge branch '1.1.x' 10 years ago
Dave Syer 8e84151f8f Normalize search path in PropertiesLauncher
* Windows: allow absolute file paths without file:/// prefix
* All: only add nested archives (not directories), so loader.path=lib/*
behaves the same as -classpath=lib/* (except for adding zip files)

Fixes gh-1352
10 years ago
Dave Syer ccfc47091c Fix URL filtering when loading from a directory
The ExplodedArchive would erroneously always attempt to filter
its contents (and thereby shield them from a classloader that wrapped
it) even if they haven't been explicitly provided.

See gh-1352
10 years ago
Phillip Webb 54625cc2a0 Make LaunchedURLClassLoader lock provider static
Fixes gh-1380
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
Phillip Webb 4f440fcbb9 Java 7 ClassLoader performance improvements
Use Java 7 `registerAsParallelCapable` and `getClassLoadingLock` methods
when possible. This should improve performance when running on JDK 7+
whilst still remaining JDK 6 compatible.

Closes gh-1284
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 7455e4e86f Restore support for `files` gradle dependencies
Allow `compile files("$rootDir/vendor/foo.jar")` style declarations
with the jars repackaged from the gradle plugin.

Fixes gh-1215
11 years ago
Andy Wilkinson 1ffdc90f04 Further enhancements to Gradle repackaging logic
This commit refines the changes made under 4be688aa. 4be688aa made the
default jar task a special case which broke repackaging of the archive
produced by the default war task.

This commit refines RepackageTask’s logic so that, when it’s enabled,
it will repackage a jar task’s archive if:

- The jar task is equal to RepackageTask.withJarTask
- The name of the jar task is equal to RepackageTask.withJarTask
- RepackageTask.withJarTask is null, the jar task is not referenced
  by another RepackageTask’s withJarTask, and the jar task has an
  empty classifier

The last of these three is the default case and ensures the, when the
Spring Boot plugin is applied, default jar and war artifacts are
repackaged. The classifier check is required to prevent default source
and javadoc artifacts from being repackaged.

Fixes #1204
11 years ago
Andy Wilkinson 4be688aa78 Fix Gradle repackaging so it is only performed on the desired jars
The logic that determined whether or not the repackaging action should
be applied to a particular jar task was broken and caused problems
when a custom RepackageTask was used in a project's build.

This commit updates the logic so that repackaging will be applied:

 - To the default jar task if RepackageTask.withJarTask is null
 - To a jar task if it is equal to RepackageTask.withJarTask
 - To a jar task if its name is equal to RepackageTask.withJarTask

Repackaging is not applied if:

 - RepackageTask.enabled is false

Numerous integration tests have been added to verify the repackaging
behaviour.

Fixes #1204
11 years ago
Phillip Webb 8054426803 Format source code 11 years ago
Phillip Webb fa88c481a5 Remote trailing whitespace 11 years ago
Phillip Webb 6634322c13 Upgrade groovy-eclipse-batch version 11 years ago
Andy Wilkinson 53be0f8db7 Fix Gradle plugin logic for removing provided artifacts
The new ResolvedArtifact-based minus implementation was checking the
wrong Set when deciding whether or not a ResolvedArtifact should
be included in the result. This was leading to provided dependencies,
that should have only been packaging in WEB-INF/lib-provided also
being packaged in WEB-INF/lib.

The WarPackaging tests have been updated. In addition to checking that
WEB-INF/lib-provided does not contain anything that’s unexpected, they
also verify the contents of WEB-INF/lib

Fixes #1187
11 years ago
Spring Buildmaster 981669b7c0 Next development version 11 years ago
Phillip Webb 35b26b52f2 Add caching to JarFile.getUrl()
Fixes gh-1178
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 7e7733d45d Deal with spaces in file references
Fixes gh-1169
11 years ago
Phillip Webb 7654259f80 Fix JarFile issues when running on Windows
Fix 'fat jar' support for windows to correctly deal with URL and path
slash issues. The root cause of the original problem was caused by JAR
URLs not including a root slash (ie `file:C:/Users` vs `file:/C:/Users`)

Fixes gh-1145
11 years ago
Dave Syer 43cf95b845 Tidy up (remove unneeded property) RepackageTask 11 years ago
Spring Buildmaster 542f3cbda8 Next development version 11 years ago
Phillip Webb 60ef031f78 Fix "signer information does not match" error
Update ExecutableArchiveLauncher so that `-cp` URLs are not added
when they are already contained as nested JARs. This prevents a
SecurityException "signer information does not match error" when using
signed jars. The root cause of the issue was that the primary JAR file
was on the default classpath with the URL "file:....jar" and in the
main URL set as "jar:file:....jar". It is now filtered so that only
the "jar:" variant is added.

Fixes gh-1134
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
Phillip Webb 3d6c8a85f4 Allow URL resolution within nested JARs
Update JarURLConnection to allow the resolution of items within a nested
jar, even if the jarFile passed to the connection is several levels up.

This prevent a connection from incorrectly resolving an entry against
the wrong jar file.

See gh-1070
11 years ago
Phillip Webb 5de2661b43 Drop RepackageTask.getDependencies()
Drop `RepackageTask.getDependencies` from the gradle plugin in favor of
exposing `getLibraries()` and using the callback.
Drop getDependencies
11 years ago
Phillip Webb c713c8091d Polish 11 years ago
Phillip Webb 72a2e5bc02 Polish Gradle repackage 11 years ago
Dave Syer 542896b28f Support for non-executable JAR in addition to the repackaged one
Stretches the Gradle boot plugin a bit, so there's a sample build
in the "profile" sample. Howto docs give examples.

Fixes gh-1135
11 years ago
Dave Syer 1b97e8d921 Skip dependency exclusions if groupId is null
Fixes gh-1133
11 years ago
Dave Syer 08ae390696 Add dependencies to inputs in bootRepackge
See gh-1113
11 years ago
Dave Syer 772df9bea7 Add inputs to gradle bootRepackage task
See gh-1113
11 years ago
Phillip Webb 20fb55ea47 Polish 11 years ago
Phillip Webb a3ceaf63e2 Improve performance of fat jar loading
Tweak 'fat jar' handling to generally improve performance:

- Allow JarURLConnection to throw a static FileNotFoundException when
  loading classes. This exception is thrown many times when attempting
  to load a class and is silently swallowed so there is no point in
  providing the entry name.
- Expose JarFile.getJarEntryData(AsciiBytes) and store AsciiBytes in
  the JarURLConnection. Previously AsciiBytes were created, discarded
  then created again.
- Use EMPTY_JAR_URL for the JarURLConnection super constructor. The URL
  is never actually used so we can improve performance by using a
  constant.
- Extract JarEntryName for possible caching. The jar entry name
  extracted from the URL is now contained in an inner JarEntryName
  class. This could be cached if necessary (although currently it is
  not because no perceivable performance benefit was observed)

Fixes gh-1119
11 years ago
Phillip Webb a8777eda76 Add JarFile caching
Cache root jar files in the Handler and also store nested jar files in
the JarEntryData.

See gh-1119
11 years ago
Phillip Webb 88195292dd Reuse previously parsed entries for filtered JARs
Update JarFile to reuse the previously parsed entries when creating
filtered jars. This saves needing to re-scan the underlying file to
recreate a subset of entries.

See gh-1119
11 years ago
Phillip Webb e9aab1e90c Drop JarEntryFilters from constructor and methods
Drop JarEntryFilter arguments from the JarFile constructor and the
getNestedJarFile methods. Filtered JarFiles can still be obtained by
using the getFilteredJarFile() method.

This helps simplify the code a little and will make it easier to add
caching.

See gh-1119
11 years ago
Dave Syer 3411995736 Revert BootRunTask changes since they don't add anything
(Was an attempt to get Cygwin to recognise the interrupt, but it seems
to be doomed so not worth having the extra code in there really.)
11 years ago
Dave Syer e088ecd1bc Re-order shutdown hook in BootRunTask 11 years ago
Dave Syer a8663586dc Trap SIGINT in Gradle plugin 11 years ago
Phillip Webb 179e1558f6 Polish 11 years ago
Dave Syer 2433f721bc Add 'classifier' property to Gradle plugin
The default behaviour doesn't change with this commit, but now
the user has the option to specify a 'classifier' property
either in springBoot { classifier = 'exec' } (i.e. globally
for all repackage tasks) or in each repackage task, e.g.
bootRepackage { classifier = 'exec' }. In that case the original
archive is not overwritten but copied into <file>-<classifier>.jar
(or .war etc.) and then enhanced.

Fixes gh-1113, fixes gh-141 also I believe.
11 years ago
Dave Syer f0393f9ca6 Remove deprecated use of Compile to work with Gradle 2.0+
The class Compile was deprecated and will be removed in Gradle 2.0 (it is
already removed in the release canidate).

Instead we should use JavaCompile. Fixes gh-1066.
11 years ago
Dave Syer 4a40e8f833 Support for main class detection in installApp
I'm sure someone can do a better job of this, but here's a proposal
that works. It uses our FindMainTask to set the relevant properties
if theu are missing in the application plugin.

Fixes gh-1105
11 years ago
Phillip Webb 3a8a127285 Implement simpler exclusion logic for Gradle
Simplify the exclusion logic used in Gradle by implementing implicit
exclusions rather than trying to detect transitive excludes.

This commit reverts much of the code originally included to fix gh-1047
which adds far too much complexity to the build and still doesn't solve
the underlying issue.

Fixes gh-1103
11 years ago
Dave Syer f83c6aa7c1 Grab main class from "run" task if it exists
Fixes gh-1099
11 years ago
Phillip Webb d6a14c2b99 Revert "Add @Conditional to prevent HATEOAS blowing up"
This reverts commit e6e8907770
which has an incorrect commit message.
11 years ago
Dave Syer e6e8907770 Add @Conditional to prevent HATEOAS blowing up 11 years ago
Phillip Webb 54dc46f777 Allow prefixed bytes with fat JARs
Update `spring-boot-loader` ZIP processing code to support prefixed
bytes within the fat jar. This technique allows a bash script to be
embedded at the start of the JAR whilst still allowing `java -jar`
execution.

Fixes gh-1073
11 years ago
Spring Buildmaster 4ca26a21dc Next development version 11 years ago
Phillip Webb c861f24ba3 Switch mergeDependencies to use a set. 11 years ago
Andy Wilkinson f5f3903538 Resolve versionManagement configuration lazily and preserve exclusions
Previously, the versionManagement configuration was resolved as part of
the Boot Gradle plugin being applied. This meant that no dependencies
could be added to it and attempting to do so would result in a failure:
“You can't change a configuration which is not in unresolved state”.
This commit updates ApplyExcludeRules to wrap its processing in a
before resolve action. This defers the resolution of the
versionManagement configuration until one of the project’s other
configurations is being resolved. Fixes #1077

In addition to the above, the transitive exclusions that the Gradle
plugin provides were being lost if custom version management provided
a version for the same dependency. This commit updates
AbstractDependencies to preserve the exclusions from an existing
dependency declaration while using the version from the newer
dependency. This ensures that the exclusions remain while allowing
versions to be overridden. Fixes #1079
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
Phillip Webb cef7ad7798 Support automatic exclude rules with Gradle
Update the Spring Boot Gradle plugin to automatically apply exclude
rules to dependencies.

See gh-1047
11 years ago
Phillip Webb addc1f77bd Support transitive excludes in dependency-tools
Update spring-boot-dependency-tools to support transitive excludes.
Transitive excludes are useful with Gradle which considers each
dependency independently (see GRADLE-3061).

Transitive excludes are supported by parsing the dependency-tree file
from spring-boot-versions.

See gh-1047
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
Rob Winch adb2205dd9 Make SpringBootPlugin more Groovy
- Remove ;
- Remove unnecessary public modifiers
- Remove unnecessary .class suffixes

Fixes gh-1032
11 years ago
Rob Winch 52382f962e Default Compile tasks to use UTF-8 encoding
We also convert the SpringBootPlugin to be .groovy to ease defaulting
the encoding to UTF-8. We do not make the file any "more groovy" to leave
this to a distinct commit.
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 99af5dbe23 Merge branch '1.0.x'
Conflicts:
	spring-boot-dependencies/pom.xml
11 years ago
Phillip Webb d848f03c43 Fix URL methods in JarURLConnection
Update JarURLConnection to return correct values from `getURL()`,
`getJarFileURL()` and `getEntryName()`.

Fixes gh-973
11 years ago
Phillip Webb 695571ad0b 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 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 1a475102de Polish 11 years ago
Phillip Webb 794808b6b8 Various improvements to the Gradle plugin
Refactor and rework several areas of the Gradle plugin:

- Refactor package structure into functional areas and configure each
  area separately via a new PluginFeatures interface.
- Convert BootRunTask to extend RunTask rather than attempting to
  find existing RunTasks.
- Simplify agent integration by no longer needing specific BootRunTask
  code.
- Update the repackage task to consider the `mainClassName` property
  in addition to `springBoot.mainClass`.
- Automatically set `mainClassName` when calling `run` or `runBoot`
  from `springBoot.mainClass` if there is one.
- Ensure that explicitly defined `main` options on JavaExec tasks always
  take precedence.

Fixes gh-547, gh-820, gh-886, gh-912
11 years ago
Andy Wilkinson ee08667e81 Exclude Java agent jars from class path of launching class loader
ExecutableArchiveLauncher creates a ClassLoader that is used by the
Launcher to load an application’s classes. During the creation of this
ClassLoader URLs from another ClassLoader are copied over. This was
resulting in Java agents that are added to the system class loader
via the -javaagent launch option being available on both the system
class loader and the created class loader. Java agents are intended to
always be loaded by the system class loader. Making them available on
another class loader breaks this model.

This commit updates ExecutableArchiveLauncher so that it skips the URLs
of any Java agents (found by examining the JVM’s input arguments) when
copying URLs over to the new classloader, thereby ensuring that Java
agents are only ever loaded by the system class loader.

Fixes #863
11 years ago
Phillip Webb 4fd4744724 Add spring-boot-versions project
Add a new maven project containing a versions.properties file and
an effective POM. Rework existing projects to use the versions
artifacts.

Partially reverts 307fbba9e4

Fixes gh-913
11 years ago
Phillip Webb 8bcda1bcbe Polish 11 years ago
Andy Wilkinson 307fbba9e4 Use spring-boot-dependencies as spring-boot-dependency-tools' parent
Previously spring-boot-dependency-tools used spring-boot-tools as its
parent. This meant that it inherited spring-boot-parents' dependency
management that we did not want to expose to applications. The
solution to this was to generate the effective pom and then filter
out any thing that did not appear in spring-boot-dependencies' pom.
This filtering had to unwanted side-effect of breaking bom imports:
the effective pom would contain the dependency management from the
imported bom, but this would be filtered out as the entries didn't
appear in spring-boot-dependencies' pom.

This commit updates spring-boot-dependency-tools to use
spring-boot-dependencies as its parent. This means that its effective
pom contains the desired dependency management and nothing more,
allowing the filtering logic to be removed.

The use of Spring Security's bom has been reinstated as it will now
work as intended and versions for its modules will be available in the
CLI and via the Gradle plugin.

Closes #825
Fixes #838
11 years ago
Mark Ingram dd83b58b05 Exact match for groupId excludes
Previous to this commit, any groupId starting with one of the
configured exclude would be excluded as well. This potentially
leads to unintentional dependency filtering: for example the
GroupIdFilter with an exclusion of "org.springframework"
also removes "org.springframework.boot" dependencies.

Add MatchingGroupIdFilter that uses an exact match instead.

See #649
11 years ago
Phillip Webb 2cadf4165f Merge branch '1.0.x'
Conflicts:
	spring-boot-dependencies/pom.xml
	spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/jar/JarFileTests.java
11 years ago
Phillip Webb 6a644e2e23 Protect against malformed URLs on Windows
Update JarFile to correctly create system independent URLs to prevent
potential URISyntaxExceptions when running on Windows.

Fixes gh-836
11 years ago
Dave Syer 845a86d548 Monkey with JarUrlConnection to make it work when LANG unset
The problem all along has been in AsciiBytes, so the fix in
commit ce3aaf was just a stop gap for a system where multi-byte
characters are supported but the default encoding is not UTF-8 (e.g.
most Windows systems). The real solution is not to leave it to
chance and always pick an encoding for the JarEntry names (i.e.
in AsciiBytes).

(Cherry picked from commit 06e364a9ff)

Fixes gh-764
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
Phillip Webb 01fcf61140 Polish 11 years ago
Stephane Nicoll 158b6a5c07 Skip the execution of repackage in parent projects
If an execution of the repackage goal is present in a project with
'pom' packaging, it is now skipped. This allows to configure the
plugin in the parent.

Fixes gh-867
11 years ago