This is an automated email from the ASF dual-hosted git repository. lhotari pushed a commit to branch branch-3.3 in repository https://gitbox.apache.org/repos/asf/pulsar.git
commit 538eb874fdc97a703ca9ad83cbbcee89e47d9d5e Author: Lari Hotari <[email protected]> AuthorDate: Mon Oct 14 12:03:57 2024 +0300 [fix][build] Add basic support for vscode-java and Eclipse IDE (#23448) (cherry picked from commit 209fd784765916e28d38e50e52f6ed90d47527fd) --- .gitignore | 2 ++ pom.xml | 46 ++++++++++++++++++++++++++++++++++ pulsar-broker/pom.xml | 19 ++++++++++++++ pulsar-common/pom.xml | 32 +++++++++++++++++++++++ pulsar-transaction/coordinator/pom.xml | 34 +++++++++++++++++++++++-- 5 files changed, 131 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 80d760cd29d..fe6e44915e6 100644 --- a/.gitignore +++ b/.gitignore @@ -99,3 +99,5 @@ test-reports/ .mvn/.gradle-enterprise/ # Gradle Develocity .mvn/.develocity/ +.vscode +effective-pom.xml diff --git a/pom.xml b/pom.xml index 4c1d7d80488..25cc232a00a 100644 --- a/pom.xml +++ b/pom.xml @@ -311,6 +311,7 @@ flexible messaging model and an intuitive client API.</description> <errorprone-slf4j.version>0.1.21</errorprone-slf4j.version> <j2objc-annotations.version>1.3</j2objc-annotations.version> <lightproto-maven-plugin.version>0.4</lightproto-maven-plugin.version> + <build-helper-maven-plugin.version>3.6.0</build-helper-maven-plugin.version> <dependency-check-maven.version>10.0.2</dependency-check-maven.version> <roaringbitmap.version>1.2.0</roaringbitmap.version> <extra-enforcer-rules.version>1.6.1</extra-enforcer-rules.version> @@ -1910,6 +1911,7 @@ flexible messaging model and an intuitive client API.</description> <exclude>generated-site/**</exclude> <exclude>**/*.md</exclude> <exclude>**/.idea/**</exclude> + <exclude>**/.vscode/**</exclude> <exclude>**/.mvn/**</exclude> <exclude>**/generated/**</exclude> <exclude>**/zk-3.5-test-data/*</exclude> @@ -2055,6 +2057,7 @@ flexible messaging model and an intuitive client API.</description> <exclude>**/SecurityAuth.audit*</exclude> <exclude>**/site2/**</exclude> <exclude>**/.idea/**</exclude> + <exclude>**/.vscode/**</exclude> <exclude>**/.mvn/**</exclude> <exclude>**/*.a</exclude> <exclude>**/*.so</exclude> @@ -2255,6 +2258,49 @@ flexible messaging model and an intuitive client API.</description> <!-- <nvdDatafeedUrl>https://jeremylong.github.io/DependencyCheck/hb_nvd/</nvdDatafeedUrl> --> </configuration> </plugin> + <!-- + vscode-java and Eclipse Maven integration workaround: + - Addresses maven-dependency-plugin exception (MDEP-187) issue by ignoring the plugin execution + - Uses org.eclipse.m2e:lifecycle-mapping:1.0.0 as configuration placeholder in pluginManagement section + For details: https://eclipse.dev/m2e/documentation/m2e-execution-not-covered.html#ignore-plugin-goal + --> + <plugin> + <groupId>org.eclipse.m2e</groupId> + <artifactId>lifecycle-mapping</artifactId> + <version>1.0.0</version> + <configuration> + <lifecycleMappingMetadata> + <pluginExecutions> + <pluginExecution> + <pluginExecutionFilter> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-dependency-plugin</artifactId> + <versionRange>[1.0.0,)</versionRange> + <goals> + <goal>copy</goal> + </goals> + </pluginExecutionFilter> + <action> + <ignore /> + </action> + </pluginExecution> + <pluginExecution> + <pluginExecutionFilter> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-dependency-plugin</artifactId> + <versionRange>[1.0.0,)</versionRange> + <goals> + <goal>unpack</goal> + </goals> + </pluginExecutionFilter> + <action> + <ignore /> + </action> + </pluginExecution> + </pluginExecutions> + </lifecycleMappingMetadata> + </configuration> + </plugin> </plugins> </pluginManagement> <extensions> diff --git a/pulsar-broker/pom.xml b/pulsar-broker/pom.xml index 5c79ab479ec..918c25fd119 100644 --- a/pulsar-broker/pom.xml +++ b/pulsar-broker/pom.xml @@ -672,6 +672,25 @@ </execution> </executions> </plugin> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>build-helper-maven-plugin</artifactId> + <version>${build-helper-maven-plugin.version}</version> + <executions> + <execution> + <id>add-source</id> + <phase>generate-sources</phase> + <goals> + <goal>add-source</goal> + </goals> + <configuration> + <sources> + <source>target/generated-sources/lightproto/java</source> + </sources> + </configuration> + </execution> + </executions> + </plugin> <plugin> <artifactId>maven-resources-plugin</artifactId> diff --git a/pulsar-common/pom.xml b/pulsar-common/pom.xml index 4f99762dd35..25162365ffd 100644 --- a/pulsar-common/pom.xml +++ b/pulsar-common/pom.xml @@ -290,6 +290,38 @@ </execution> </executions> </plugin> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>build-helper-maven-plugin</artifactId> + <version>${build-helper-maven-plugin.version}</version> + <executions> + <execution> + <id>add-source</id> + <phase>generate-sources</phase> + <goals> + <goal>add-source</goal> + </goals> + <configuration> + <sources> + <source>target/generated-sources/protobuf/java</source> + </sources> + </configuration> + </execution> + <execution> + <id>add-test-source</id> + <phase>generate-sources</phase> + <goals> + <goal>add-test-source</goal> + </goals> + <configuration> + <sources> + <source>target/generated-test-sources/protobuf/java</source> + </sources> + </configuration> + </execution> + </executions> + </plugin> + <plugin> <groupId>pl.project13.maven</groupId> diff --git a/pulsar-transaction/coordinator/pom.xml b/pulsar-transaction/coordinator/pom.xml index 740faa7af47..91f335b9e82 100644 --- a/pulsar-transaction/coordinator/pom.xml +++ b/pulsar-transaction/coordinator/pom.xml @@ -61,7 +61,7 @@ </dependency> </dependencies> - + <build> <plugins> <plugin> @@ -93,7 +93,37 @@ </execution> </executions> </plugin> - + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>build-helper-maven-plugin</artifactId> + <version>${build-helper-maven-plugin.version}</version> + <executions> + <execution> + <id>add-source</id> + <phase>generate-sources</phase> + <goals> + <goal>add-source</goal> + </goals> + <configuration> + <sources> + <source>target/generated-sources/protobuf/java</source> + </sources> + </configuration> + </execution> + <execution> + <id>add-test-source</id> + <phase>generate-sources</phase> + <goals> + <goal>add-test-source</goal> + </goals> + <configuration> + <sources> + <source>target/generated-test-sources/protobuf/java</source> + </sources> + </configuration> + </execution> + </executions> + </plugin> <plugin> <groupId>com.github.spotbugs</groupId> <artifactId>spotbugs-maven-plugin</artifactId>
