Commit Graph

675 Commits

Author SHA1 Message Date
Andy Wilkinson
9be96c49e2 Polish "Use HTTPS for external links wherever possible"
See gh-16316
2019-03-27 11:44:18 +00:00
Spring Operator
e401d02ced Use HTTPS for external links wherever possible
See gh-16316
2019-03-27 11:35:54 +00:00
Spring Operator
adc2462689 Use HTTPS for external links from XML files where possible
See gh-16311
2019-03-26 13:37:30 +00:00
Andy Wilkinson
0e009ef047 Use HTTPS to link to the Apache license 2019-03-20 15:00:10 +00:00
Spring Operator
7c314122f7 Update build and setup configuration to use HTTPS
See gh-16243
2019-03-19 16:01:05 +00:00
Stephane Nicoll
5863e6f78c Fix class name in generated meta-data
Previously, the algorithm that computes the String representation of a
class reference and a property type was shared. This lead to generic
information for group's `type` and `sourceType` property.

This commit separates that logic in two: `getQualifiedName` is now
responsible to generate a fully qualified class name while the existing
`getType` is solely responsible to generate a type representation for the
property. Only the latter has generic information.

Closes gh-7236
2016-10-28 13:23:47 +02:00
Spring Buildmaster
5f959b074f Next Development Version 2016-09-20 20:20:06 +00:00
Andy Wilkinson
93ab01263c Change the ownership of the pid folder when using a sub-folder
This is an alternative to the fix made in 3b52909 which removed the
chown call entirely.

Prior to 3b52909, the ownership of $PID_FOLDER was always changed even
when its value was /var/run. This was problematic as it could prevent
other services from creating their pid folder or file.

When a sub-folder is used, changing its ownership so that it’s owned by
the user that will run the app is desirable as it limits access to the
folder. Rather than removing the chown call entirely, this commit
ensures that it only happens when a sub-folder is being used to hold the
pid file.

Closes gh-6532
2016-09-19 09:27:38 +01:00
Phillip Webb
3b52909fc2 Don't change ownership of PID_FOLDER
Update the launch script so that it no longer changes ownership of the
PID_FOLDER.

Commit b24e736cfe had changed the chown
line from:
	chown "$run_user" "$PID_FOLDER/${identity}"
to:
	chown "$run_user" "$PID_FOLDER"

This meant that it was possible for the launch script to change
ownership of `/var/run` and prevent later processes from writing to
the folder.

Since PID_FOLDER is created before the chown statement, and that
the `checkPermissions` function runs to ensure that the PID file can
be written, it appears that the chown is not even required.

Fixes gh-6532
2016-09-16 14:35:21 -07:00
Andy Wilkinson
eb1c349f97 Polish “Avoid null handler package in JarFile protocol handler registration”
See gh-6759
2016-08-31 13:50:26 +01:00
hengyunabc
33a81e87d1 Avoid null handler package in JarFile protocol handler registration
Closes gh-6759
2016-08-31 13:44:41 +01:00
Phillip Webb
69e96c6211 Polish 2016-08-29 15:29:54 +01:00
Stephane Nicoll
97f15d606d Auto-detect fork value in stop goal
So far, one has to set the "fork" value to both the start and stop
goals. Since they have the same name, sharing them in a global
configuration element does the trick. However, the plugin also supports
auto-detection of the fork value according to other parameters:
typically if an agent or jvm arguments are set, forking will be
automatically enabled. This is a problem since the stop goal is not aware
of that.

This commit transmits the value in a property attached to the
`MavenProject`. That way, the stop goal can retrieve that value and
apply the same defaults. This has the side effect that specifying the
fork value isn't necessary anymore.

Closes gh-6747
2016-08-27 12:33:44 +02:00
Andy Wilkinson
85c0b44dcb Test that LaunchedURLClassLoader works when thread is interrupted
Previously, RandomAccessDataFile used a semaphore and acquired it
interruptibly. This meant that an interrupted thread was unable to
access the file. Notably, this would prevent LaunchedURLClassLoader from
loading classes or resources on an interrupted thread.

The previous commit (937f857) updates RandomAccessDataFile to acquire
the semaphore uninterruptibly. This commit adds a test to
LaunchedURLClassLoader to verify that it can now load a resource from
an interrupted thread.

