Git Product home page Git Product logo

gradle-plugins's Introduction

This repository is not no longer maintained.

Pivotal Gradle Plugins

A variety of Gradle plugins developed and used by Pivotal. See README.md files within sub-modules for details.

gradle-plugins's People

Contributors

bclozel avatar cbeams avatar cwensel avatar fabriciocolombo avatar garyrussell avatar ghillert avatar philwebb avatar pniederw avatar poutsma avatar rwinch avatar spring-builds avatar sslavic avatar stephanheinze avatar trevormarshall avatar watsoncj avatar wilkinsona avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gradle-plugins's Issues

PropDepsPlugin uses deprecated ConfigurationContainer.add()

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)```

IO Plugin custom `springIoVersions` from file

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.

Inter project dependencies do not work with default configuration

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.

Allow versions to be overridden

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

Consume versions from an external source

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

DocbookReferencePlugin uses deprecated TaskContainer.add()

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)```

Specified JDK is not used to run the tests

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

Can't map custom scope when 'propdeps-maven' used

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:

  1. I tried cooking simple example to recreate the issue (copy-pasted at the bottom). In the simple example only installer mapping doesn't contain my custom scope. However in the real, multi-module project, I'm currently working with, both installer and deployer mappings are affected. I'm not able to recreate deployer mappings issue for the sake of example though.
  2. Calling pom {}.writeTo('file.xml') always shows correct pom with all necessary dependencies even though pom deployed with uploadArchives is missing my mapped dependencies.

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'
}

Gradle 4.0 Support

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

propdeps-plugin doesn't work with maven-publish and other plugins

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.

Plugin fails with spring-ws as DefaultConfiguration_Decorated isn't serializable

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 @Inputs to Gradle. Until that's implemented we need an alternative.

Using propdeps-plugin with IDEA 13.x causes NoClassDefFoundError on dependencies

Versions:

  • gradle 1.10;
  • IDEA 13.0.2;
  • propdeps-plugin 0.0.5.

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:

  • to clarify the above, if the class in question has no dependency whatsoever on any compile-time dependency, execution succeeds;
  • it does not fail if the class in question is in a test source folder!
  • you do not need to declare any dependency as provided or optional;
  • happens also with gradle 1.11, IDEA 13.1 EAP;
  • does not prevent compilation to succeed.

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...

Not compatible with IntelliJ idea gradle integration

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.

propdeps-plugin appears to be incompatible with Gradle 2.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: 296

  • What 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")

Plugin with id 'propdeps' not found.

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.

propdeps-plugin optional scope creates invalid pom

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

"You can't change a configuration which is not in unresolved state!" when using propdeps and Gradle 2.0-rc-1

Updated Description

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]

Original Description

See http://forums.gradle.org/gradle/topics/gradle_2_0_rc_1_is_now_available_for_testing#reply_14380685 for a proposed solution.

Gradle 2.x fails when examples from README are used

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.

gradle cleanIdea eclipse ERROE

Where is spring-boot-gradle-plugin ?

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     

ref johnrengelman/shadow#199

propdeps plugin puts dependencies into compile configuration breaking expectations

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.

Consume versions in properties format

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 :).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.