Skip to content

Commit

Permalink
feat(#2506): exception message
Browse files Browse the repository at this point in the history
  • Loading branch information
maxonfjvipon committed Oct 16, 2023
1 parent 20461a0 commit 869b1c4
Showing 1 changed file with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ public CopiedResources(

@Override
public void accept(final Path sources, final Path destination) {
final String src = sources.toString();
final String dst = destination.toString();
try {
MojoExecutor.executeMojo(
MojoExecutor.plugin(
Expand All @@ -70,25 +72,24 @@ public void accept(final Path sources, final Path destination) {
),
MojoExecutor.goal("copy-resources"),
MojoExecutor.configuration(
MojoExecutor.element("outputDirectory", destination.toString()),
MojoExecutor.element("outputDirectory", dst),
MojoExecutor.element(
"resources",
MojoExecutor.element(
"resource",
MojoExecutor.element("directory", sources.toString()),
MojoExecutor.element("directory", src),
MojoExecutor.element("filtering", "true")
)
)
),
this.environment
);
} catch (final MojoExecutionException ex) {
throw new IllegalStateException(ex);
throw new IllegalStateException(
String.format("Couldn't copy resources from %s to %s", src, dst), ex
);
}
Logger.info(
this, "Resources from %s were copied to %s",
sources.toString(), destination.toString()
);
Logger.info(this, "Resources from %s were copied to %s", src, dst);
}

@Override
Expand Down

1 comment on commit 869b1c4

@0pdd
Copy link

@0pdd 0pdd commented on 869b1c4 Oct 16, 2023

Choose a reason for hiding this comment

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

Puzzle 2506-45cecde8 discovered in eo-maven-plugin/src/main/java/org/eolang/maven/CopySourcesMojo.java) and submitted as #2539. Please, remember that the puzzle was not necessarily added in this particular commit. Maybe it was added earlier, but we discovered it only now.

Please sign in to comment.