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

Please also transport the --patch-module flags to the start scripts #20

Open
Vampire opened this issue Mar 14, 2018 · 2 comments
Open
Labels

Comments

@Vampire
Copy link

Vampire commented Mar 14, 2018

You need to add the patch libs to some folder like patch-lib in the distribution like with

distributions {
   main {
      contents {
         from(configurations.patch) {
            into 'patch-lib'
         }
      }
   }
}

and then add the --patch-module flags like --patch-module org.apache.logging.log4j=$APP_HOME/patch-lib/patch-lib.jar for *nix or --patch-module org.apache.logging.log4j=%APP_HOME%\patch-lib\patch-lib.jar for Windows.

@zyxist
Copy link
Owner

zyxist commented Mar 14, 2018

Adding patches is a bit tricky, because the current algorithm for translating dependencies into patch flags is based on the JAR location+name within Gradle cache. I'm aware of that limitation since adding support for patching, and I must find out, how the original plugin constructs JAR names in the lib directory and use exactly same API in Chainsaw. I'm adding it to fix in the next release.

@zyxist zyxist added the bug label Mar 14, 2018
@zyxist zyxist added this to the chainsaw-0.3.2 milestone Mar 14, 2018
@Vampire
Copy link
Author

Vampire commented Mar 14, 2018

Well, as you remove the patch files from all configurations, they will not end up in the lib directory, which is ok, because they should not be considered as modules themselves which they would if have them on the module path. So you need them in a separate folder like I showed with the configuration above e. g. That is from a build script, but you can do the same in plugin code too of course.

In ModulePatcher you use artifact.getFile().getAbsolutePath() of the resolved artifact, so if you put the patch configuration into some folder like patch-lib and then construct the flag option from artifact.getFile().getName() that should work fine I think. The APP_HOME placeholders can be used as I showed them, the start script interpreter will expand them.

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

2 participants