Skip to content
Closed
Changes from all commits
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
27 changes: 20 additions & 7 deletions src/main/java/org/codehaus/mojo/aspectj/AbstractAjcCompiler.java
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,17 @@ public abstract class AbstractAjcCompiler extends AbstractAjcMojo {
@Parameter( defaultValue = "false" )
protected boolean enablePreview;

/**
* It is used to control whether to add the "resolvedIncludes" option parameter.
*
* To maintain compatibility, the default value is "true", but it is recommended to set it to "false".
*
* @see this#resolvedIncludes
*/
@Parameter( defaultValue = "true" )
protected boolean containsResolvedIncludes = true;


/**
* Holder for ajc compiler options
*/
Expand All @@ -483,7 +494,7 @@ public abstract class AbstractAjcCompiler extends AbstractAjcMojo {
/**
* Holds all files found using the includes, excludes parameters.
*/
protected Set<String> resolvedIncludes;
protected Set<String> resolvedIncludes = new HashSet<>();

/**
* Abstract method used by child classes to specify the correct output directory for compiled classes.
Expand Down Expand Up @@ -728,13 +739,15 @@ else if (AjcHelper.isValidComplianceLevel(complianceLevel)) {
ajcOptions.add("-s");
ajcOptions.add(getGeneratedSourcesDirectory().getAbsolutePath());

// Add all the files to be included in the build,
if (null != ajdtBuildDefFile) {
resolvedIncludes = AjcHelper.getBuildFilesForAjdtFile(ajdtBuildDefFile, basedir);
} else {
resolvedIncludes = getIncludedSources();
if (containsResolvedIncludes) {
// Add all the files to be included in the build,
if (null != ajdtBuildDefFile) {
resolvedIncludes = AjcHelper.getBuildFilesForAjdtFile(ajdtBuildDefFile, basedir);
} else {
resolvedIncludes = getIncludedSources();
}
ajcOptions.addAll(resolvedIncludes);
}
ajcOptions.addAll(resolvedIncludes);

if (CollectionUtils.isNotEmpty(additionalCompilerArgs)) {
ajcOptions.addAll(additionalCompilerArgs);
Expand Down
Loading