File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
native-maven-plugin/src/main/java/org/graalvm/buildtools/maven Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 5555
5656import java .io .File ;
5757import java .util .ArrayList ;
58+ import java .util .Arrays ;
5859import java .util .Collections ;
5960import java .util .List ;
6061import java .util .function .BiConsumer ;
@@ -85,7 +86,12 @@ static String testIdsDirectory(String baseDir) {
8586
8687 static String buildAgentArgument (String baseDir , Context context , List <String > agentOptions ) {
8788 List <String > options = new ArrayList <>(agentOptions );
88- options .add ("config-output-dir=" + agentOutputDirectoryFor (baseDir , context ));
89+ // Do not add config-output-dir when a conflicting option is already present. Otherwise this happens:
90+ // native-image-agent: can only once specify exactly one of trace-output=, config-output-dir= or config-merge-dir=.
91+ final List <String > mutuallyExclusiveOptions = Arrays .asList ("config-output-dir" , "trace-output" , "config-merge-dir" );
92+ if (agentOptions .stream ().allMatch (option -> mutuallyExclusiveOptions .stream ().noneMatch (option ::startsWith ))) {
93+ options .add ("config-output-dir=" + agentOutputDirectoryFor (baseDir , context ));
94+ }
8995 return "-agentlib:native-image-agent=" + String .join ("," , options );
9096 }
9197
You can’t perform that action at this time.
0 commit comments