72
72
import org .apache .maven .api .services .DependencyResolver ;
73
73
import org .apache .maven .api .services .DependencyResolverRequest ;
74
74
import org .apache .maven .api .services .DependencyResolverResult ;
75
+ import org .apache .maven .api .services .MavenException ;
75
76
import org .apache .maven .api .services .MessageBuilder ;
76
77
import org .apache .maven .api .services .MessageBuilderFactory ;
77
78
import org .apache .maven .api .services .ProjectManager ;
@@ -344,8 +345,8 @@ final Charset charset() {
344
345
* @see <a href="https://docs.oracle.com/en/java/javase/17/docs/specs/man/javac.html#annotation-processing">javac Annotation Processing</a>
345
346
* @since 3.5
346
347
*
347
- * @deprecated Replaced by ordinary dependencies with {@code <type>} element
348
- * set to {@code proc }, {@code classpath-proc } or {@code modular-proc }.
348
+ * @deprecated Replaced by ordinary dependencies with {@code <type>} element set to
349
+ * {@code processor }, {@code classpath-processor } or {@code modular-processor }.
349
350
*/
350
351
@ Parameter
351
352
@ Deprecated (since = "4.0.0" )
@@ -1075,8 +1076,7 @@ public void execute() throws MojoException {
1075
1076
.builder ()
1076
1077
.strong ("COMPILATION ERROR: " )
1077
1078
.a (message );
1078
- // Do not log stack trace for `CompilationFailureException` because they are not unexpected.
1079
- logger .error (mb .toString (), e instanceof CompilationFailureException ? null : e );
1079
+ logger .error (mb .toString (), verbose ? e : null );
1080
1080
if (tipForCommandLineCompilation != null ) {
1081
1081
logger .info (tipForCommandLineCompilation );
1082
1082
tipForCommandLineCompilation = null ;
@@ -1102,9 +1102,10 @@ public void execute() throws MojoException {
1102
1102
* provided that the {@link #logger} is thread-safe.
1103
1103
*
1104
1104
* @param listener where to send compilation warnings, or {@code null} for the Maven logger
1105
- * @throws MojoException if this method identifies an invalid parameter in this <abbr>MOJO</abbr>
1106
1105
* @return the task to execute for compiling the project using the configuration in this <abbr>MOJO</abbr>
1106
+ * @throws MojoException if this method identifies an invalid parameter in this <abbr>MOJO</abbr>
1107
1107
* @throws IOException if an error occurred while creating the output directory or scanning the source directories
1108
+ * @throws MavenException if an error occurred while fetching dependencies
1108
1109
*/
1109
1110
public ToolExecutor createExecutor (DiagnosticListener <? super JavaFileObject > listener ) throws IOException {
1110
1111
var executor = new ToolExecutor (this , listener );
@@ -1398,6 +1399,8 @@ final String parseModuleInfoName(Path source) throws IOException {
1398
1399
* any filename-based dependency and this MOJO is compiling the main code, then a warning will be logged.
1399
1400
*
1400
1401
* @param hasModuleDeclaration whether to allow placement of dependencies on the module-path.
1402
+ * @throws IOException if an I/O error occurred while fetching dependencies
1403
+ * @throws MavenException if an error occurred while fetching dependencies for a reason other than I/O.
1401
1404
*/
1402
1405
final DependencyResolverResult resolveDependencies (boolean hasModuleDeclaration ) throws IOException {
1403
1406
DependencyResolver resolver = session .getService (DependencyResolver .class );
@@ -1460,8 +1463,8 @@ final DependencyResolverResult resolveDependencies(boolean hasModuleDeclaration)
1460
1463
* @param addTo the modifiable map and lists where to append more paths to annotation processor dependencies
1461
1464
* @throws MojoException if an error occurred while resolving the dependencies
1462
1465
*
1463
- * @deprecated Replaced by ordinary dependencies with {@code <type>} element
1464
- * set to {@code proc }, {@code classpath-proc } or {@code modular-proc }.
1466
+ * @deprecated Replaced by ordinary dependencies with {@code <type>} element set to
1467
+ * {@code processor }, {@code classpath-processor } or {@code modular-processor }.
1465
1468
*/
1466
1469
@ Deprecated (since = "4.0.0" )
1467
1470
final void resolveProcessorPathEntries (Map <PathType , List <Path >> addTo ) throws MojoException {
0 commit comments