mojohaus / mojohaus/exec-maven-plugin

Module path can't be defined

Open
#335 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
191
Forks
111
Avg merge
1d 21h
Merged PRs (30d)
4

Description

Hello!
The problem is in module path. When plugin run main class, which is in module it defines the root path. Therefore, I can't use files in module because the path there isn't correct.
`
Main pom.xml


4.0.0

<groupId>org.example</groupId>
<artifactId>RunTestId</artifactId>
<packaging>pom</packaging>
<version>1.0-SNAPSHOT</version>
<modules>
    <module>ModuleOne</module>
</modules>

<properties>
    <maven.compiler.source>11</maven.compiler.source>
    <maven.compiler.target>11</maven.compiler.target>
</properties>

<dependencies>
    <dependency>
        <groupId>org.testng</groupId>
        <artifactId>testng</artifactId>
        <version>7.6.1</version>
    </dependency>
    <dependency>
        <groupId>org.burningwave</groupId>
        <artifactId>core</artifactId>
        <version>12.59.0</version>
    </dependency>
    <dependency>
        <groupId>org.projectlombok</groupId>
        <artifactId>lombok</artifactId>
        <version>1.18.24</version>
        <scope>provided</scope>
    </dependency>
</dependencies>
<build>
    <pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <version>3.1.0</version>
                <configuration>
                    <skip>true</skip>
                    <mainClass>RunTests</mainClass>
                </configuration>
            </plugin>
        </plugins>
    </pluginManagement>
</build>

----------------------------- module pom.xml -----------
`
RunTestId
org.example
1.0-SNAPSHOT

4.0.0

<artifactId>ModuleOne</artifactId>

<properties>
    <maven.compiler.source>11</maven.compiler.source>
    <maven.compiler.target>11</maven.compiler.target>
</properties>
<build>
    <pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <version>3.1.0</version>
                <configuration>
                    <skip>false</skip>
                    <mainClass>RunTestsModule</mainClass>
                    <classpathScope>test</classpathScope>
                    <cleanupDaemonThreads>false</cleanupDaemonThreads>
                    <workingDirectory>ModuleOne</workingDirectory>
                </configuration>
            </plugin>
        </plugins>
    </pluginManagement>
</build>`

Actual result:
The path file in module is C:/RunTests/src/main/resources/text.txt

Expected result:
The path file in module is C:/RunTests/ModuleOne/src/main/resources/text.txt

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the main pom.xml and module pom.xml, focusing on the exec-maven-plugin configuration and its workingDirectory setting. Reproduce the multi-module run and compare the reported resource path with the expected ModuleOne-relative path. Done means the plugin resolves files from the module directory when the module main class runs.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.