Mahatir Said
Mahatir Said

Reputation: 269

How can I copy project libraries from one project into another one in IntelliJ?

I have a list of Project libraries:

enter image description here

I can't find a way to export/copy the libraries into another project.

How can one do that?

Upvotes: 1

Views: 2414

Answers (2)

Andrey
Andrey

Reputation: 16441

For Gradle (or Maven) based projects, after IDE pulls dependencies which you configure in build.gradle (pom.xml) file it stores them in project configuration files on Project level. See Libraries and Global Libraries section of documentation.

You indeed may move Libraries to Global Libraries making them available in other your projects, which may not use Maven or Gradle for managing dependencies: enter image description here

Upvotes: 1

Ruslan
Ruslan

Reputation: 6300

If you want to copy all libraries from gradle project to another gradle project you just need to copy dependencies section from build.gradle file to build.gradle from another project. Usually your build file looks like:

...
repositories {
    mavenCentral()     // that's where the gradle gets all libraries for project
}

dependencies {  // it's the list of dependencies are used for your project
    implementation 'library1Name'
    implementation 'library2Name'
    ...
}
...

See more Gradle Declaring Dependencies

Upvotes: 2

Related Questions