Commit Graph

310 Commits

Author SHA1 Message Date
Spring Buildmaster
aea68f0c32 Next development version 2015-02-26 13:01:31 -08:00
Phillip Webb
555827cad7 Polish 2015-02-01 20:00:11 -08:00
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
2015-01-21 15:02:10 +00:00
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
2015-01-21 13:19:52 +00:00
Dave Syer
4e907f19ce Carefully add nested archives from JAR in PropertiesLauncher
If user runs an executable archive then it and its lib directory will be
on the classpath. Entries from loader.path take precedence in a way that
should make sense to users (earlier wins like in CLASSPATH env var).

Also added new integration tests to verify the behaviour (big improvement
on the old ones, which probably aought to be beefed up to the same
standard).

Fixes gh-2314
2015-01-20 17:37:49 +00:00
Andy Wilkinson
5c67e6f141 Update war layout to package custom scope dependencies in WEB-INF/lib/
Fixes gh-2187
2014-12-17 20:21:29 +00:00
Spring Buildmaster
63e6a25097 Next development version 2014-12-10 18:06:30 -08:00
Andy Wilkinson
863c099161 Add missing copyright headers 2014-11-18 21:29:54 +00:00
Phillip Webb
608b1e65a1 Relax servlet check
Relax the servlet version check in Maven integration tests.

See gh-1797
2014-11-13 19:14:56 -08:00
Phillip Webb
3a9d6242ea Sync up versions used in Maven integration tests
Fixes gh-1797
2014-11-13 18:45:35 -08:00
Spring Buildmaster
46b7738334 Next development version 2014-11-11 17:12:24 -08:00
Michael Cramer
f62664534d Update maven-dependency-plugin to version 2.9
Closes gh-1862
2014-11-10 15:40:42 +00:00
Andy Wilkinson
9a2d654eba Rename test classes so that their tests are run by Maven 2014-10-15 16:35:48 +01:00
Eric Dahl
16937746a0 Fix some grammar issues in docs 2014-10-13 12:22:14 +01:00
Spring Buildmaster
3e71a21b30 Next development version 2014-10-10 15:19:47 -07:00
Phillip Webb
6028d92a4e Support Windows UNC paths with fat jars
Update `Launcher` and `JarFile` to correctly deal with Windows UNC
paths.

Fixes gh-1641
2014-10-09 19:06:28 -07:00
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
2014-10-01 19:20:04 +01:00
Andy Wilkinson
f7d1f968b9 Improve error message when JarFile encounters a compressed nested jar
Closes gh-1643
2014-10-01 10:09:30 +01:00
Spring Buildmaster
edb4b7ed7d Next development version 2014-09-25 21:02:37 -07:00
Phillip Webb
5ba86a103d Polish 2014-09-15 11:35:16 -07:00
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
2014-09-15 15:40:29 +01:00
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
2014-09-07 18:23:16 -05:00
Spring Buildmaster
d63e4b4329 Next development version 2014-09-04 12:15:18 -07:00
Phillip Webb
eaa3bd040d Apply eclipse formatting rules 2014-09-04 09:39:58 -07:00
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
2014-09-03 11:22:53 -07:00
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
2014-09-02 15:54:40 +02:00
Phillip Webb
1381fe172e Polish 2014-08-26 09:40:33 -07:00
Andy Wilkinson
28f7cf4487 Convert URL to File using a URI so that URL-encoding is removed
Fixes #1429
2014-08-26 17:04:50 +01:00
Andy Wilkinson
9717b7d840 Preserve JVM args when auto-configuring a Java agent in Gradle bootRun
Fixes #1411
2014-08-21 16:26:36 +01:00
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
2014-08-21 15:27:08 +01:00
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
2014-08-19 14:16:10 +01:00
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
2014-08-19 14:16:10 +01:00
Spring Buildmaster
74d0c5185a Next development version 2014-08-07 11:59:17 -07:00
Phillip Webb
92899474ac Polish 2014-08-06 09:10:23 -07:00
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
2014-07-30 11:07:41 +01:00
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.
2014-07-17 09:02:04 +01:00
Spring Buildmaster
40327e1ae6 Next development version 2014-07-08 02:33:36 -07:00
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
2014-07-07 13:24:33 -07:00
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
2014-07-03 13:33:32 +01:00
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
2014-07-03 11:42:11 +01:00
Phillip Webb
8054426803 Format source code 2014-07-02 15:17:25 -07:00
Phillip Webb
fa88c481a5 Remote trailing whitespace 2014-07-02 15:17:14 -07:00
Phillip Webb
6634322c13 Upgrade groovy-eclipse-batch version 2014-07-02 14:06:54 -07:00
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
2014-07-01 10:06:47 +01:00
Spring Buildmaster
981669b7c0 Next development version 2014-06-26 14:09:54 -07:00
Phillip Webb
35b26b52f2 Add caching to JarFile.getUrl()
Fixes gh-1178
2014-06-26 11:23:35 -07:00
Phillip Webb
200cd535c2 Revert "Next development version"
This reverts commit 67189477fe.
2014-06-26 11:03:09 -07:00
Spring Buildmaster
67189477fe Next development version 2014-06-26 10:51:35 -07:00
Phillip Webb
9632abf825 Formatting and cleanup 2014-06-26 09:41:15 -07:00
Phillip Webb
7e7733d45d Deal with spaces in file references
Fixes gh-1169
2014-06-25 15:43:07 -07:00