spring-projects / gradle-plugins Goto Github PK
View Code? Open in Web Editor NEWGradle plugins for use in building and publishing open-source Spring projects, e.g. Spring Framework, Spring Integration
License: Apache License 2.0
Gradle plugins for use in building and publishing open-source Spring projects, e.g. Spring Framework, Spring Integration
License: Apache License 2.0
With Grails 3.0.9, I'm getting this error doing 'grails war':
Failed to apply plugin [id 'propdeps']
Cannot add a configuration with name 'provided' as a configuration with that name already exists.
I have a base build that applies a dependency as provided to subprojects. one subproject tries to override it by putting the same dependency into compile. But in Intellij, the module shows up provided, and its transitive dependency compile.
I tried this plugin with Gradle 2.3 or 2.4, used snippets from readme - and it fails as follows:
...
* What went wrong:
A problem occurred evaluating root project 'gradle-provided'.
> Cannot change configuration ':provided' after it has been resolved.
It took me quite a long time to figure out that you already fixed this in 0.0.7, but 0.0.6 is referenced in the snippet. At least I learned something when messing around this.
I saw this problem you had solve at stackoverflow. I add propdeps-plugin at build file but it doesn't work for me. The version of my idea is 2017.1 and gradle is 3.5.1(the original version that I used is 4.0).
I upgraded the Spring Framework build on master from Gradle 1.12 to 2.0, and I get the following error:
FAILURE: Build failed with an exception.
Where:
Build file '/spring-framework/build.gradle' line: 296What went wrong:
A problem occurred evaluating root project 'spring'.You can't change configuration 'optional' because it is already resolved!
The line in question uses optional
:
optional("commons-codec:commons-codec:1.9")
Where is spring-boot-gradle-plugin ?
in https://github.com/szjug/monolith project spring-boot-gradle-plugin conflict with shadow plugin
D:\Workspaces\GitHub\monolith>gradle :shadow:shadowJar
FAILURE: Build failed with an exception.
* What went wrong:
Could not resolve all dependencies for configuration ':shadow:runtime'.
> Could not find org.springframework.boot:spring-boot-starter-data-mongodb:.
Searched in the following locations:
https://jcenter.bintray.com/org/springframework/boot/spring-boot-starter-data-mongodb//spring-boot-starter-data-mongodb-.pom
https://jcenter.bintray.com/org/springframework/boot/spring-boot-starter-data-mongodb//spring-boot-starter-data-mongodb-.jar
Required by:
monolith:shadow:1.0 > monolith:io.github.szjug.greeting:1.0
monolith:shadow:1.0 > monolith:io.github.szjug.who:1.0
> Could not find org.springframework.boot:spring-boot-starter-web:.
Searched in the following locations:
https://jcenter.bintray.com/org/springframework/boot/spring-boot-starter-web//spring-boot-starter-web-.pom
https://jcenter.bintray.com/org/springframework/boot/spring-boot-starter-web//spring-boot-starter-web-.jar
Required by:
monolith:shadow:1.0 > monolith:io.github.szjug.greeting:1.0
monolith:shadow:1.0 > monolith:io.github.szjug.who:1.0
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 10.006 secs
Note this has implications on which versions of Gradle the PropDepsPlugin will work with.
The ConfigurationContainer.add() method has been deprecated and is scheduled to be removed in Gradle 2.0. Please use the create() method instead.
org.gradle.util.SingleMessageLogger.logTraceIfNecessary(SingleMessageLogger.java:183)
org.gradle.util.SingleMessageLogger.nagUserWith(SingleMessageLogger.java:140)
org.gradle.util.SingleMessageLogger.nagUserOfReplacedMethod(SingleMessageLogger.java:102)
org.gradle.api.internal.artifacts.configurations.DefaultConfigurationContainer.add(DefaultConfigurationContainer.java:73)
org.gradle.api.artifacts.ConfigurationContainer$add.call(Unknown Source)
org.springframework.build.gradle.propdep.PropDepsPlugin.addConfiguration(PropDepsPlugin.groovy:56)```
Note that updating to use create has implications on which versions of Gradle are supported
The TaskContainer.add() method has been deprecated and is scheduled to be removed in Gradle 2.0. Please use the create() method instead.
org.gradle.util.SingleMessageLogger.logTraceIfNecessary(SingleMessageLogger.java:183)
org.gradle.util.SingleMessageLogger.nagUserWith(SingleMessageLogger.java:140)
org.gradle.util.SingleMessageLogger.nagUserOfReplacedMethod(SingleMessageLogger.java:102)
org.gradle.api.internal.tasks.DefaultTaskContainer.add(DefaultTaskContainer.java:90)
org.gradle.api.tasks.TaskContainer$add.call(Unknown Source)
DocbookReferencePlugin.apply(DocbookReferencePlugin.groovy:46)
DocbookReferencePlugin.apply(DocbookReferencePlugin.groovy)
org.gradle.api.internal.plugins.DefaultPluginContainer.providePlugin(DefaultPluginContainer.java:107)```
We are using the propdeps plugin for our builds and found out that it changed behaviour between 0.0.5 and 0.0.6, which breaks our expectations. We are doing work in the hadoop world, where you want the hadoop dependencies to be provided. hadoop compliant jars are typically build like this:
jar {
description = "Assembles a Hadoop ready jar file"
doFirst {
into( 'lib' ) {
from configurations.compile
}
}
}
Given the simple build.gradle below, it works as expected, since it will put the provided dependency only into provided scope and our jar will only contain the libs in compile scope.
buildscript {
repositories {
maven { url 'http://repo.spring.io/plugins-release' }
}
dependencies {
classpath 'org.springframework.build.gradle:propdeps-plugin:0.0.5'
}
}
apply plugin: 'java'
configure( allprojects ) {
apply plugin: 'propdeps'
apply plugin: 'propdeps-maven'
apply plugin: 'propdeps-idea'
apply plugin: 'propdeps-eclipse'
}
dependencies{
provided group: 'com.google.guava', name: 'guava', version: '17.0'
}
jar {
description = "Assembles a Hadoop ready jar file"
doFirst {
into( 'lib' ) {
from configurations.compile
}
}
}
gradle dependencies -q
------------------------------------------------------------
Root project
------------------------------------------------------------
archives - Configuration for archive artifacts.
No dependencies
compile - Compile classpath for source set 'main'.
No dependencies
default - Configuration for default artifacts.
No dependencies
optional
No dependencies
provided
\--- com.google.guava:guava:17.0
runtime - Runtime classpath for source set 'main'.
No dependencies
testCompile - Compile classpath for source set 'test'.
No dependencies
testRuntime - Runtime classpath for source set 'test'.
\--- com.google.guava:guava:17.0
Switching to 0.0.6 or 0.0.7 I get this:
gradle dependencies -q
------------------------------------------------------------
Root project
------------------------------------------------------------
archives - Configuration for archive artifacts.
No dependencies
compile - Compile classpath for source set 'main'.
\--- com.google.guava:guava:17.0
default - Configuration for default artifacts.
No dependencies
optional
No dependencies
provided
\--- com.google.guava:guava:17.0
runtime - Runtime classpath for source set 'main'.
\--- com.google.guava:guava:17.0
testCompile - Compile classpath for source set 'test'.
\--- com.google.guava:guava:17.0
testRuntime - Runtime classpath for source set 'test'.
\--- com.google.guava:guava:17.0
Since the provided jars are now in compile scope, the plugin breaks completely for our use case, since we are back to square one in having the provided jars in the hadoop jar.
Am I doing something wrong? Is there another way to do this?
This also holds us back of using gradle 2.0, since only 0.0.7 of the propdeps-plugin is compatible with that.
To make this a bit more search friendly I have updated the issue below. The error that is received when updating to Gradle 2.0-rc1 is:
* What went wrong:
A problem occurred evaluating script.
> You can't change a configuration which is not in unresolved state!
* Try:
Run with --info or --debug option to get more log output.
* Exception is:
org.gradle.api.GradleScriptException: A problem occurred evaluating script.
at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:54)
at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl.apply(DefaultScriptPluginFactory.java:187)
at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.applyScript(DefaultObjectConfigurationAction.java:98)
at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.access$000(DefaultObjectConfigurationAction.java:36)
at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction$1.run(DefaultObjectConfigurationAction.java:67)
at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.execute(DefaultObjectConfigurationAction.java:130)
at org.gradle.api.internal.project.AbstractPluginAware.apply(AbstractPluginAware.java:41)
at org.gradle.api.Project$apply$0.call(Unknown Source)
at org.gradle.api.internal.project.ProjectScript.apply(ProjectScript.groovy:34)
at org.gradle.api.Script$apply$0.callCurrent(Unknown Source)
at build_29dsf73kscqo0adl8fnun3s3j1.run([..]lilith/build.gradle:2)
at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:52)
at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl.apply(DefaultScriptPluginFactory.java:187)
at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildScriptProcessor.java:39)
at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildScriptProcessor.java:26)
at org.gradle.configuration.project.ConfigureActionsProjectEvaluator.evaluate(ConfigureActionsProjectEvaluator.java:34)
at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:55)
at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:470)
at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:79)
at org.gradle.configuration.DefaultBuildConfigurer.configure(DefaultBuildConfigurer.java:31)
at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:128)
at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:105)
at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:85)
at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:81)
at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:33)
at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:24)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:39)
at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:45)
at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:34)
at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:35)
at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:24)
at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
at org.gradle.launcher.daemon.server.exec.StartStopIfBuildAndStop.execute(StartStopIfBuildAndStop.java:33)
at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
at org.gradle.launcher.daemon.server.exec.ReturnResult.execute(ReturnResult.java:34)
at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:71)
at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:69)
at org.gradle.util.Swapper.swap(Swapper.java:38)
at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:69)
at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:60)
at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:34)
at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:60)
at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:34)
at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:45)
at org.gradle.launcher.daemon.server.DaemonStateCoordinator.runCommand(DaemonStateCoordinator.java:184)
at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy.doBuild(StartBuildOrRespondWithBusy.java:49)
at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:34)
at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
at org.gradle.launcher.daemon.server.exec.HandleStop.execute(HandleStop.java:30)
at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
at org.gradle.launcher.daemon.server.exec.DaemonHygieneAction.execute(DaemonHygieneAction.java:39)
at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
at org.gradle.launcher.daemon.server.exec.CatchAndForwardDaemonFailure.execute(CatchAndForwardDaemonFailure.java:32)
at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
at org.gradle.launcher.daemon.server.exec.DefaultDaemonCommandExecuter.executeCommand(DefaultDaemonCommandExecuter.java:51)
at org.gradle.launcher.daemon.server.DefaultIncomingConnectionHandler$ConnectionWorker.handleCommand(DefaultIncomingConnectionHandler.java:155)
at org.gradle.launcher.daemon.server.DefaultIncomingConnectionHandler$ConnectionWorker.receiveAndHandleCommand(DefaultIncomingConnectionHandler.java:128)
at org.gradle.launcher.daemon.server.DefaultIncomingConnectionHandler$ConnectionWorker.run(DefaultIncomingConnectionHandler.java:116)
at org.gradle.internal.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$1.run(DefaultExecutorFactory.java:64)
Caused by: org.gradle.api.InvalidUserDataException: You can't change a configuration which is not in unresolved state!
at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.throwExceptionIfNotInUnresolvedState(DefaultConfiguration.java:386)
at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.access$400(DefaultConfiguration.java:43)
at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$VetoContainerChangeAction.run(DefaultConfiguration.java:486)
at org.gradle.api.internal.DefaultDomainObjectCollection.assertMutable(DefaultDomainObjectCollection.java:258)
at org.gradle.api.internal.DefaultDomainObjectCollection.add(DefaultDomainObjectCollection.java:158)
at org.gradle.api.internal.DelegatingDomainObjectSet.add(DelegatingDomainObjectSet.java:80)
at org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.doAdd(DefaultDependencyHandler.java:81)
at org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.methodMissing(DefaultDependencyHandler.java:116)
at org.gradle.api.internal.BeanDynamicObject$MetaClassAdapter.invokeMethod(BeanDynamicObject.java:225)
at org.gradle.api.internal.BeanDynamicObject.invokeMethod(BeanDynamicObject.java:129)
at org.gradle.api.internal.CompositeDynamicObject.invokeMethod(CompositeDynamicObject.java:163)
at org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler_Decorated.invokeMethod(Unknown Source)
at projectDependencies_4p3jv26t0a1d550m57ci3l3vu2$_run_closure26_closure67.doCall([..]lilith/projectDependencies.gradle:299)
at org.gradle.api.internal.ClosureBackedAction.execute(ClosureBackedAction.java:59)
at org.gradle.util.ConfigureUtil.configure(ConfigureUtil.java:130)
at org.gradle.util.ConfigureUtil.configure(ConfigureUtil.java:91)
at org.gradle.api.internal.project.AbstractProject.dependencies(AbstractProject.java:804)
at projectDependencies_4p3jv26t0a1d550m57ci3l3vu2$_run_closure26.doCall([..]lilith/projectDependencies.gradle:297)
at org.gradle.api.internal.ClosureBackedAction.execute(ClosureBackedAction.java:59)
at org.gradle.util.ConfigureUtil.configure(ConfigureUtil.java:130)
at org.gradle.util.ConfigureUtil.configure(ConfigureUtil.java:91)
at org.gradle.api.internal.project.AbstractProject.project(AbstractProject.java:781)
at org.gradle.api.internal.BeanDynamicObject$MetaClassAdapter.invokeMethod(BeanDynamicObject.java:225)
at org.gradle.api.internal.BeanDynamicObject.invokeMethod(BeanDynamicObject.java:129)
at org.gradle.api.internal.CompositeDynamicObject.invokeMethod(CompositeDynamicObject.java:147)
at org.gradle.groovy.scripts.BasicScript.methodMissing(BasicScript.java:79)
at projectDependencies_4p3jv26t0a1d550m57ci3l3vu2.run([..]lilith/projectDependencies.gradle:288)
at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:52)
... 64 more
The error is due to GRADLE-784 which is due to GROOVY-6018. This can be worked around by wrapping the configuration in a collection as illustrated on the Gradle 2.0-rc1 announcement comments. So instead of:
scopes.PROVIDED.plus += project.configurations.provided
scopes.PROVIDED.plus += project.configurations.optional
we can use:
scopes.PROVIDED.plus += [project.configurations.provided]
scopes.PROVIDED.plus += [project.configurations.optional]
See http://forums.gradle.org/gradle/topics/gradle_2_0_rc_1_is_now_available_for_testing#reply_14380685 for a proposed solution.
maven declares the <optional>
tag on a dependency to be a boolean(<optional>true/false</optional>
), but the propdeps plugin instead creates an optional dependency as <scope>optional</scope>
in the pom. I would expect the output of this to be something like:
<scope>compile</scope>
<optional>true</optional>
since it's optional, the actual <scope>
tag value doesn't really matter, but I think compile would make sense most of the time.
I'm using gradle 2.1 and propdeps 0.0.7
see the maven document: http://maven.apache.org/guides/introduction/introduction-to-optional-and-excludes-dependencies.html
The plugin checks that a given JDK7_HOME
or JDK8_HOME
exists, but it doesn't actually use the JDK to run the tests; as far as I can tell the default JDK is still used. To illustrate this, I did the following:
$ mkdir ~/fakeJdk/bin
$ touch ~/fakeJdk/bin/java
$ ./gradlew clean springioCheck -PJDK7_HOME=/Users/awilkinson/fakeJdk
I would expect the springioJDK7Test
task to fail as it's being run with a bogus java executable but it ran successfully
Versions:
To reproduce: first, declare we want to use this plugin as per the doc, ie:
configure(allprojects) {
apply(plugin: "propdeps");
apply(plugin: "propdeps-maven");
apply(plugin: "propdeps-idea");
apply(plugin: "propdeps-eclipse");
}
Second, write a main()
(even empty) within a class in a folder declared as a source folder, which has a compile-time dependency.
Then try and execute that main()
: fails with a NoClassDefFoundError
on one of the compile-time dependencies of this class.
Note:
provided
or optional
;It looks like the runtime classpath which IDEA uses for running mains in a source folder is completely emptied of compile time dependencies as soon as we use this plugin...
The propdeps-plugin is missing from http://plugins.gradle.org/
Please fix :)
As detailed in the Gradle 4.0 Release Notes there are a few deprecations
Using the attached demo project you receive the following warning:
Gradle now uses separate output directories for each JVM language, but this build assumes a single directory for all classes from a source set. This behaviour has been deprecated and is scheduled to be removed in Gradle 5.0
This plugin doesn't work with the maven-publish plugin, e.g. when publishToMavenLocal
is used the generated POM file still contains any optional dependencies. It also doesn't work with the Bintray plugin.
I understand that this plugin can't modify behaviour of other plugins, but it would at least be nice to have this documented.
Using the plugin with spring-ws (which uses Gradle 1.12) results in a failure when Gradle tries to cache the springioIncompleteExcludesCheck
task. This is because org.gradle.api.internal.artifacts.configurations.DefaultConfiguration_Decorated
is not Serializable
and IncompleteExcludesTasks
has an @Input
of type Collection<Configuration>
.
I think it's the changes in cc3be37 that have shaken this loose as IncompleteExcludesTasks
will now always have something stored in that input. If a user of the plugin had configured the task with custom configurations I believe we would have seen the same problem.
There's an open issue to add support for Configuration
@Input
s to Gradle. Until that's implemented we need an alternative.
I am trying to use this plugin on the gradle project. It works and builds fine but when I import it into the IntelliJ project the "provided" dependencies are not added to the project and I end up having compile errors.
Could not resolve all dependencies for configuration ':classpath'.
Could not download gradle-sonarqube-plugin.jar (org.sonarqube.gradle:gradle-sonarqube-plugin:1.1)
Could not get resource 'https://plugins.gradle.org/m2/org/sonarqube/gradle/gradle-sonarqube-plugin/1.1/gradle-sonarqube-plugin-1.1.jar'.
> Could not GET 'https://plugins.gradle.org/m2/org/sonarqube/gradle/gradle-sonarqube-plugin/1.1/gradle-sonarqube-plugin-1.1.jar'.
> Connect to gradleware-plugins.s3.amazonaws.com:443 [gradleware-plugins.s3.amazonaws.com/54.231.48.152] failed: Connection timed out: connect
The plugin should be updated to consume the versions that are published by the Platform. This will allow the same version of the plugin to be used to test for compliance with different versions of the Platform
Gradle 2.12 introduced its own built-in compileOnly dependency scope. At an initial glance, this appears to be doing the same thing as "provided" properties in propdeps-plugin. Does "provided" still need to exist in propdeps-plugin?
The versions are currently consumed from a file with one artifact per line, with each line having the form group:artifact:version
. Update the plugin to consume the versions from a properties file as published by the Platform. Each line will become group\:artifact=version
or similar (note the escaping of the first :
).
We need to looked for java.exe when the plugin's running on Windows
https://github.com/spring-projects/gradle-plugins/tree/master/propdeps-plugin doesn't handle transitive = false, see http://forums.gradle.org/gradle/topics/how_can_i_exclude_all_transitive_dependencies
I can confirm the same by having the same issue in my project.
The plugin currently writes Spring IO in all lower case with no spaces, i.e. springio
. Should we change it to springIo
?
cc @rwinch
When I'm using propdeps-maven, mapping of another custom configuration doesn't work well.
Something like below should do the job:
configurations {
pu
compile.extendsFrom pu
}
project.conf2ScopeMappings.addMapping(310, configurations.pu, 'compile')
However the last line Maven of PropDepsMavenPlugin.apply()
method breaks something. Mapping is not propagated to both project.install.repositories.mavenInstaller.pom.scopeMappings
and uploadArchives.repositories.mavenDeployer.pom.scopeMappings
which results with generated pom without dependencies for my custom configuration.
It's enough to add, that commenting line apply plugin: 'propdeps-maven'
fixes issues. Not sure is it a bug in gradle itself or some missusage of gradle API on the plugin side.
Two things worth of noticing:
In the following example there are also a few tasks added. Just run gradle pI dI map
to see de differences between mappings which should be all the same. Speaking of my case (not the example below) output for the installer and deployer are the same including hashcode, but both are wrong as they are missing pu scope. In the example below only installer is missing pu scope.
buildscript {
repositories {
mavenCentral()
maven { url 'http://repo.spring.io/plugins-release' }
}
dependencies {
classpath 'org.springframework.build.gradle:propdeps-plugin:0.0.7'
}
}
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'propdeps'
apply plugin: 'propdeps-maven'
configurations {
pu
compile.extendsFrom pu
}
group = 'test'
version = 0.1
project.conf2ScopeMappings.addMapping(310, configurations.pu, 'compile')
uploadArchives {
repositories {
mavenDeployer {
repository(url: 'file://localhost/c:/ubs/dev/work/tmp/m2')
}
}
}
dependencies {
compile 'org.codehaus.groovy:groovy-all:2.3.6'
runtime 'org.mongodb:mongo-java-driver:2.12.4'
provided 'javax.servlet:javax.servlet-api:3.1.0'
pu 'joda-time:joda-time:2.3'
testCompile 'org.spockframework:spock-core:0.7-groovy-2.0'
}
task pomInstaller << {
println '\nINSTALLER'
printlnScope2ConfMapping(install.repositories.mavenInstaller.pom.scopeMappings)
}
task pomDeployer << {
println '\nDEPLOYER'
printlnScope2ConfMapping(uploadArchives.repositories.mavenDeployer.pom.scopeMappings)
}
task mappings << {
println '\nMAPPINGS'
printlnScope2ConfMapping(conf2ScopeMappings)
}
void printlnScope2ConfMapping(def conf2ScopeMappings) {
println '-' * 50
conf2ScopeMappings.mappings.each {
println "\t$it.key.name - $it.value.configuration.name, $it.value.scope, $it.value.priority"
}
println '\nhashcode:' + conf2ScopeMappings.hashCode() + '\n\n'
}
I don't know if this is already supported and I do something wrong or it is just not implemented, but it would useful to enhance war plugin to not package dependencies with scope provided.
Hi,
Using gradle 2.2 (and i'm not sure if this is why I'm getting the error),
The entry into my gradle build file is returning the Plugin with id 'propdeps' not found.
when gradle is run.
buildscript {
repositories {
maven {url artifactoryUrl}
maven {url artifactoryPluginUrl }
}
dependencies {
classpath 'org.springframework.build.gradle:propdeps-plugin:0.0.7'
}
}
apply plugin: 'propdeps'
apply plugin: 'propdeps-maven'
apply plugin: 'propdeps-idea'
apply plugin: 'propdeps-eclipse'
The artifactory has the jar file for 0.0.7 and it is also in my local .gradle/caches/modules-2
directory so I can't work out why gradle can't find the plugin.
Currently the only idea I have is its something to do with gradle 2.2 and the new plugin dsl even though I'm not using the new dsl.
The message that's output when the build fails should point the user to the plugin's README. The README should tell the user what to do about the missing dependency. Typically the correct course of action will be to open an issue against the Platform. The typical outcome will either be the use of a different dependency or an addition to the Platform.
When running tests using the plugin they will sometimes fail due to a different version of a dependency being used. We should allow users of the plugin to override specific versions to help to narrow down which version change is causing the problem. This could either be done via a property on the command line (e.g. -Porg.springframework:spring-core=4.0.3.RELEASE
) or via configuration in the build script
The desciption says:
You can declare more than one dependency in the springIoVersions configuration. In the event of a version being declared in more than one of the dependencies the last declaration wins.
But if we have this configuration:
dependencies {
springIoVersions 'io.spring.platform:platform-versions:1.0.0.BUILD-SNAPSHOT@properties'
springIoVersions files('custom-versions.properties')
}
The artifact dependency always wins.
The logic comes from org.gradle.api.internal.artifacts.ivyservice.SelfResolvingDependencyResolver.FilesAggregatingResolvedConfiguration
:
public Set<File> getFiles(Spec<? super Dependency> dependencySpec) {
Set<File> files = new LinkedHashSet<File>();
files.addAll(selfResolvingFilesProvider.getFiles(dependencySpec));
files.addAll(resolvedConfiguration.getFiles(dependencySpec));
return files;
}
And it dooesn't matter which order for springIoVersions
we have.
There is need to change AbstractPlatformDependenciesBeforeResolveAction#createSelectors
logic to get deal with correct dependencies order.
When a guide does not contain Parts <part/>
the table of contents does not have the correct font-sizes.
Why are all deps from optional and provided excluded from the default configuration? This causes inter project dependencies not to pick up those. Example:
project(':impl') {
dependencies {
compile project(':api')
}
}
This is the normal way to define inter project dependencies. I would expect that if ':api' defines dependencies in provided scope that they are also propagated to ':impl'. However, they won't.
A work-around is to explicitly reference the compile scope like here:
project(':impl') {
dependencies {
compile project(path: ':api', configuration: 'compile')
}
}
But I like to know why you exclude provided deps from the default configuration in the first place.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.