Forge
How-to guides

Declare dependencies

Declare Java libraries, resource and plugin dependencies, and install them.

A project declares three kinds of dependency, and each goes in a different place.

Java libraries

Ordinary jars your plugin code calls go on the standard configurations:

dependencies {
    implementation("com.fasterxml.jackson.core:jackson-databind:2.15.2")
}

assemblePlugin copies these into the resource archive under the plugin's libs/ folder, and generatePluginDescriptor lists each one in the <runtime> node of plugin.xml.

You do not declare the CATIA Magic API itself. Forge injects every jar from the installation's lib/ and plugins/ folders onto compileOnly and testImplementation, so import com.nomagic.* resolves without any declaration.

CATIA Magic resources and plugins

Resources and plugins go on the catiaMagic configuration:

dependencies {
    // A resource dependency
    catiaMagic("com.3ds.resources:product-line-engineering:2024.3.0")

    // A plugin dependency
    catiaMagic("com.3ds.plugins:sysml:2024.3.0")

    // A specific classifier
    catiaMagic("com.lumon.resources:macrodata-refinement-core:2024.3.0:holly@zip")
}

Each artifact must already exist in your repository. A dependency Gradle cannot resolve fails both installation and packaging.

These declarations do double duty. Forge writes them into the generated descriptors — resource dependencies become requiredResource nodes, plugin dependencies become required-plugin nodes — resolving each against registry.json. The packaged metadata therefore cannot drift from what the project builds against. See The dependency model.

Install what you declared

./gradlew installCatiaMagicDependencies

The task resolves the catiaMagic configuration and installs every resource and plugin it names into your CATIA Magic installation, transitively. Gradle handles the resolution, so you need not work out the install order yourself.

To reinstall exactly what the tool originally shipped, Forge keeps that set separately on the catiaMagicInstallation configuration, populated from the installation's manifest.json.

On this page