Commit Graph

546 Commits

Author SHA1 Message Date
Phillip Webb
aae38db9af Fix compiler warnings only shown in Eclipse Mars 2015-10-07 23:40:28 -07:00
Phillip Webb
c9fb9916b8 Reformat code using Eclipse Mars 2015-10-07 23:37:10 -07:00
Phillip Webb
e473364e4e Merge branch '1.2.x' 2015-10-07 23:34:08 -07:00
Phillip Webb
6ab376e2e8 Reformat code use Eclipse Mars 2015-10-07 23:32:31 -07:00
Phillip Webb
47576354f7 Merge branch '1.2.x' 2015-10-07 23:19:50 -07:00
Phillip Webb
ba7c1fda72 Convert Gradle plugin from Groovy to Java
Replace existing Groovy code with Java since the Groovy Eclipse tooling
currently forces the use of an old jdt plugin which has formatter bugs.

Fixes gh-4113
2015-10-07 23:12:25 -07:00
Thomas Raehalme
3865f3b303 Allow launch script to be used by accounts that use /sbin/nologin
Closes gh-3852
Closes gh-3906
2015-10-05 11:08:52 +01:00
Andy Wilkinson
051ebf3fac Polishing: fix a number of compiler warnings reported by Eclipse 2015-09-22 13:30:07 +01:00
Andy Wilkinson
94a737638e Update launch script to specify -jar as last option
The recommended usage for the java executable is:

    java [-options] -jar jarfile [args...]

This commit updates the default launch script to match this recommended
usage by moving -jar to be the last option, after both the
disableJarChecking system property and any JAVA_OPTS.

Closes gh-3930
2015-09-21 14:51:03 +01:00
Spring Buildmaster
9409c49c10 Next development version 2015-09-16 09:00:17 -07:00
Phillip Webb
269815dbcf Make LaunchedURLClassLoader constructor public
Restore the public constructor in LaunchedURLClassLoader which was
accidentally removed in commit e07df7e4c6.
2015-09-09 09:20:34 -07:00
Phillip Webb
e674d751de Polish Javadoc 2015-09-08 17:01:36 -07:00
Phillip Webb
e07df7e4c6 Remove redundant modifiers 2015-09-08 17:01:30 -07:00
Phillip Webb
460ca75fce Polish newline at end of file 2015-09-08 16:05:22 -07:00
Phillip Webb
d09805fd75 Polish license headers 2015-09-08 16:05:05 -07:00
Phillip Webb
6e29ee4557 Polish 2015-09-08 16:04:30 -07:00
Phillip Webb
67402405db Reformat code 2015-09-08 14:56:40 -07:00
Phillip Webb
2615990ffb Organize imports 2015-09-08 14:40:35 -07:00
Phillip Webb
0335053139 Merge branch '1.2.x' 2015-09-08 14:37:16 -07:00
Phillip Webb
15686ed4fd Reformat code 2015-09-08 14:07:06 -07:00
Phillip Webb
0f6b60d8c8 Organize imports 2015-09-08 14:05:00 -07:00
Phillip Webb
690da89c82 Fix warnings 2015-09-05 00:21:09 -07:00
Ilayaperumal Gopinathan
61ac04aa4c Make it easier to subclass Launchers
Change constructors from `package private` to `protected` for subclasses
to use.

Closes gh-3741
2015-09-03 14:40:23 -07:00
Phillip Webb
4aa2fed48b Revert "configure JRE that is different from compiler target level"
This reverts commit 678f36cfef.
2015-09-02 23:44:27 -07:00
Dave Syer
9dec0971d6 Change restart to fail if not running 2015-08-27 07:30:00 +01:00
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
2015-08-26 17:54:20 +01:00
Stephane Nicoll
35875c7f08 Merge manual item meta-data
Previously, manual meta-data were added to the existing set of entries
which could lead to duplicates if a manual entry is meant to complement
a property that is detected via the processor.

We now match the name and type of the item against the auto-detected
entries. If no match is found, we add the extra entry as we did before.
If a match is found we override the description, default value and
deprecation information.

Closes gh-3562
2015-08-20 17:08:54 +02:00
Martin Lippert
678f36cfef configure JRE that is different from compiler target level 2015-08-19 17:00:38 +01:00
Martin Lippert
511c6d39fa Replace ignore with lifecycle mapping to smooth import into Eclipse
Closes gh-3516
2015-08-13 13:24:15 +01:00
Stephane Nicoll
3763eda64e Merge branch '1.2.x' 2015-08-10 16:36:11 +02:00
Stephane Nicoll
1ee31e73d3 Avoid NPE if @ConfigurationProperties is not present
The annotation processor detects `@ConfigurationProperties` bean or
method definition and merges manual meta-data. The former step will fail
with a NPE if the annotation is not present on the classpath. This could
happen if the annotation processor is added to a module that is not
actually using Spring Boot.

We now have a defensive check that skips that steps but still attempts to
merge manual meta-data if present.

