You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@causeway.apache.org by ah...@apache.org on 2023/03/04 08:49:13 UTC

[causeway] branch master updated: CAUSEWAY-3252: prepare removal of lombok.processor files

This is an automated email from the ASF dual-hosted git repository.

ahuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/causeway.git


The following commit(s) were added to refs/heads/master by this push:
     new 5bd6b61172 CAUSEWAY-3252: prepare removal of lombok.processor files
5bd6b61172 is described below

commit 5bd6b6117239c301e3dadf4468eb8c3f73f5c6d0
Author: Andi Huber <ah...@apache.org>
AuthorDate: Sat Mar 4 09:49:07 2023 +0100

    CAUSEWAY-3252: prepare removal of lombok.processor files
---
 bom/pom.xml                                        | 54 +++++++++++++---------
 commons/pom.xml                                    | 23 ---------
 core/codegen-bytebuddy/pom.xml                     | 20 --------
 .../jdo/dom/CommandLogEntryRepository.java         | 11 +++++
 .../fixtures/logging-dn-enhance.properties         | 41 ----------------
 5 files changed, 44 insertions(+), 105 deletions(-)

diff --git a/bom/pom.xml b/bom/pom.xml
index db51652819..7170f87ea0 100644
--- a/bom/pom.xml
+++ b/bom/pom.xml
@@ -60,8 +60,6 @@ It is therefore a copy of org.apache:apache, with customisations clearly identif
         <minimalMavenBuildVersion>3.8.0</minimalMavenBuildVersion> <!-- enforces https repos -->
         <minimalJavaBuildVersion>11</minimalJavaBuildVersion>
         <maven.compiler.release>11</maven.compiler.release>
-        <maven.compiler.source>11</maven.compiler.source>
-        <maven.compiler.target>11</maven.compiler.target>
 
         <!--  for m-plugin-p and maven-plugin-annotations  -->
         <assembly.tarLongFileMode>posix</assembly.tarLongFileMode>
@@ -2235,6 +2233,22 @@ It is therefore a copy of org.apache:apache, with customisations clearly identif
 						<showDeprecation>true</showDeprecation>
 						<showWarnings>true</showWarnings>
 						<parameters>true</parameters>
+						<annotationProcessorPaths>
+								<!-- this is a workaround, lombok's annotation processor should be picked up implicitly, but yet is not. 
+					
+								Details:
+								This is a workaround; the compiler ought to pick up all available processors on the classpath. 
+								
+								Also Note: Presence of file 'logging-dn-enhance.properties' activates a profile (defined blow),
+								that configures maven-compiler-plugin to run all annotation processors required 
+								for DataNucleus AND lombok.
+								--> 
+								<annotationProcessorPath>
+									<groupId>org.projectlombok</groupId>
+									<artifactId>lombok</artifactId>
+									<version>${lombok.version}</version>
+								</annotationProcessorPath>
+						</annotationProcessorPaths>
 					</configuration>
 					<!-- goal:compile binds to phase:compile -->
 					<!-- goal:testCompile binds to phase:test-compile -->
@@ -3037,33 +3051,31 @@ It is therefore a copy of org.apache:apache, with customisations clearly identif
 						<artifactId>datanucleus-maven-plugin</artifactId>
 						<inherited>true</inherited>
 					</plugin>
-				</plugins>
-			</build>
-		</profile>
-		<profile>
-			<id>causeway-app-lombok</id>
-			<activation>
-				<file>
-					<exists>${basedir}/lombok.processor</exists>
-				</file>
-			</activation>
-			<build>
-				<plugins>
 					<plugin>
 						<groupId>org.apache.maven.plugins</groupId>
 						<artifactId>maven-compiler-plugin</artifactId>
-						<version>${maven-compiler-plugin.version}</version>
 						<configuration>
 							<showDeprecation>true</showDeprecation>
 							<showWarnings>true</showWarnings>
 							<parameters>true</parameters>
 							<annotationProcessorPaths>
-								<!-- this is a workaround, should be picked up implicitly but yet not, for some reason -->
-								<annotationProcessorPath>
-									<groupId>org.projectlombok</groupId>
-									<artifactId>lombok</artifactId>
-									<version>${lombok.version}</version>
-								</annotationProcessorPath>
+									<annotationProcessorPath>
+										<groupId>org.projectlombok</groupId>
+										<artifactId>lombok</artifactId>
+										<version>${lombok.version}</version>	
+									</annotationProcessorPath>
+									<annotationProcessorPath>
+										<!-- not a processor, but provides all dependencies for 
+											'datanucleus-jdo-query' below --> 
+								        <groupId>org.datanucleus</groupId>
+								        <artifactId>javax.jdo</artifactId>
+								        <version>${datanucleus-jdo-api.version}</version>
+									</annotationProcessorPath>
+									<annotationProcessorPath>
+								        <groupId>org.datanucleus</groupId>
+								        <artifactId>datanucleus-jdo-query</artifactId>
+								        <version>${datanucleus-jdo-query.version}</version>
+									</annotationProcessorPath>
 							</annotationProcessorPaths>
 						</configuration>
 					</plugin>
diff --git a/commons/pom.xml b/commons/pom.xml
index 4bfd63a95d..bc57693a1a 100644
--- a/commons/pom.xml
+++ b/commons/pom.xml
@@ -51,32 +51,9 @@
 				</excludes>
 			</resource>
 		</resources>
