[
https://issues.apache.org/jira/browse/MCOMPILER-567?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17798741#comment-17798741
]
ASF GitHub Bot commented on MCOMPILER-567:
------------------------------------------
slawekjaranowski commented on code in PR #218:
URL:
https://github.com/apache/maven-compiler-plugin/pull/218#discussion_r1431929731
##########
src/it/MCOMPILER-567/pom.xml:
##########
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>MCOMPILER-567</artifactId>
+ <name>MCOMPILER-567</name>
+ <packaging>jar</packaging>
+ <version>1.0-SNAPSHOT</version>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>@project.version@</version>
+ </plugin>
+ </plugins>
+ </build>
+</project>
Review Comment:
missing empty line at the end 😄
> Fail to compile if the "generated-sources/annotations" does not exist
> ---------------------------------------------------------------------
>
> Key: MCOMPILER-567
> URL: https://issues.apache.org/jira/browse/MCOMPILER-567
> Project: Maven Compiler Plugin
> Issue Type: Bug
> Affects Versions: 3.12.0
> Reporter: Jorge Solórzano
> Assignee: Slawomir Jaranowski
> Priority: Critical
> Labels: pull-request-available
> Fix For: next-release
>
>
> On some configurations (like a Kotlin project), the cleanup of the
> generated-soruces/annotations directory returns an error:
> {code:java}
> Caused by: java.lang.IllegalStateException: basedir
> /maven-compiler-plugin/target/it/MCOMPILER-XX/target/generated-sources/annotations
> does not exist
> Â Â at org.codehaus.plexus.util.DirectoryScanner.scan
> (DirectoryScanner.java:268)
> Â Â at
> org.codehaus.plexus.compiler.AbstractCompiler.getSourceFilesForSourceRoot
> (AbstractCompiler.java:168)
> Â Â at org.codehaus.plexus.compiler.AbstractCompiler.getSourceFiles
> (AbstractCompiler.java:194)
> Â Â at org.codehaus.plexus.compiler.javac.JavacCompiler.performCompile
> (JavacCompiler.java:138)
> Â Â at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute
> (AbstractCompilerMojo.java:1187)
> Â Â at org.apache.maven.plugin.compiler.CompilerMojo.execute
> (CompilerMojo.java:212)
> Â Â at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo
> (DefaultBuildPluginManager.java:126)
> Â Â at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2
> (MojoExecutor.java:328)
> Â Â at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute
> (MojoExecutor.java:316)
> Â Â at org.apache.maven.lifecycle.internal.MojoExecutor.execute
> (MojoExecutor.java:212)
> Â Â at org.apache.maven.lifecycle.internal.MojoExecutor.execute
> (MojoExecutor.java:174)
> Â Â at org.apache.maven.lifecycle.internal.MojoExecutor.access$000
> (MojoExecutor.java:75)
> Â Â at org.apache.maven.lifecycle.internal.MojoExecutor$1.run
> (MojoExecutor.java:162)
> Â Â at org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute
> (DefaultMojosExecutionStrategy.java:39)
> Â Â at org.apache.maven.lifecycle.internal.MojoExecutor.execute
> (MojoExecutor.java:159)
> Â Â at
> org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject
> (LifecycleModuleBuilder.java:105)
> Â Â at
> org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject
> (LifecycleModuleBuilder.java:73)
> Â Â at
> org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build
> (SingleThreadedBuilder.java:53)
> Â Â at org.apache.maven.lifecycle.internal.LifecycleStarter.execute
> (LifecycleStarter.java:118)
> Â Â at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:261)
> Â Â at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:173)
> Â Â at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:101)
> Â Â at org.apache.maven.cli.MavenCli.execute (MavenCli.java:906)
> Â Â at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:283)
> Â Â at org.apache.maven.cli.MavenCli.main (MavenCli.java:206)
> Â Â at jdk.internal.reflect.DirectMethodHandleAccessor.invoke
> (DirectMethodHandleAccessor.java:103)
> Â Â at java.lang.reflect.Method.invoke (Method.java:580)
> Â Â at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced
> (Launcher.java:283)
> Â Â at org.codehaus.plexus.classworlds.launcher.Launcher.launch
> (Launcher.java:226)
> Â Â at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode
> (Launcher.java:407)
> Â Â at org.codehaus.plexus.classworlds.launcher.Launcher.main
> (Launcher.java:348){code}
> Â
> I didn't catch this earlier since I don't use Kotlin and on a normal project,
> this should not be an issue since the javac documentation mentions that the
> directory, and any necessary subdirectories, will be created if they do not
> already exist.
> But on a somewhat modified project that compiles kotlin source code, this
> triggers an issue on plexus-compiler where the generated-soruces directory
> does not exist.
> Â
> This might be related to issue MCOMPILER-538, where it claims that generated
> source root is not required for javac, but additional confirmation is
> required.
> Â
> The fix will be to create the generated sources directory to preserve the
> current behavior.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)