Closes gh-6683
2016-08-18 12:03:05 +01:00
hengyunabc
937f85765c Ensure that LaunchedURLClassLoader works when thread is interrupted
See gh-6683
2016-08-18 11:59:45 +01:00
Andy Wilkinson
ae6182a964 Update requiresUnpack documentation of unpack location
The unpack location is (largely) an implementation detail and the
Repackage Mojo was the only place where it was explicity documented.
Rather than updating the outdated location, this commit removes it
entirely to avoid encouraging people to rely on the location.

Closes gh-6624
2016-08-12 12:07:47 +01:00
Spring Buildmaster
a89ef5df6e Next Development Version 2016-07-28 09:18:40 +00:00
Andy Wilkinson
4963cfd67b Reset thread's interrupted flag when catching InterruptedException
Closes gh-6360
2016-07-11 16:46:05 +01:00
Spring Buildmaster
2216369348 Next Development Version 2016-07-04 14:15:02 +00:00
Stephane Nicoll
17f8a244de Fix property names with successive capital letters
Previously, if a property name had successive capital letters, the
generated meta-data would clean it in such a way it is defined as a
regular word. For instance a `myFOO` property would be written as
`my-foo` in the meta-data.

It turns out this decision is wrong as the binder has no way to compute
back the name of the property and therefore `my-foo` wouldn't bind to
`setMyFOO` as it should.

This commit updates the meta-data name generation algorithm to properly
identify such cases: `myFOO` now translates to `my-f-o-o`. While the
generated name is a bit ugly, it now provides a consistent binding
experience.

Closes gh-5330
2016-06-27 12:02:34 +02:00
Andy Wilkinson
8d491f278b Create FilePermission lazily in JarURLConnection
JarURLConnection is very performance sensitive. The change in 3772d9f
meant that every JarURLConnection would create a FilePermission,
irrespective of whether it was actually used.

This commit updates JarURLConnection to create its FilePermission
lazily. When there is no security manager a permission will no longer
be created at all.

Closes gh-5411
See gh-6215
2016-06-24 11:49:35 +01:00
Stephane Nicoll
bffcb1aad2 Document available layouts
Closes gh-5524
2016-06-23 10:42:47 +02:00
Andy Wilkinson
ec7d6381aa Update RunMojo to fail when forked JVM returned non-zero exit code
Closes gh-6172
2016-06-16 11:34:15 +01:00
Andy Wilkinson
159ef8f189 Ensure that URL returned from ExplodedArchive.getURL() is encoded
Closes gh-5971
2016-06-15 20:47:29 +01:00
Andy Wilkinson
c808de0021 Allow custom repackage task to be used without a global main class
Closes gh-5956
2016-06-15 20:17:51 +01:00
Dave Syer
e4b544bd39 Create PID_FOLDER if it doesn't exist
In fact the folder was already created if the app is running as
a different user, but not if running as the current user, so it
was just a question of moving one line out of an if block.

Fixes gh-5986
2016-06-14 09:54:58 +01:00
Phillip Webb
f27bdcb737 Prevent APT crashes on older Java versions
Update TypeUtils to guard against the use of older Java versions.
Both `Collection` and `Map` type lookups now fallback to generic free
versions of the classes.

Prior to this commit using `xmlbeans-maven-plugin` in combination with
Spring Boot's annotation processor could result in
`IllegalArgumentException: Incorrect number of type arguments`.

Fixes gh-6122
2016-06-10 17:06:45 -07:00
Andy Wilkinson
3772d9f937 Update JarURLConnection to only require file read permission
Previously, JarURLConnection didn't override getPermission(). This
meant that it required all permissions. This was at odds with the
Oracle JVM's concrete sun.net.www.protocol.jar.JarURLConnection which
overrides getPermission to return a FilePermission with the read
action for the path of the underlying jar.

This commit updates our JarURLConnection to align its behaviour with
sun.net.www.protocol.jar.JarURLConnection.

Closes gh-5411
2016-06-01 15:33:36 +01:00
Andy Wilkinson
a98d1a41a4 Run Maven Plugin's integration tests when full profile is active
Closes gh-6036
2016-05-25 17:42:08 +01:00
Andy Wilkinson
4c65e5e704 Always handle quoted arguments correctly in the launch script
Previously, arguments passed to the script were handled in one way
if a service was being started using start-stop-daemon and in another
way if start-stop-daemon wasn’t available or the application is being
launched in run mode. This meant that quoted arguments were only 
handled correctly when the application was being started using
start-stop-daemon.

This commit updates the launch script so that argument handling is
the same across all three different way that the application can be
launched.

