Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: not finding sources in non-standard directories #3260

Merged
merged 2 commits into from
Feb 20, 2020

Conversation

scootafew
Copy link
Contributor

In Maven POM, the standard directory layout for sources and test sources can be overridden from the standard src/main/java and src/test/java as follows:

<build>
    <sourceDirectory>source/code</sourceDirectory>
    <testSourceDirectory>test</testSourceDirectory>
</build>

The description for the field sourceDirectory states:

This element specifies a directory containing the source of the project. The generated build system will compile the source in this directory when the project is built. The path given is relative to the project descriptor.

Previously, when using MavenLauncher, if this value is defined it will be used instead of the standard directory structure when searching for sources. The issue is that this relative path is not prefixed with the absolute path to the project directory. This means that it assumes the current working directory, which is not necessarily the path to the Maven project being analysed.

PR contains previously failing test case with suggested fix.

@monperrus
Copy link
Collaborator

Thanks for the PR and the detailed explanation, @nharrand WDYT?

@nharrand
Copy link
Collaborator

Yes indeed. Makes sense. Thanks for the fix!

@nharrand nharrand merged commit c720f9e into INRIA:master Feb 20, 2020
@scootafew
Copy link
Contributor Author

No problem! Thanks for the quick review 😄

@scootafew scootafew deleted the source-directory-test branch February 20, 2020 11:21
@monperrus monperrus mentioned this pull request Mar 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants