New posts

This commit is contained in:
2026-11-06 21:43:25 +05:30
parent dfd3a830cd
commit d7d5689f05
40 changed files with 1359 additions and 0 deletions
+92
View File
@@ -0,0 +1,92 @@
<?xml version="1.0" encoding="UTF-8"?>
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.ankurm</groupId>
<artifactId>annotation-processor</artifactId>
<version>1.0</version>
</parent>
<artifactId>builder-demo</artifactId>
<name>builder-demo</name>
<description>A consumer of @GenerateBuilder, plus the retention / reflection demos.</description>
<dependencies>
<!-- Needed on the compile classpath so javac can resolve the @GenerateBuilder type.
It is SOURCE-retention, so nothing needs it at run time: scope "provided". -->
<dependency>
<groupId>com.ankurm</groupId>
<artifactId>builder-processor</artifactId>
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<!-- The processor is named here, on the PROCESSOR path - not just on the classpath.
On JDK 23+ a processor found only on the classpath is not run by default. -->
<annotationProcessorPaths>
<path>
<groupId>com.ankurm</groupId>
<artifactId>builder-processor</artifactId>
<version>${project.version}</version>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
</plugin>
</plugins>
</build>
<profiles>
<!-- For the article only: drops <annotationProcessorPaths> so the processor is on the classpath
(it is a "provided" dependency) but NOT on the processor path. Used by scripts/run-all.sh. -->
<profile>
<id>classpath-only</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<annotationProcessorPaths combine.self="override"/>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<!-- Same, plus an explicit request to run the processors found on the classpath. -->
<profile>
<id>classpath-proc-full</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<annotationProcessorPaths combine.self="override"/>
<proc>full</proc>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>