public class JkDependencySet extends java.lang.Object implements java.lang.Iterable<JkScopedDependency>, java.io.Serializable
JkScopedDependency
generally standing for the entire
dependencies of a project/module.Modifier and Type | Method and Description |
---|---|
JkDependencySet |
and(java.lang.Iterable<JkScopedDependency> others)
Returns a clone of this object plus the specified
JkScopedDependency s. |
JkDependencySet |
and(JkArtifactProducer artifactProducer,
JkScope... scopes)
Creates a
JkDependencySet to the specified artifact producer |
JkDependencySet |
and(JkArtifactProducer artifactProducer,
java.util.List<JkArtifactId> artifactFileIds,
JkScope... scopes)
Creates a
JkDependencySet to the specified artifact producer |
JkDependencySet |
and(JkDependency dependency,
JkScope... scopes)
Returns a clone of this object plus the specified scoped dependencies.
|
JkDependencySet |
and(JkModuleDependency dependency,
JkScopeMapping scopeMapping)
Returns a clone of this object plus the specified scoped dependencies.
|
JkDependencySet |
and(JkModuleId moduleId,
JkScope... scopes) |
JkDependencySet |
and(JkModuleId moduleId,
java.lang.String version,
JkScope... scopes) |
JkDependencySet |
and(JkModuleId moduleId,
java.lang.String version,
JkScopeMapping scopeMapping) |
JkDependencySet |
and(JkScopedDependency... others)
Returns a clone of this object plus the specified scoped dependencies.
|
JkDependencySet |
and(java.lang.String moduleDescription,
JkScope... scopes) |
JkDependencySet |
and(java.lang.String moduleDescription,
JkScopeMapping scopeMapping) |
JkDependencySet |
and(java.util.function.Supplier<JkArtifactProducer> artifactProducerSupplier,
JkArtifactId artifactFileIds,
JkScope... scopes)
Creates a
JkDependencySet to the specified artifact producer supplier |
JkDependencySet |
and(java.util.function.Supplier<JkArtifactProducer> artifactProducerSupplier,
JkScope... scopes)
Creates a
JkDependencySet to the specified artifact producer supplier |
JkDependencySet |
and(java.util.function.Supplier<JkArtifactProducer> artifactProducerSupplier,
java.util.List<JkArtifactId> artifactFileIds,
JkScope... scopes)
Creates a
JkDependencySet to the specified artifact producer supplier |
JkDependencySet |
andFile(java.nio.file.Path file,
JkScope... scopes)
If specified path is relative, JkDependencyResolver will resolve it upon its base dir.
|
JkDependencySet |
andFile(java.lang.String path,
JkScope... scopes) |
JkDependencySet |
andFiles(java.lang.Iterable<java.nio.file.Path> files,
JkScope... scopes) |
JkDependencySet |
andScopelessDependencies(java.lang.Iterable<? extends JkDependency> dependencies) |
JkDependencySet |
andVersionProvider(JkVersionProvider versionProvider)
Returns a clone of this object but using specified version provider to override
versions of transitive dependencies.
|
JkDependencySet |
assertNoUnspecifiedVersion()
Throws a
IllegalStateException if one of the module
dependencies has an unspecified projectVersion. |
JkScopedDependency |
get(JkModuleId moduleId)
Returns the
JkScopedDependency declared for the specified
JkModuleId . |
java.util.Set<JkScope> |
getDeclaredScopes()
Returns the set of scopes involved in these dependencies.
|
java.util.Set<JkDependency> |
getDependenciesDeclaredWith(JkScope scope)
Returns the set of
JkDependency involved for the specified
JkScope . |
java.util.Set<JkDepExclude> |
getGlobalExclusions()
Returns the dependencies to be excluded to the transitive chain when using this dependency.
|
java.util.Set<JkScope> |
getInvolvedScopes()
Returns all scopes that are involved in these dependencies.
|
JkVersion |
getVersion(JkModuleId moduleId) |
JkVersionProvider |
getVersionProvider()
Returns overridden versions for transitive dependencies.
|
boolean |
hasDynamicAndResolvableVersions()
Returns
true if this object contains dependency on external
module whose rely on dynamic version that are resolvable (Maven Snapshot
versions are dynamic but not resolvable). |
boolean |
hasDynamicVersions()
Returns
true if this object contains dependency on external
module whose rely on dynamic version. |
boolean |
hasModules()
Returns
true if this object contains dependencies whose are
JkModuleDependency . |
java.util.Iterator<JkScopedDependency> |
iterator() |
JkDependencySet |
minus(JkModuleId jkModuleId)
Returns a dependency set identical to this one minus the dependencies on the given
JkModuleId . |
static JkDependencySet |
of() |
static JkDependencySet |
of(java.lang.Iterable<JkScopedDependency> scopedDependencies)
Creates a
JkDependencySet to the specified scoped dependencies. |
static JkDependencySet |
of(java.lang.String dependencyDesc,
JkScope... scopes) |
static JkDependencySet |
ofLocal(java.nio.file.Path baseDir)
Creates a
JkDependencySet based on jars located under the specified directory. |
static JkDependencySet |
ofTextDescription(java.nio.file.Path path) |
static JkDependencySet |
ofTextDescription(java.lang.String description)
Creates a dependencySet from a flat file formatted as :
|
static JkDependencySet |
ofTextDescription(java.net.URL url) |
java.lang.String |
toJavaCode(int indentCount)
Returns the java codes that declare these dependencies.
|
java.util.List<JkScopedDependency> |
toList()
Returns the unmodifiable list list of scoped dependencies for this object.
|
JkDependencySet |
toResolvedModuleVersions() |
java.lang.String |
toString() |
JkDependencySet |
withDefaultScope(JkScopeMapping scopeMapping)
Returns a clone of this dependencies but replacing the unscoped
dependencies with the specified scope mapping.
|
JkDependencySet |
withDefaultScopes(JkScope... scopes)
Returns a clone of this dependencies but replacing the unscoped
dependencies with the specified ones.
|
JkDependencySet |
withGlobalExclusion(JkDepExclude exclude) |
JkDependencySet |
withLocalExclusion(JkDepExclude exclusion)
Returns a clone of this dependencySet but adding dependency exclusion on the the last element.
|
JkDependencySet |
withLocalExclusion(JkModuleId fromModule,
JkDepExclude exclude)
Returns a set a dependency set identical to this one but excluding the specified exclude
from the transitive dependencies of the specified module.
|
JkDependencySet |
withLocalExclusions(java.lang.String... groupAndNames) |
JkDependencySet |
withModulesOnly()
Returns all dependencies declared as
JkModuleDependency . |
JkDependencySet |
withoutLastIf(boolean condition)
Returns a clone of this dependencySet but removing the last element if the specified condition is met.
|
JkDependencySet |
withVersionProvider(JkVersionProvider versionProvider)
Returns a clone of this object but using specified version provider to override
versions of transitive dependencies.
|
public static JkDependencySet of(java.lang.String dependencyDesc, JkScope... scopes)
public static JkDependencySet of()
public static JkDependencySet of(java.lang.Iterable<JkScopedDependency> scopedDependencies)
JkDependencySet
to the specified scoped dependencies.public static JkDependencySet ofLocal(java.nio.file.Path baseDir)
JkDependencySet
based on jars located under the specified directory. Jars are
supposed to lie in a directory structure standing for the different scopes they are intended.
So jars needed for compilation are supposed to be in baseDir/compile
, jar needed for
test are supposed to be in baseDir/test
and so on.public java.util.List<JkScopedDependency> toList()
public JkVersion getVersion(JkModuleId moduleId)
public JkDependencySet and(java.lang.Iterable<JkScopedDependency> others)
JkScopedDependency
s.public JkDependencySet and(JkScopedDependency... others)
public JkDependencySet and(JkDependency dependency, JkScope... scopes)
public JkDependencySet and(JkModuleDependency dependency, JkScopeMapping scopeMapping)
public JkDependencySet and(JkArtifactProducer artifactProducer, java.util.List<JkArtifactId> artifactFileIds, JkScope... scopes)
JkDependencySet
to the specified artifact producerpublic JkDependencySet and(JkArtifactProducer artifactProducer, JkScope... scopes)
JkDependencySet
to the specified artifact producerpublic JkDependencySet and(java.util.function.Supplier<JkArtifactProducer> artifactProducerSupplier, java.util.List<JkArtifactId> artifactFileIds, JkScope... scopes)
JkDependencySet
to the specified artifact producer supplierpublic JkDependencySet and(java.util.function.Supplier<JkArtifactProducer> artifactProducerSupplier, JkArtifactId artifactFileIds, JkScope... scopes)
JkDependencySet
to the specified artifact producer supplierpublic JkDependencySet and(java.util.function.Supplier<JkArtifactProducer> artifactProducerSupplier, JkScope... scopes)
JkDependencySet
to the specified artifact producer supplierpublic JkDependencySet and(java.lang.String moduleDescription, JkScope... scopes)
public JkDependencySet and(java.lang.String moduleDescription, JkScopeMapping scopeMapping)
public JkDependencySet and(JkModuleId moduleId, java.lang.String version, JkScope... scopes)
public JkDependencySet and(JkModuleId moduleId, JkScope... scopes)
public JkDependencySet and(JkModuleId moduleId, java.lang.String version, JkScopeMapping scopeMapping)
public JkDependencySet andFiles(java.lang.Iterable<java.nio.file.Path> files, JkScope... scopes)
public JkDependencySet andFile(java.lang.String path, JkScope... scopes)
public JkDependencySet andFile(java.nio.file.Path file, JkScope... scopes)
public JkDependencySet andScopelessDependencies(java.lang.Iterable<? extends JkDependency> dependencies)
public JkDependencySet minus(JkModuleId jkModuleId)
JkModuleId
. This is used to exclude a given module to all scope.public JkDependencySet withoutLastIf(boolean condition)
public JkDependencySet withLocalExclusion(JkDepExclude exclusion)
public JkDependencySet withLocalExclusions(java.lang.String... groupAndNames)
groupAndNames
- moduleIds to exclude (e.g. "a.group:a.name", "another.group:another.name", ...).public JkDependencySet withDefaultScopes(JkScope... scopes)
public JkDependencySet withDefaultScope(JkScopeMapping scopeMapping)
public JkDependencySet withVersionProvider(JkVersionProvider versionProvider)
public JkDependencySet andVersionProvider(JkVersionProvider versionProvider)
public boolean hasModules()
true
if this object contains dependencies whose are
JkModuleDependency
.public java.util.Iterator<JkScopedDependency> iterator()
iterator
in interface java.lang.Iterable<JkScopedDependency>
public java.util.Set<JkDepExclude> getGlobalExclusions()
public JkVersionProvider getVersionProvider()
public java.lang.String toString()
toString
in class java.lang.Object
public java.util.Set<JkDependency> getDependenciesDeclaredWith(JkScope scope)
JkDependency
involved for the specified
JkScope
.public JkScopedDependency get(JkModuleId moduleId)
JkScopedDependency
declared for the specified
JkModuleId
. Returns null
if no dependency on this
module exists in this object.public java.util.Set<JkScope> getDeclaredScopes()
public java.util.Set<JkScope> getInvolvedScopes()
public boolean hasDynamicVersions()
true
if this object contains dependency on external
module whose rely on dynamic version. It can be either dynamic version as
"1.3.+", "[1.0, 2.0[" ,... or snapshot version as defined in Maven (as
"1.0-SNAPSHOT).public boolean hasDynamicAndResolvableVersions()
true
if this object contains dependency on external
module whose rely on dynamic version that are resolvable (Maven Snapshot
versions are dynamic but not resolvable). It only stands for dynamic
versions as "1.3.+", "[1.0, 2.0[" ,... If so, when resolving, dynamic
versions are replaced by fixed resolved ones.public JkDependencySet withGlobalExclusion(JkDepExclude exclude)
public JkDependencySet withLocalExclusion(JkModuleId fromModule, JkDepExclude exclude)
public JkDependencySet assertNoUnspecifiedVersion()
IllegalStateException
if one of the module
dependencies has an unspecified projectVersion.public JkDependencySet toResolvedModuleVersions()
public java.lang.String toJavaCode(int indentCount)
public JkDependencySet withModulesOnly()
JkModuleDependency
.public static JkDependencySet ofTextDescription(java.nio.file.Path path)
ofTextDescription(String)
public static JkDependencySet ofTextDescription(java.net.URL url)
ofTextDescription(String)
public static JkDependencySet ofTextDescription(java.lang.String description)
- COMPILE RUNTIME org.springframework.boot:spring-boot-starter-thymeleaf org.springframework.boot:spring-boot-starter-data-jpa - RUNTIME com.h2database:h2 org.liquibase:liquibase-core com.oracle:ojdbc6:12.1.0 - TEST org.springframework.boot:spring-boot-starter-test org.seleniumhq.selenium:selenium-chrome-driver:3.4.0 org.fluentlenium:fluentlenium-assertj:3.2.0 org.fluentlenium:fluentlenium-junit:3.2.0 - PROVIDED org.projectlombok:lombok:1.16.16