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
3523bca7
Commit
3523bca7
authored
Dec 09, 2014
by
Phillip Webb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polish
parent
f49d3518
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
54 deletions
+47
-54
AetherGrapeEngine.java
...gframework/boot/cli/compiler/grape/AetherGrapeEngine.java
+47
-48
ProjectLibraries.java
...ringframework/boot/gradle/repackage/ProjectLibraries.java
+0
-4
Repackager.java
...ava/org/springframework/boot/loader/tools/Repackager.java
+0
-2
No files found.
spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/grape/AetherGrapeEngine.java
View file @
3523bca7
...
...
@@ -23,7 +23,6 @@ import java.io.File;
import
java.net.MalformedURLException
;
import
java.net.URI
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Collection
;
import
java.util.Collections
;
import
java.util.List
;
...
...
@@ -55,8 +54,12 @@ import org.eclipse.aether.util.filter.DependencyFilterUtils;
@SuppressWarnings
(
"rawtypes"
)
public
class
AetherGrapeEngine
implements
GrapeEngine
{
private
static
final
Collection
<
Exclusion
>
WILDCARD_EXCLUSION
=
Arrays
.
asList
(
new
Exclusion
(
"*"
,
"*"
,
"*"
,
"*"
));
private
static
final
Collection
<
Exclusion
>
WILDCARD_EXCLUSION
;
static
{
List
<
Exclusion
>
exclusions
=
new
ArrayList
<
Exclusion
>();
exclusions
.
add
(
new
Exclusion
(
"*"
,
"*"
,
"*"
,
"*"
));
WILDCARD_EXCLUSION
=
Collections
.
unmodifiableList
(
exclusions
);
}
private
final
DependencyResolutionContext
resolutionContext
;
...
...
@@ -79,7 +82,6 @@ public class AetherGrapeEngine implements GrapeEngine {
this
.
repositorySystem
=
repositorySystem
;
this
.
session
=
repositorySystemSession
;
this
.
resolutionContext
=
resolutionContext
;
this
.
repositories
=
new
ArrayList
<
RemoteRepository
>();
List
<
RemoteRepository
>
remotes
=
new
ArrayList
<
RemoteRepository
>(
remoteRepositories
);
...
...
@@ -87,7 +89,6 @@ public class AetherGrapeEngine implements GrapeEngine {
for
(
RemoteRepository
repository
:
remotes
)
{
addRepository
(
repository
);
}
this
.
progressReporter
=
getProgressReporter
(
this
.
session
);
}
...
...
@@ -95,9 +96,7 @@ public class AetherGrapeEngine implements GrapeEngine {
if
(
Boolean
.
getBoolean
(
"groovy.grape.report.downloads"
))
{
return
new
DetailedProgressReporter
(
session
,
System
.
out
);
}
else
{
return
new
SummaryProgressReporter
(
session
,
System
.
out
);
}
return
new
SummaryProgressReporter
(
session
,
System
.
out
);
}
@Override
...
...
@@ -161,9 +160,7 @@ public class AetherGrapeEngine implements GrapeEngine {
if
(
isTransitive
(
dependencyMap
))
{
return
new
Dependency
(
artifact
,
JavaScopes
.
COMPILE
,
false
,
exclusions
);
}
else
{
return
new
Dependency
(
artifact
,
JavaScopes
.
COMPILE
,
null
,
WILDCARD_EXCLUSION
);
}
return
new
Dependency
(
artifact
,
JavaScopes
.
COMPILE
,
null
,
WILDCARD_EXCLUSION
);
}
private
Artifact
createArtifact
(
Map
<?,
?>
dependencyMap
)
{
...
...
@@ -172,14 +169,12 @@ public class AetherGrapeEngine implements GrapeEngine {
String
version
=
(
String
)
dependencyMap
.
get
(
"version"
);
String
classifier
=
(
String
)
dependencyMap
.
get
(
"classifier"
);
String
type
=
determineType
(
dependencyMap
);
return
new
DefaultArtifact
(
group
,
module
,
classifier
,
type
,
version
);
}
private
String
determineType
(
Map
<?,
?>
dependencyMap
)
{
String
type
=
(
String
)
dependencyMap
.
get
(
"type"
);
String
ext
=
(
String
)
dependencyMap
.
get
(
"ext"
);
if
(
type
==
null
)
{
type
=
ext
;
if
(
type
==
null
)
{
...
...
@@ -198,35 +193,6 @@ public class AetherGrapeEngine implements GrapeEngine {
return
(
transitive
==
null
?
true
:
transitive
);
}
private
List
<
File
>
resolve
(
List
<
Dependency
>
dependencies
)
throws
ArtifactResolutionException
{
try
{
CollectRequest
collectRequest
=
new
CollectRequest
((
Dependency
)
null
,
dependencies
,
new
ArrayList
<
RemoteRepository
>(
this
.
repositories
));
collectRequest
.
setManagedDependencies
(
this
.
resolutionContext
.
getManagedDependencies
());
DependencyRequest
dependencyRequest
=
new
DependencyRequest
(
collectRequest
,
DependencyFilterUtils
.
classpathFilter
(
JavaScopes
.
COMPILE
,
JavaScopes
.
RUNTIME
));
DependencyResult
dependencyResult
=
this
.
repositorySystem
.
resolveDependencies
(
this
.
session
,
dependencyRequest
);
this
.
resolutionContext
.
getManagedDependencies
().
addAll
(
getDependencies
(
dependencyResult
));
return
getFiles
(
dependencyResult
);
}
catch
(
Exception
ex
)
{
throw
new
DependencyResolutionFailedException
(
ex
);
}
finally
{
this
.
progressReporter
.
finished
();
}
}
private
List
<
Dependency
>
getDependencies
(
DependencyResult
dependencyResult
)
{
List
<
Dependency
>
dependencies
=
new
ArrayList
<
Dependency
>();
for
(
ArtifactResult
artifactResult
:
dependencyResult
.
getArtifactResults
())
{
...
...
@@ -263,11 +229,9 @@ public class AetherGrapeEngine implements GrapeEngine {
if
(
this
.
repositories
.
contains
(
repository
))
{
return
;
}
repository
=
getPossibleMirror
(
repository
);
repository
=
applyProxy
(
repository
);
repository
=
applyAuthentication
(
repository
);
this
.
repositories
.
add
(
0
,
repository
);
}
...
...
@@ -277,7 +241,6 @@ public class AetherGrapeEngine implements GrapeEngine {
if
(
mirror
!=
null
)
{
return
mirror
;
}
return
remoteRepository
;
}
...
...
@@ -314,7 +277,6 @@ public class AetherGrapeEngine implements GrapeEngine {
public
URI
[]
resolve
(
Map
args
,
List
depsInfo
,
Map
...
dependencyMaps
)
{
List
<
Exclusion
>
exclusions
=
createExclusions
(
args
);
List
<
Dependency
>
dependencies
=
createDependencies
(
dependencyMaps
,
exclusions
);
try
{
List
<
File
>
files
=
resolve
(
dependencies
);
List
<
URI
>
uris
=
new
ArrayList
<
URI
>(
files
.
size
());
...
...
@@ -323,11 +285,48 @@ public class AetherGrapeEngine implements GrapeEngine {
}
return
uris
.
toArray
(
new
URI
[
uris
.
size
()]);
}
catch
(
Exception
e
)
{
throw
new
DependencyResolutionFailedException
(
e
);
catch
(
Exception
ex
)
{
throw
new
DependencyResolutionFailedException
(
ex
);
}
}
private
List
<
File
>
resolve
(
List
<
Dependency
>
dependencies
)
throws
ArtifactResolutionException
{
try
{
CollectRequest
collectRequest
=
getCollectRequest
(
dependencies
);
DependencyRequest
dependencyRequest
=
getDependencyRequest
(
collectRequest
);
DependencyResult
result
=
this
.
repositorySystem
.
resolveDependencies
(
this
.
session
,
dependencyRequest
);
addManagedDependencies
(
result
);
return
getFiles
(
result
);
}
catch
(
Exception
ex
)
{
throw
new
DependencyResolutionFailedException
(
ex
);
}
finally
{
this
.
progressReporter
.
finished
();
}
}
private
CollectRequest
getCollectRequest
(
List
<
Dependency
>
dependencies
)
{
CollectRequest
collectRequest
=
new
CollectRequest
((
Dependency
)
null
,
dependencies
,
new
ArrayList
<
RemoteRepository
>(
this
.
repositories
));
collectRequest
.
setManagedDependencies
(
this
.
resolutionContext
.
getManagedDependencies
());
return
collectRequest
;
}
private
DependencyRequest
getDependencyRequest
(
CollectRequest
collectRequest
)
{
DependencyRequest
dependencyRequest
=
new
DependencyRequest
(
collectRequest
,
DependencyFilterUtils
.
classpathFilter
(
JavaScopes
.
COMPILE
,
JavaScopes
.
RUNTIME
));
return
dependencyRequest
;
}
private
void
addManagedDependencies
(
DependencyResult
result
)
{
this
.
resolutionContext
.
getManagedDependencies
().
addAll
(
getDependencies
(
result
));
}
@Override
public
Map
[]
listDependencies
(
ClassLoader
classLoader
)
{
throw
new
UnsupportedOperationException
(
"Listing dependencies is not supported"
);
...
...
spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/repackage/ProjectLibraries.java
View file @
3523bca7
...
...
@@ -82,17 +82,14 @@ class ProjectLibraries implements Libraries {
}
else
{
Set
<
GradleLibrary
>
compile
=
getLibraries
(
"compile"
,
LibraryScope
.
COMPILE
);
Set
<
GradleLibrary
>
runtime
=
getLibraries
(
"runtime"
,
LibraryScope
.
RUNTIME
);
runtime
=
minus
(
runtime
,
compile
);
Set
<
GradleLibrary
>
provided
=
getLibraries
(
this
.
providedConfigurationName
,
LibraryScope
.
PROVIDED
);
if
(
provided
!=
null
)
{
compile
=
minus
(
compile
,
provided
);
runtime
=
minus
(
runtime
,
provided
);
}
libraries
(
compile
,
callback
);
libraries
(
runtime
,
callback
);
libraries
(
provided
,
callback
);
...
...
@@ -111,7 +108,6 @@ class ProjectLibraries implements Libraries {
libraries
.
add
(
new
ResolvedArtifactLibrary
(
artifact
,
scope
));
}
libraries
.
addAll
(
getLibrariesForFileDependencies
(
configuration
,
scope
));
return
libraries
;
}
...
...
spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/Repackager.java
View file @
3523bca7
...
...
@@ -241,10 +241,8 @@ public class Repackager {
else
if
(
startClass
!=
null
)
{
manifest
.
getMainAttributes
().
putValue
(
MAIN_CLASS_ATTRIBUTE
,
startClass
);
}
String
bootVersion
=
getClass
().
getPackage
().
getImplementationVersion
();
manifest
.
getMainAttributes
().
putValue
(
BOOT_VERSION_ATTRIBUTE
,
bootVersion
);
return
manifest
;
}
...
...
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