Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8126379
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T07:07:40+00:00 2026-06-06T07:07:40+00:00

I have a dependencies section in my master build.gradle file subprojects { dependencies {

  • 0

I have a dependencies section in my master build.gradle file

subprojects {
   dependencies {
   }
}

Then I add one to my subproject as only that one is using two local dependencies and that breaks everything with the failure below

dependencies {
    compile fileTree(dir: 'play-1.2.4/framework/lib', include: '*.jar')
    compile fileTree(dir: 'play-1.2.4/framework', include: '*.jar')
}

You can’t change a configuration which is not in unresolved state!

googling this error yields lots of results but I can’t seem to decipher from them how to fix this?

NOTE: This did work if I injected the dependencies instead….why is that?

project(':webserver') {
    dependencies {
        compile fileTree(dir: 'play-1.2.4/framework/lib', include: '*.jar')
        compile fileTree(dir: 'play-1.2.4/framework', include: '*.jar')
    }
}

ONE IMPORTANT NOTE: I am not sure if it matters, by my actual master build.gradle is ONE LINE that imports the following one (as I could not get the “master” folder to work out). could that be the problem?

FULL master build.gradle file

allprojects {
    apply plugin: 'java'
    apply plugin: 'eclipse'

    buildDir = 'output'

    task hello << { task -> println "I'm $task.project.name" }
    build << { task -> println "MASTER: I'm building now classpath=$sourceSets.main.compileClasspath.files" }
}

subprojects {

    version = 'Developer-Build'
    project.ext.genLibDir = file('lib')
    project.ext.fixedLibDir = file('libother')

    repositories {
         mavenCentral()
    }

    //configurations.compile {
    //  exclude group: 'javax.jms',        module: 'jms'
    //  exclude group: 'com.sun.jdmk',     module: 'jmxtools'
    //  exclude group: 'com.sun.jmx',      module: 'jmxri'
    //}

    dependencies {
        compile group: 'org.hibernate',   name: 'hibernate-entitymanager', version: '4.1.4.Final'
        compile group: 'org.slf4j',       name: 'slf4j-api',               version: '1.6.6'
        compile group: 'org.slf4j',       name: 'log4j-over-slf4j',        version: '1.6.6'
        compile group: 'ch.qos.logback',  name: 'logback-core',            version: '1.0.6'
        compile group: 'joda-time',       name: 'joda-time',               version: '2.1'
        compile group: 'com.google.inject',name: 'guice',                  version: '3.0'
        compile group: 'com.google.protobuf',name: 'protobuf-java',        version: '2.4.1'


        //to be erased soon
        compile group: 'commons-configuration',name:'commons-configuration',version: '1.8'
        compile group: 'org.jboss.netty', name: 'netty',                   version: '3.2.7.Final'

        //compile group: 'org.asteriskjava',name: 'asterisk-java',         version: '1.0.0.M3'            
        compile fileTree(dir: project.ext.fixedLibDir, include: '*.jar')

    }

    task('copyJars') { 
        ext.collection = files { genLibDir.listFiles() }
        delete ext.collection
        copy { from configurations.compile into genLibDir }
        copy { from fixedLibDir into genLibDir }
    }

    task('setupAll', dependsOn: ['copyJars','eclipse']) {
        description = 'Update jars from remote repositories and then fix eclipse classpath for master project'

    }

    hello << {println "- I depend on stserver"}

    build << { println "subproject:source sets=$sourceSets.main.java.srcDirs" }
}

task release << { println "putting together release" }

//TODO: have a release task AND if version is null when running the release task
//throw an exception telling the user to pass in a version with "./build -Dversion=xxxx"
//The automated build will call the release task with a version number like that
gradle.taskGraph.whenReady {taskGraph ->
    if (taskGraph.hasTask(release) && version == 'Developer-Build') {
        throw new StopExecutionException("You must specify -Dversion=<some version> to run the release task")
    } else {
        version = '1.0-SNAPSHOT'
    }
}

FULL child webserver build.gradle file

sourceSets.main{
  java.srcDirs = ['app']
}

build << { println "source sets=$sourceSets.main.java.srcDirs" }

hello << {println "- Do something specific xxxx"}

    dependencies {
        compile fileTree(dir: 'play-1.2.4/framework/lib', include: '*.jar')
        compile fileTree(dir: 'play-1.2.4/framework', include: '*.jar')
    }

    eclipse {
    }

thanks,
Dean

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T07:07:43+00:00Added an answer on June 6, 2026 at 7:07 am

    This means that you have some other code which resolves (i.e. asks for its files) the compile configuration at configuration time. Something like configurations.compile.each { ... }, outside a task action. After a configuration has been resolved, you can’t add further dependencies to it. Usually it’s undesirable (and unnecessary) to resolve a configuration at configuration time. Among other things, it will slow down your build.

    See the Gradle user guide for more information on the distinct phases of a Gradle build (initialization/configuration/execution).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have installed my dependencies using bundle package Then transferred them to the offline
I have been reading that creating dependencies by using static classes/singletons in code, is
I'm trying to build an RPM that will install file dependencies if they don't
We have multiple Python projects that have dependencies on each other. Hierarchically, these are
I'm trying to figure out the logic for creating tasks that have dependencies. In
Does jQuery validation plugin have some dependencies? For example, I saw blogposts that said
Using Unity in an ASP.Net MVC 2 app I have various dependencies on Controllers
I have a web application with a custom configuration section. That section contains information
I have the following problem: I've got a website that can't have dependencies to
I often find that the headers section of a file gets larger and larger

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.