-<!--
-		<plugins>
-			<plugin>
-				<groupId>org.apache.maven.plugins</groupId>
-				<artifactId>maven-compiler-plugin</artifactId>
-				<version>${maven-compiler-plugin.version}</version>
-				<configuration>
-					<showDeprecation>true</showDeprecation>
-					<showWarnings>true</showWarnings>
-					<parameters>true</parameters>
-					<annotationProcessorPaths>
-						&lt;!&ndash; this is a workaround, should be picked up implicitly but yet not, for some reason &ndash;&gt;
-						<annotationProcessorPath>
-							<groupId>org.projectlombok</groupId>
-							<artifactId>lombok</artifactId>
-							<version>${lombok.version}</version>
-						</annotationProcessorPath>
-					</annotationProcessorPaths>
-				</configuration>
-			</plugin>
-		</plugins>
--->
 	</build>
 
 	<dependencies>
-
 		<dependency>
 			<groupId>com.fasterxml.woodstox</groupId>
 			<artifactId>woodstox-core</artifactId>
diff --git a/core/codegen-bytebuddy/pom.xml b/core/codegen-bytebuddy/pom.xml
index 9d412dc4d8..0d4cf7dc5b 100644
--- a/core/codegen-bytebuddy/pom.xml
+++ b/core/codegen-bytebuddy/pom.xml
@@ -49,26 +49,6 @@
 				</excludes>
 			</resource>
 		</resources>
-		<plugins>
-			<plugin>
-				<groupId>org.apache.maven.plugins</groupId>
-				<artifactId>maven-compiler-plugin</artifactId>
-				<version>${maven-compiler-plugin.version}</version>
-				<configuration>
-					<showDeprecation>true</showDeprecation>
-					<showWarnings>true</showWarnings>
-					<parameters>true</parameters>
-					<annotationProcessorPaths>
-						<!-- this is a workaround, should be picked up implicitly but yet not, for some reason -->
-						<annotationProcessorPath>
-							<groupId>org.projectlombok</groupId>
-							<artifactId>lombok</artifactId>
-							<version>${lombok.version}</version>
-						</annotationProcessorPath>
-					</annotationProcessorPaths>
-				</configuration>
-			</plugin>
-		</plugins>
 	</build>
 
 	<dependencies>
diff --git a/extensions/core/commandlog/persistence-jdo/src/main/java/org/apache/causeway/extensions/commandlog/jdo/dom/CommandLogEntryRepository.java b/extensions/core/commandlog/persistence-jdo/src/main/java/org/apache/causeway/extensions/commandlog/jdo/dom/CommandLogEntryRepository.java
index 04cc3ccb03..7a734a9a79 100644
--- a/extensions/core/commandlog/persistence-jdo/src/main/java/org/apache/causeway/extensions/commandlog/jdo/dom/CommandLogEntryRepository.java
+++ b/extensions/core/commandlog/persistence-jdo/src/main/java/org/apache/causeway/extensions/commandlog/jdo/dom/CommandLogEntryRepository.java
@@ -42,4 +42,15 @@ extends org.apache.causeway.extensions.commandlog.applib.dom.CommandLogEntryRepo
     public CommandLogEntryRepository() {
         super(CommandLogEntry.class);
     }
+
+    /**
+     * The DN annotation processor (from artifact {@literal org.datanucleus:datanucleus-jdo-query})
+     * should  generate Q classes under 'target/generated-sources/annotations'.
+     * @see "https://www.datanucleus.org/products/accessplatform_6_0/jdo/query.html#jdoql"
+     */
+    private void ensureWeHaveQClasses() {
+        // ensures at compile time, that Q classes are generated
+        org.apache.causeway.extensions.commandlog.jdo.dom.QCommandLogEntry q;
+    }
+
 }
diff --git a/testing/fakedata/fixtures/logging-dn-enhance.properties b/testing/fakedata/fixtures/logging-dn-enhance.properties
deleted file mode 100644
index 0511a8f50e..0000000000
--- a/testing/fakedata/fixtures/logging-dn-enhance.properties
+++ /dev/null
@@ -1,41 +0,0 @@
-#  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.
-
-# LOG4J Configuration
-# ===================
-
-# Basic logging goes to "datanucleus.log"
-log4j.appender.A1=org.apache.log4j.FileAppender
-log4j.appender.A1.File=datanucleus.log
-log4j.appender.A1.layout=org.apache.log4j.PatternLayout
-log4j.appender.A1.layout.ConversionPattern=%d{HH:mm:ss,SSS} (%t) %-5p [%c] - %m%n
-#log4j.appender.A1.Threshold=INFO
-
-# Categories
-# Each category can be set to a "level", and to direct to an appender
-
-# Default to DEBUG level for all Datanucleus categories
-log4j.logger.DataNucleus = DEBUG, A1
-
-log4j.category.com.mchange.v2.c3p0=INFO, A1
-log4j.category.com.mchange.v2.resourcepool=INFO, A1
-log4j.category.org.logicalcobwebs.proxool=INFO,A1
-
-
-# Hbase libs logging
-log4j.category.org.apache.hadoop=INFO,A1
-log4j.category.org.apache.zookeeper=INFO,A1
\ No newline at end of file