Skip to content

Classpath directory not found in multi-module Gradle project setup #38

Description

@ucguy4u

I encountered an issue while using the ArchUnit Gradle Plugin in a multi-module project. The plugin fails to locate the classpath directory and throws a NoSuchFileException. Below are the details of the error:

Classpath ./config-state-store-example/build/classes/java/main doesn't exist : loading all classes from root, ie ./config-state-store-example/build/classes/java/main even though it's probably not what you want to achieve. Enable debug logs in your build to see the list of actual resources being loaded and analyzed by the plugin.

java.nio.file.NoSuchFileException: /Users/chauhanuday/workspace/poc/config-state-store-example/build/classes/java/main
    at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:92)
    at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:106)

Steps to Reproduce:

Create a multi-module Gradle project.
Apply the ArchUnit Gradle Plugin to one or more modules.
Run the Gradle build using ./gradlew build.
Expected Behavior: The plugin should correctly identify the classpath directories for each module and analyze them without errors.

Actual Behavior: The plugin fails to find the classpath directory (build/classes/java/main) and throws a NoSuchFileException. It then attempts to load all classes from the root directory, which is not the intended behavior.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions