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
f2812afb
Commit
f2812afb
authored
Oct 01, 2014
by
Andy Wilkinson
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '1.1.x'
parents
c601c09e
bcd4c8ee
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
67 additions
and
11 deletions
+67
-11
MultiProjectRepackagingTests.java
...ngframework/boot/gradle/MultiProjectRepackagingTests.java
+19
-11
build.gradle
...sources/multi-project-common-file-dependency/build.gradle
+28
-0
settings.gradle
...rces/multi-project-common-file-dependency/settings.gradle
+3
-0
build.gradle
...ces/multi-project-transitive-file-dependency/build.gradle
+0
-0
foo.jar
...lti-project-transitive-file-dependency/common/lib/foo.jar
+0
-0
settings.gradle
.../multi-project-transitive-file-dependency/settings.gradle
+0
-0
ProjectLibraries.java
...ringframework/boot/gradle/repackage/ProjectLibraries.java
+17
-0
No files found.
spring-boot-integration-tests/src/test/java/org/springframework/boot/gradle/MultiProjectRepackagingTests.java
View file @
f2812afb
...
@@ -17,11 +17,9 @@
...
@@ -17,11 +17,9 @@
package
org
.
springframework
.
boot
.
gradle
;
package
org
.
springframework
.
boot
.
gradle
;
import
java.io.File
;
import
java.io.File
;
import
java.io.IOException
;
import
java.util.jar.JarFile
;
import
java.util.jar.JarFile
;
import
org.gradle.tooling.ProjectConnection
;
import
org.gradle.tooling.ProjectConnection
;
import
org.junit.BeforeClass
;
import
org.junit.Test
;
import
org.junit.Test
;
import
org.springframework.boot.dependency.tools.ManagedDependencies
;
import
org.springframework.boot.dependency.tools.ManagedDependencies
;
...
@@ -38,21 +36,31 @@ public class MultiProjectRepackagingTests {
...
@@ -38,21 +36,31 @@ public class MultiProjectRepackagingTests {
private
static
final
String
BOOT_VERSION
=
ManagedDependencies
.
get
()
private
static
final
String
BOOT_VERSION
=
ManagedDependencies
.
get
()
.
find
(
"spring-boot"
).
getVersion
();
.
find
(
"spring-boot"
).
getVersion
();
private
static
ProjectConnection
project
;
@BeforeClass
public
static
void
createProject
()
throws
IOException
{
project
=
new
ProjectCreator
().
createProject
(
"multi-project-repackage"
);
}
@Test
@Test
public
void
repackageWithTransitiveFileDependency
()
throws
Exception
{
public
void
repackageWithTransitiveFileDependency
()
throws
Exception
{
ProjectConnection
project
=
new
ProjectCreator
()
.
createProject
(
"multi-project-transitive-file-dependency"
);
project
.
newBuild
().
forTasks
(
"clean"
,
"build"
)
project
.
newBuild
().
forTasks
(
"clean"
,
"build"
)
.
withArguments
(
"-PbootVersion="
+
BOOT_VERSION
,
"-Prepackage=true"
).
run
();
.
withArguments
(
"-PbootVersion="
+
BOOT_VERSION
).
run
();
File
buildLibs
=
new
File
(
"target/multi-project-repackage/main/build/libs"
);
File
buildLibs
=
new
File
(
"target/multi-project-transitive-file-dependency/main/build/libs"
);
JarFile
jarFile
=
new
JarFile
(
new
File
(
buildLibs
,
"main.jar"
));
JarFile
jarFile
=
new
JarFile
(
new
File
(
buildLibs
,
"main.jar"
));
assertThat
(
jarFile
.
getEntry
(
"lib/commons-logging-1.1.3.jar"
),
notNullValue
());
assertThat
(
jarFile
.
getEntry
(
"lib/commons-logging-1.1.3.jar"
),
notNullValue
());
assertThat
(
jarFile
.
getEntry
(
"lib/foo.jar"
),
notNullValue
());
assertThat
(
jarFile
.
getEntry
(
"lib/foo.jar"
),
notNullValue
());
jarFile
.
close
();
jarFile
.
close
();
}
}
@Test
public
void
repackageWithCommonFileDependency
()
throws
Exception
{
ProjectConnection
project
=
new
ProjectCreator
()
.
createProject
(
"multi-project-common-file-dependency"
);
project
.
newBuild
().
forTasks
(
"clean"
,
"build"
)
.
withArguments
(
"-PbootVersion="
+
BOOT_VERSION
).
run
();
File
buildLibs
=
new
File
(
"target/multi-project-common-file-dependency/build/libs"
);
JarFile
jarFile
=
new
JarFile
(
new
File
(
buildLibs
,
"multi-project-common-file-dependency.jar"
));
assertThat
(
jarFile
.
getEntry
(
"lib/foo.jar"
),
notNullValue
());
jarFile
.
close
();
}
}
}
spring-boot-integration-tests/src/test/resources/multi-project-common-file-dependency/build.gradle
0 → 100644
View file @
f2812afb
buildscript
{
repositories
{
mavenLocal
()
}
dependencies
{
classpath
"org.springframework.boot:spring-boot-gradle-plugin:${project.bootVersion}"
}
}
subprojects
{
apply
plugin:
'java'
dependencies
{
compile
rootProject
.
files
{
'lib/foo.jar'
}
}
}
apply
plugin:
'spring-boot'
springBoot
{
mainClass
=
'foo.bar.Baz'
}
dependencies
{
compile
project
(
':one'
)
compile
project
(
':two'
)
}
spring-boot-integration-tests/src/test/resources/multi-project-common-file-dependency/settings.gradle
0 → 100644
View file @
f2812afb
include
'one'
include
'two'
\ No newline at end of file
spring-boot-integration-tests/src/test/resources/multi-project-
repackage
/build.gradle
→
spring-boot-integration-tests/src/test/resources/multi-project-
transitive-file-dependency
/build.gradle
View file @
f2812afb
File moved
spring-boot-integration-tests/src/test/resources/multi-project-
repackage
/common/lib/foo.jar
→
spring-boot-integration-tests/src/test/resources/multi-project-
transitive-file-dependency
/common/lib/foo.jar
View file @
f2812afb
File moved
spring-boot-integration-tests/src/test/resources/multi-project-
repackage
/settings.gradle
→
spring-boot-integration-tests/src/test/resources/multi-project-
transitive-file-dependency
/settings.gradle
View file @
f2812afb
File moved
spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/repackage/ProjectLibraries.java
View file @
f2812afb
...
@@ -199,6 +199,23 @@ class ProjectLibraries implements Libraries {
...
@@ -199,6 +199,23 @@ class ProjectLibraries implements Libraries {
return
name
;
return
name
;
}
}
@Override
public
int
hashCode
()
{
return
getFile
().
hashCode
();
}
@Override
public
boolean
equals
(
Object
obj
)
{
if
(
obj
instanceof
GradleLibrary
)
{
return
getFile
().
equals
(((
GradleLibrary
)
obj
).
getFile
());
}
return
false
;
}
@Override
public
String
toString
()
{
return
getFile
().
getAbsolutePath
();
}
}
}
/**
/**
...
...
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