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

Unexpected Behaviour in the gradle run task #4

Closed
mirko-lelansky opened this issue Nov 1, 2017 · 3 comments
Closed

Unexpected Behaviour in the gradle run task #4

mirko-lelansky opened this issue Nov 1, 2017 · 3 comments
Labels

Comments

@mirko-lelansky
Copy link

Hallo,

i have found a strange behaviour in the gradle run task see Working Example . That example reads a property file from the module|classpath and prints the property to the console.

When you use the run task then the example didn't working because the Stream is null, but if you use the install task and then run the generate script the example works.

I think the problem is that gradle separates the class and resource files in two separate directories. The module-info.class file which identify the module are only in the folder of the classes. Then when you use the run task both folders are add to the module path, but i think that the resouces aren't correctly recognized, because they have no module-info.class file.

@SingingBush
Copy link

this is a problem for me. I have a unit test that uses a test resource but when running gradle check the resource is null

zyxist added a commit that referenced this issue Mar 4, 2018
@zyxist
Copy link
Owner

zyxist commented Mar 4, 2018

Sorry for the very late answer. Due to external circumstances I could not take care of the project for a while.

I managed to resolve the issue, although the root cause has something to do with Gradle internals, not with Jigsaw. The thing that helped was configuring JavaExec task with doLast closure, instead of doFirst. I added some integration tests both for run and test tasks.

@zyxist zyxist closed this as completed Mar 4, 2018
@zyxist
Copy link
Owner

zyxist commented Mar 8, 2018

Unfortunately, it turned out that the delivered fix disables Jigsaw completely for the run task. The tests did not capture it, because they did not look at the generated command line.

I managed to find a proper fix, will be merged later today.

@zyxist zyxist reopened this Mar 8, 2018
@zyxist zyxist added the bug label Mar 8, 2018
zyxist added a commit that referenced this issue Mar 8, 2018
@zyxist zyxist closed this as completed Mar 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants