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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T03:48:36+00:00 2026-05-31T03:48:36+00:00

I trying to compile and package up my java application but I am facing

  • 0

I trying to compile and package up my java application but I am facing issues when trying to specify my local repository in which I have my jars that will be used as dependencies. I have stored all the jars I need for my application in ‘/home/test/lib’. What I have as my build.gradle file is as follows:

apply plugin:'application'
apply plugin:'java'
apply plugin:'idea'

    def repositoryPath = '/home/test/lib'

    repositories {
        repositoryPath
    }



dependencies {
            "org.springframework:spring-orm:3.0.2.RELEASE"
            "org.springframework:spring-context-support:3.0.2.RELEASE"
            'commons-dbcp:commons-dbcp:1.4'
            'org.apache.ibatis:ibatis-sqlmap:2.3.4.726'
            'commons-dbutils:commons-dbutils:1.3'
            'joda-time:joda-time:1.6'
            'commons-lang:commons-lang:2.5'
            'com.google.collections:google-collections:1.0'
}

jar {
    baseName = 'testJar'
}

mainClassName = "com.some.test.testRunner"

When I run gradle build, I am getting “package * does not exist” errors.

My assumption is that gradle is not finding the requisite external jars in my lib folder. Can somebody point out what I may be doing wrong here.

Thanks

  • 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-31T03:48:37+00:00Added an answer on May 31, 2026 at 3:48 am

    some remarks about your build file. I assume you have a flat directory in ‘/home/test/lib’ that contains your third party libs? If this is the case you can use a flatDir repository, that is declared with the following syntax:

    def repositoryPath = '/home/test/lib'
    
    repositories {
        flatDir {
           dirs repositoryPath
        }
    }
    

    If /home/test/lib is a ivy repository, you can do:

    repositories {
        ivy {
           url repositoryPath
        }
    }
    

    This is explained in detail in the Gradle user guide.

    in your ‘dependencies’ section you missed to declare the scope of your dependencies (compile, runtime, etc):

    dependencies {
        compile "org.springframework:spring-orm:3.0.2.RELEASE"
        compile "org.springframework:spring-context-support:3.0.2.RELEASE"
        compile 'commons-dbcp:commons-dbcp:1.4'
        compile 'org.apache.ibatis:ibatis-sqlmap:2.3.4.726'
        compile 'commons-dbutils:commons-dbutils:1.3'
        compile 'joda-time:joda-time:1.6'
        compile 'commons-lang:commons-lang:2.5'
        compile 'com.google.collections:google-collections:1.0'
    }
    

    if you use a flatdir repository, the group of your dependency definition is often omitted:

    dependencies {
        compile ":spring-orm:3.0.2.RELEASE"
        ...
    }
    

    Have a look at the gradle user guide for detailed information about dependency handling with gradle: http://gradle.org/docs/current/userguide/userguide_single.html#artifact_dependencies_tutorial

    regards,
    René

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

Sidebar

Related Questions

I am trying to compile Board.java, which is in the same package (and directory)
I'm trying to compile ActionFactory.java file which imports one of my package, RegisterAction.java Here
I'm trying to compile GNUstep on a linux box but gnustep-gui-0.16.0 package is failing.
I have a android webservice client application. I am trying to use the java
I'm trying to compile a java file which imports other packages I created; however,
I'm trying to compile a java program that is using JavaDB/Derby. On the command
I have a Java project that has just about every class and package depending
Trying to compile a Web Project here but I keep on getting package does
I'm trying to run a Lucene Java application on my local machine. I get
I am trying to use Java Compiler API to compile some java class. That

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.