Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@ public abstract class AbstractSourceJarMojo implements Mojo {

private static final String[] DEFAULT_EXCLUDES = new String[] {};

/**
* Name of the directory produced by maven-remote-resources-plugin whose contents are added to
* the source archive. Matched against the last path segment, not the whole path.
*/
private static final String SHARED_ARCHIVE_RESOURCES = "maven-shared-archive-resources";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

inline this as it's only used in one place


/**
* List of files to include. Specified as fileset patterns which are relative to the input directory whose contents
* is being packaged into the JAR.
Expand Down Expand Up @@ -431,10 +437,12 @@ protected MavenArchiver createArchiver() throws MojoException {
project.getBuild().getResources();

for (org.apache.maven.api.model.Resource r : resources) {
if (r.getDirectory().endsWith("maven-shared-archive-resources")) {
Path resourceDirectory = Paths.get(r.getDirectory());
Path directoryName = resourceDirectory.getFileName();
if (directoryName != null && SHARED_ARCHIVE_RESOURCES.equals(directoryName.toString())) {
addDirectory(
archiver.getArchiver(),
Paths.get(r.getDirectory()),
resourceDirectory,
getCombinedIncludes(null),
getCombinedExcludes(null));
}
Expand Down
Loading