Description: Use relative paths in the build config file embedded in the jar (builddef.lst) to make the builds reproducible Author: Emmanuel Bourg Bug: https://github.com/mojohaus/aspectj-maven-plugin/issues/52 --- a/src/main/java/org/codehaus/mojo/aspectj/AbstractAjcCompiler.java +++ b/src/main/java/org/codehaus/mojo/aspectj/AbstractAjcCompiler.java @@ -615,7 +615,7 @@ // add target dir argument ajcOptions.add("-d"); - ajcOptions.add(getOutputDirectory().getAbsolutePath()); + ajcOptions.add(getOutputDirectory().getAbsolutePath().replaceAll( new File("").getAbsolutePath(), "." )); // Add all the files to be included in the build, if (null != ajdtBuildDefFile) { --- a/src/main/java/org/codehaus/mojo/aspectj/AjcHelper.java +++ b/src/main/java/org/codehaus/mojo/aspectj/AjcHelper.java @@ -120,6 +120,7 @@ } cp = StringUtils.replace( cp, "//", "/" ); + cp = cp.replaceAll( new File("").getAbsolutePath(), "." ); return cp; } @@ -175,6 +176,7 @@ for ( String sourceDir : sourceDirs ) { + sourceDir = sourceDir.replaceAll( new File("").getAbsolutePath(), "." ); try { if ( FileUtils.fileExists( sourceDir ) )