Closes gh-3720
2015-08-10 16:34:30 +02:00
Dave Syer
25ac258d22 Clarify plugin documentation for requiresUnpack 2015-08-10 12:52:00 +01:00
Phillip Webb
891dd5a0f6 Polish 2015-08-03 11:03:48 -07:00
Andy Wilkinson
4660a3ed4d Merge branch '1.2.x' 2015-08-03 15:50:26 +01:00
Andy Wilkinson
d241171fff Use fast exceptions in hasMoreElements in LaunchedURLClassLoader
When nested jars are being used, hasMoreElements requires opening a
connection for an entry in every nested jar. If that entry doesn't
exist, a FileNotFoundException is thrown to indicate that a particular
jar doesn't contain the requested entry. This exception is used to
indicate the lack of an entry and is then swallowed, i.e. its stack
trace is of no importance. This means that the performance of
hasMoreElements can be improved by switching on fast exceptions while
it's being called. When fast exceptions are switched on a general
purpose pre-initialized FileNotFoundException is thrown rather than
creating a new FileNotFoundException instance each time.

In certain situations, the use of fast exceptions as described above
can improve performance fairly significantly. The JRE's default SAAJ
implementation uses META-INF/services-based discovery for _every_
request that's handled by Spring Web Services. Each discovery attempt
results in hasMoreElements being called making its performance
critical to throughput.

See gh-3640
2015-08-03 15:39:56 +01:00
Stephane Nicoll
bc0487f791 Polish
Make sure that the meta-data can be serialized.
2015-07-29 14:01:21 +02:00
arghya88
64c6e5b403 Fix typo
Closes gh-3610
2015-07-28 10:39:10 +02:00
arghya88
9de4fd7913 Fix typo
Closes gh-3606
2015-07-27 15:30:48 +02:00
Stephane Nicoll
057824aca7 Fix maven plugin configuration
Closes gh-3601
2015-07-27 08:18:09 +02:00
Stephane Nicoll
94405455dd Fix maven plugin configuration
Closes gh-3601
2015-07-26 09:09:43 +02:00
Stephane Nicoll
e033daed0f Use standard name for main thread
DevTools look for a main thread named "main". The maven plugin is
actually using a different value and there is no real reason to. This
change fixes DevTools support as long as forking is enabled.

See gh-3315
2015-07-24 10:36:14 +02:00
Stephane Nicoll
42e230192f Polish 2015-07-24 07:19:53 +02:00
Stephane Nicoll
e9a6245a44 Remove unnecessary System.out 2015-07-22 16:59:53 +02:00
Stephane Nicoll
178c690d37 Fix meta-data root attributes ordering 2015-07-22 16:59:25 +02:00
Andy Wilkinson
434f528e0a Fix Gradle plugin task dependencies broken by removal of app plugin
8673250 updated the plugin so that the application plugin is no longer
applied by default. This exposed three problems:

 1. bootRepackage may run before findMainClass has run, leaving it with
    an unknown main class.
 2. findMainClass may run before the classes have been built, making it
    unable to find the main class by examining the class files
 3. The project's mainClassName property was still being used as a
    convention for the bootRun task's main property. If the application
    plugin has not be applied, then this property does not exist.

The first problem has been addressed by configuring bootRepackage to
depend on findMainClass.

The second problem has been addressed by configuring the main source
set's output as an input of findMainClass, and configuring findMainClass
to depend on the tasks that build the output.

The third problem has been addressed by only using the mainClassName
property if it exists and its value is not null. We then fallback to
using the mainClassName property on the project's extra properties in
the same way. 

See gh-2679
2015-07-22 13:47:29 +01:00
Andy Wilkinson
8673250955 Make use of Gradle's application plugin optional when using Boot plugin
Previously, the Spring Boot Gradle plugin would always apply the
application plugin to a project. It then piggy-backed on the application
plugin’s mainClassName and applicationDefaultJvmArgs properties for the
configuration of the bootRun task.

This commit updates the Spring Boot Gradle plugin so that it no longer
applies the application plugin. If the user applies the application
plugin then its configuration will be used, but it’s a no longer
requirement.

Users who do not need the application plugin, but who were using the
mainClassName or applicationDefaultJvmArgs properties will need to
change their builds as a result of this change as those properties will
no longer exist. As before, the mainClassName can be configured on the
springBoot extension:

springBoot {
	mainClassName 'com.example.YourApplication'
}

The applicationDefaultJvmArgs property can be used, but it must now be
declared with the project's ext block. For example:

ext {
	applicationDefaultJvmArgs = [ '-Dcom.example.property=true' ]
}

Closes gh-2679
2015-07-22 11:38:15 +01:00
Phillip Webb
e9d252e05c Add @DeprecatedConfigurationProperties annotation
Add a new @DeprecatedConfigurationProperties annotation which can be
used by the `ConfigurationMetadataAnnotationProcessor` to generating
meta-data deprecated blocks.

Fixes gh-3543
2015-07-17 14:14:37 -07:00
Phillip Webb
728e64b929 Polish 2015-07-16 12:56:49 -07:00
izeye
f4589e7cc3 Fix typos
Closes gh-3504
2015-07-15 15:45:02 +02:00
Stephane Nicoll
f2d32d3e98 Add support for property deprecation
Previously, an item could only have a 'deprecated' boolean flag to
indicate that the property is deprecated. It is desirable to provide an
additional description for the deprecation as well as the name of the
property to use instead.

The `deprecated` boolean flag is now supported. Instead, a `deprecated`
object can be specified with two optional attributes: `reason` to provide
an explanation for the deprecation and `replacement` to refer to the
property that should be used instead. If none of them is present, an
empty deprecation object should be set.

For backward compatibility, the `deprecated` field is still set.

Deprecation information can only set via manual meta-data.

Closes gh-3449
2015-07-15 15:41:52 +02:00