Skip to content

Commit

Permalink
#169 Document changes applied by #170 (#181)
Browse files Browse the repository at this point in the history
  • Loading branch information
aalmiray committed Mar 2, 2023
1 parent 8e41afb commit b751691
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
8 changes: 8 additions & 0 deletions README.md
Expand Up @@ -220,6 +220,12 @@ the _add-module-info_ goal as follows:
</exports>
</moduleInfo>
</module>
<exclusions>
<exclusion>
<groupId>com.acme</groupId>
<artifactId>thing</artifactId>
</exclusion>
</exclusions>
</configuration>
</execution>
</executions>
Expand All @@ -235,6 +241,8 @@ The special value `base` (the default) can be used to add the descriptor to the
Putting the descriptor under `META-INF/versions` can help to increase compatibility with older libraries scanning class files that may fail when encountering the `module-info.class` file
(as chances are lower that such tool will look for class files under `META-INF/versions/...`).

The (optional) `exclusions` option may be used to filter out any `compile` or `runtime` dependencies that should not be used, as it might be the case when shading internal dependencies.

The `jdepsExtraArgs` option can be used to specify a list of arguments passed to the _jdeps_ invocation for creating a "candidate descriptor".

The following configuration options exist for the `<module>` configuration element:
Expand Down
Expand Up @@ -20,6 +20,7 @@
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.StandardCopyOption;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -131,7 +132,7 @@ public void execute() throws MojoExecutionException, MojoFailureException {
if (exclusions != null) {
ArtifactFilter scopeFilter = new ScopeArtifactFilter("compile+runtime");
ArtifactFilter exclusionFilter = new ExclusionArtifactFilter(exclusions);
project.setArtifactFilter(new AndArtifactFilter(List.of(scopeFilter, exclusionFilter)));
project.setArtifactFilter(new AndArtifactFilter(Arrays.asList(scopeFilter, exclusionFilter)));
}

Path outputPath = outputDirectory.toPath();
Expand Down

0 comments on commit b751691

Please sign in to comment.