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 6010019
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T02:03:22+00:00 2026-05-23T02:03:22+00:00

I’m just new to Gradle, and I have a small problem with it. I’m

  • 0

I’m just new to Gradle, and I have a small problem with it. I’m trying to build two projects (called ‘infrastructure’ and ‘domain’), where domain has some imports from infrastructure.

When I try to build both projects, Gradle can’t compile my domain project, because he can’t find a package from infrastructure.

This is my build.gradle:

subprojects{
    apply plugin: 'java'

    springversion = '3.0.4.RELEASE'
    hibernateversion = '3.4.0.GA'
    jsfversion = '2.0.3'
    projectid = 'com.companyName.projectName'
    projectversion = '1.0.0-SNAPSHOT'

    repositories {
        mavenRepo urls: 'file:///C:/companyName/m2repo'
        mavenCentral()
    }

    dependencies {
        compile group: 'commons-configuration', name: 'commons-configuration', version: '1.6'
        compile group: 'sample.plugin', name: 'hsqldb-maven-plugin', version: '1.0-SNAPSHOT'
        testCompile group: 'junit', name: 'junit', version: '4.8.2'
        testCompile group: 'org.mockito', name: 'mockito-core', version: '1.8.0'
        testCompile group: 'org.springframework', name: 'spring-test', version: springversion

        compile group: 'org.springframework', name: 'spring-context', version: springversion
        compile group: 'org.springframework', name: 'spring-orm', version: springversion 
        compile group: 'org.springframework', name: 'spring-web', version: springversion 
        compile group: 'org.hibernate', name: 'hibernate-annotations', version: hibernateversion 
        compile group: 'org.hibernate', name: 'hibernate-entitymanager', version: hibernateversion
        compile group: 'org.hibernate', name: 'ejb3-persistence', version: '1.0.2.GA' 
        compile group: 'javax.enterprise', name: 'cdi-api', version: '1.0-CR1'
        compile group: 'com.sun.faces', name: 'jsf-api', version: jsfversion
        compile group: 'commons-lang', name: 'commons-lang', version: '2.5'
        runtime group: 'org.slf4j', name: 'slf4j-api', version: '1.5.6'
        runtime group: 'org.slf4j', name: 'slf4j-jdk14', version: '1.5.6'
        runtime group: 'org.hsqldb', name: 'hsqldb', version: '1.8.0.10'
        runtime group: 'commons-dbcp', name: 'commons-dbcp', version: '1.2.2'
        runtime group: 'org.aspectj', name: 'aspectjweaver', version: '1.6.2'
    }

}

project (':infrastructure'){
    task intTestJar(type: Jar) {
        from sourceSets.main.classes
        from sourceSets.test.classes
    }
}

project(':domain'){
    compileJava.dependsOn (':infrastructure:intTestJar')        
}

In my settings.gradle, I’ve declared this:

include 'infrastructure', 'domain'

Both projects should be built to a .jar file.

When try to build the projects, this error is shown when he is running domain:compileTestJava

package com.companyName.projectName.test does not exist

This package refers to my infrastructure project. In eclipse it works, but I can’t build it with gradle.

Any help would be appreciated.

Regards,

Walle

  • 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-05-23T02:03:22+00:00Added an answer on May 23, 2026 at 2:03 am

    This did the trick:

    subprojects{
        apply plugin: 'java'
        apply plugin: 'eclipse'
    
        springversion = '3.0.4.RELEASE'
        hibernateversion = '3.4.0.GA'
        jsfversion = '2.0.3'
        projectid = 'com.companyName.projectName'
        projectversion = '1.0.0-SNAPSHOT'
    
        repositories {
            mavenRepo urls: 'file:///C:/companyName/m2repo'
            mavenCentral()
        }
    
        dependencies {
            compile group: 'commons-configuration', name: 'commons-configuration', version: '1.6'
            compile group: 'sample.plugin', name: 'hsqldb-maven-plugin', version: '1.0-SNAPSHOT'
            testCompile group: 'junit', name: 'junit', version: '4.8.2'
            testCompile group: 'org.mockito', name:    'mockito-core', version: '1.8.0'
            testCompile group: 'org.springframework', name: 'spring-test', version: springversion
    
            compile group: projectid, name: 'infrastructure', version: projectversion
            compile group: projectid, name: 'domain', version: projectversion
            compile group: 'org.springframework', name: 'spring-context', version: springversion
            compile group: 'org.springframework', name: 'spring-orm', version: springversion 
            compile group: 'org.springframework', name: 'spring-web', version: springversion 
            compile group: 'org.hibernate', name: 'hibernate-annotations', version: hibernateversion 
            compile group: 'org.hibernate', name: 'hibernate-entitymanager', version: hibernateversion
            compile group: 'org.hibernate', name: 'ejb3-persistence', version: '1.0.2.GA' 
            compile group: 'javax.enterprise', name: 'cdi-api', version: '1.0-CR1'
            compile group: 'com.sun.faces', name: 'jsf-api', version: jsfversion
            compile group: 'commons-lang', name: 'commons-lang', version: '2.5'
            runtime group: 'org.slf4j', name: 'slf4j-api', version: '1.5.6'
            runtime group: 'org.slf4j', name: 'slf4j-jdk14', version: '1.5.6'
            runtime group: 'org.hsqldb', name: 'hsqldb', version: '1.8.0.10'
            runtime group: 'commons-dbcp', name: 'commons-dbcp', version: '1.2.2'
            runtime group: 'org.aspectj', name: 'aspectjweaver', version: '1.6.2'
        }
        test{
            maxParallelForks=2
        }
    }
    
    project(':infrastructure'){
        task infrastructureTestJar(type: Jar) {
            from sourceSets.main.classes
            from sourceSets.test.classes
        }
        infrastructureTestJar.dependsOn(jar) 
    }
    
    project(':domain'){
        compileJava.dependsOn(':infrastructure:build')
        dependencies{
            compile files('../infrastructure/build/libs/infrastructure.jar')
        }
        task domainTestJar(type: Jar) {
            from sourceSets.main.classes
            from sourceSets.test.classes
        }
        domainTestJar.dependsOn(jar)
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have just tried to save a simple *.rtf file with some websites and
Basically, what I'm trying to create is a page of div tags, each has
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I am trying to loop through a bunch of documents I have to put
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small

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.