Closes gh-5942
2016-05-13 11:13:54 +01:00
Andy Wilkinson
e561cc1997 Don't use a separate thread in the launcher to call app's main method
Using a separate thread to call the application's main method is
unnecessary – the context class loader of the current thread can be
updated instead – and makes exception and exit code handling more
complicated than it needs to be.

This commit updates the Launcher so that it calls the main method
runner using the current (main) thread. As a result, any exception
that's thrown will be caught by the JVM and result in a non-zero exit
code being returned from the process.

Closes gh-5922
2016-05-12 16:57:16 +01:00
Phillip Webb
7fb545d26c Polish 2016-05-10 09:35:10 -07:00
Spring Buildmaster
819a9574a6 Next Development Version 2016-05-10 05:28:34 +00:00
Spring Buildmaster
376bbe68d8 Next Development Version 2016-05-06 11:23:57 +00:00
Stephane Nicoll
4ccc7dc554 Ignore invalid accessors
Previously, if a void method with a single argument was named "set", the
annotation processor wrongly considered it was a setter candidate. This
commit updates the condition to ignore it.

Closes gh-5826
2016-05-02 10:38:19 +02:00
Phillip Webb
af2483816b Fix JarFileTests to work on Windows
See gh-5287
2016-04-10 12:12:19 -07:00
Andy Wilkinson
74e27db486 Polish contribution 2016-04-06 17:04:10 +01:00
Vladimir Tsanev
a0f76eab47 Update JarURLConnection to support jar:file://… URLs
Previously, JarURLConnection would fail when created with a URL that
began with jar:file:// as the double-slash is not included in jarFile.getUrl().getFile().

This commit updates JarURLConnection to normalise the value return from
url.getFile() to remove a double-slash when present.

Fixes gh-5287
Closes gh-5289
2016-04-06 17:02:59 +01:00
Christian Brunotte
677080b8e2 Update launch.script so popd does not print directory name to stdout
Closes gh-5394
2016-04-06 11:46:36 +01:00
Phillip Webb
39140945b5 Polish 2016-03-29 21:45:11 -07:00
Andy Wilkinson
1043239de0 Ignore non-JavaExec run task when finding application's main class
Previously, FindMainClassTask would look for a property named main
on any class named run. This was based on the assumption that the
run task would be a JavaExec task (typically provided by the
application plugin). If the run task was not a JavaExec task (more
accurately, if it did not have a main property) this would result in
a build failure due to trying to read a non-existent property.

This commit updates FindMainClassTask to only use the main property
of the run task if the task is a JavaExec task. This guarantees that
the property will exist on the task, and unlike using any property
named main on a task named run, also guarantee that its value will
refer to a Java class with a main method.

Closes gh-5501
2016-03-29 11:03:47 +01:00
Phillip Webb
5e722dae6a Polish 2016-03-08 09:37:13 -08:00
Stephane Nicoll
a83dae0e10 Polish contribution
Closes gh-5335
2016-03-08 10:01:14 +01:00
Eric Bottard
79cd01eb7a Fix configuration property name when group is empty
See gh-5335
2016-03-08 09:48:26 +01:00
Stephane Nicoll
c6c001457a Fix description of classifier attribute
See gh-5258
2016-03-01 11:15:10 +01:00
Andy Wilkinson
bb473c32e2 Enable Animal Sniffer checking of spring-boot-loader-tools
Previously, Animal Sniffer checking of spring-boot-loader-tools
was disabled as it failed with an NPE. This has been fixed in
Animal Sniffer 1.15.

This commit upgrades Animal Sniffer to 1.15 and adds the necessary
annotations to suppress failures for safe usage of sun.* and Java 7
APIs.

Note that UsesUnsafeJava has been copied from spring-boot and made
package-private. This retains the clearer intent of the custom
annotation (versus @IgnoreJRERequirement) while avoiding the change
in the build order that would be necessary for
spring-boot-loader-tools to use the annotation from spring-boot.

Closes gh-5284
2016-02-29 14:44:27 +00:00
Spring Buildmaster
225d877ab9 Next Development Version 2016-02-26 01:06:16 -08:00
Spring Buildmaster
504d3e97ba Next development version 2016-01-21 18:41:30 -08:00
Phillip Webb
93c3b22bb4 Merge branch '1.2.x' 2016-01-21 11:14:20 -08:00
Phillip Webb
c71aa32fbb Polish 2016-01-21 10:53:25 -08:00