Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
a8ba80bb
Commit
a8ba80bb
authored
Mar 18, 2014
by
Dave Syer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add build.gradle samples and docs for deployable WAR
Fixes gh-518
parent
9f532b65
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
98 additions
and
1 deletion
+98
-1
build-tool-plugins.adoc
spring-boot-docs/src/main/asciidoc/build-tool-plugins.adoc
+54
-0
build.gradle
...g-boot-samples/spring-boot-sample-web-static/build.gradle
+43
-0
build.gradle
spring-boot-samples/spring-boot-sample-web-ui/build.gradle
+1
-1
No files found.
spring-boot-docs/src/main/asciidoc/build-tool-plugins.adoc
View file @
a8ba80bb
...
@@ -125,6 +125,31 @@ To build and run a project artifact, you can type the following:
...
@@ -125,6 +125,31 @@ To build and run a project artifact, you can type the following:
$
java
-
jar
target
/
mymodule
-
0.0.1
-
SNAPSHOT
.
jar
$
java
-
jar
target
/
mymodule
-
0.0.1
-
SNAPSHOT
.
jar
----
----
To
build
a
war
file
that
is
both
executable
and
deployable
into
an
external
container
you
need
to
mark
the
embedded
container
dependencies
as
"provided"
,
e
.
g
.
[
source
,
xml
,
indent
=
0
,
subs
=
"verbatim,attributes"
]
----
<?
xml
version
=
"1.0"
encoding
=
"UTF-8"
?>
<
project
xmlns
=
"http://maven.apache.org/POM/4.0.0"
xmlns
:
xsi
=
"http://www.w3.org/2001/XMLSchema-instance"
xsi
:
schemaLocation
=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<
!-- ... -->
<
packaging
>
war
</
packaging
>
<
!-- ... -->
<
dependencies
>
<
dependency
>
<
groupId
>
org
.
springframework
.
boot
</
groupId
>
<
artifactId
>
spring
-
boot
-
starter
-
web
</
artifactId
>
</
dependency
>
<
dependency
>
<
groupId
>
org
.
springframework
.
boot
</
groupId
>
<
artifactId
>
spring
-
boot
-
starter
-
tomcat
</
artifactId
>
<
scope
>
provided
</
scope
>
</
dependency
>
<
!-- ... -->
</
dependencies
>
</
project
>
----
[[
build
-
tool
-
plugins
-
maven
-
packaging
-
configuration
]]
[[
build
-
tool
-
plugins
-
maven
-
packaging
-
configuration
]]
...
@@ -347,6 +372,35 @@ To build and run a project artifact, you can type the following:
...
@@ -347,6 +372,35 @@ To build and run a project artifact, you can type the following:
$
java
-
jar
build
/
libs
/
mymodule
-
0.0.1
-
SNAPSHOT
.
jar
$
java
-
jar
build
/
libs
/
mymodule
-
0.0.1
-
SNAPSHOT
.
jar
----
----
To
build
a
war
file
that
is
both
executable
and
deployable
into
an
external
container
,
you
need
to
mark
the
embedded
container
dependencies
as
belonging
to
a
configuration
named
"providedRuntime"
,
e
.
g
.
[
source
,
groovy
,
indent
=
0
,
subs
=
"verbatim,attributes"
]
----
...
apply
plugin
:
'war'
war
{
baseName
=
'myapp'
version
=
'0.5.0'
}
repositories
{
mavenCentral
()
maven
{
url
"http://repo.spring.io/libs-snapshot"
}
}
configurations
{
providedRuntime
}
dependencies
{
compile
(
"org.springframework.boot:spring-boot-starter-web"
)
providedRuntime
(
"org.springframework.boot:spring-boot-starter-tomcat"
)
...
}
----
[[
build
-
tool
-
plugins
-
gradle
-
running
-
applications
]]
[[
build
-
tool
-
plugins
-
gradle
-
running
-
applications
]]
...
...
spring-boot-samples/spring-boot-sample-web-static/build.gradle
0 → 100644
View file @
a8ba80bb
buildscript
{
ext
{
springBootVersion
=
'1.0.0.BUILD-SNAPSHOT'
}
repositories
{
mavenLocal
()
maven
{
url
"http://repo.spring.io/libs-snapshot"
}
}
dependencies
{
classpath
(
"org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}"
)
}
}
apply
plugin:
'java'
apply
plugin:
'eclipse-wtp'
apply
plugin:
'idea'
apply
plugin:
'spring-boot'
apply
plugin:
'war'
mainClassName
=
"sample.ui.SampleWebStaticApplication"
war
{
baseName
=
'spring-boot-sample-web-static'
version
=
'0.5.0'
}
repositories
{
mavenCentral
()
maven
{
url
"http://repo.spring.io/libs-snapshot"
}
}
configurations
{
providedRuntime
}
dependencies
{
compile
(
"org.springframework.boot:spring-boot-starter-web"
)
providedRuntime
(
"org.springframework.boot:spring-boot-starter-tomcat"
)
testCompile
(
"org.springframework.boot:spring-boot-starter-test"
)
}
task
wrapper
(
type:
Wrapper
)
{
gradleVersion
=
'1.6'
}
spring-boot-samples/spring-boot-sample-web-ui/build.gradle
View file @
a8ba80bb
...
@@ -22,7 +22,7 @@ apply plugin: 'spring-boot'
...
@@ -22,7 +22,7 @@ apply plugin: 'spring-boot'
mainClassName
=
"sample.ui.SampleWebUiApplication"
mainClassName
=
"sample.ui.SampleWebUiApplication"
jar
{
jar
{
baseName
=
'spring-boot-sample-
simple
'
baseName
=
'spring-boot-sample-
web-ui
'
version
=
'0.5.0'
version
=
'0.5.0'
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment