Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to add classpath/directories for dependencies on Gradle?

Tags:

gradle

I have a new project, it depends on classes at legacy project, not jar files but actual classes. How can I make these directories a dependency for gradle compile?

like image 294
Mashimom Avatar asked Mar 31 '14 18:03

Mashimom


People also ask

Where do I add classpath in New Gradle?

1- open your build. Gradle (app module) scroll to the top until you see that comment // Top-level build file where you can add configuration options common to all sub-projects/modules. builtin comment // Top-level build file where you can add configuration options common to all sub-projects/modules.

What is classpath in Gradle?

Annotation Type ClasspathMarks a property as specifying a JVM classpath for a task. This annotation should be attached to the getter method in Java or the property in Groovy. Annotations on setters or just the field in Java are ignored. For jar files, the normalized path is empty.

How do I add a dependency in Gradle?

To add a dependency to your project, specify a dependency configuration such as implementation in the dependencies block of your module's build.gradle file.

Where are dependencies stored in Gradle?

The Gradle dependency cache consists of two storage types located under GRADLE_USER_HOME/caches : A file-based store of downloaded artifacts, including binaries like jars as well as raw downloaded meta-data like POM files and Ivy files.


1 Answers

dependencies {     compile files("relative/path/to/classes/dir") } 

For further details, check out the Gradle User Guide.

like image 114
Peter Niederwieser Avatar answered Sep 26 '22 01:09

Peter Niederwieser