Replies: 13 comments
-
I doubt this is a problem of the annotation processor paths, but the way manifold integrates with javac. It is not an annotation processor, but a javac plugin and if I'm not missing anything obvious, NetBeans will not run the required code. |
Beta Was this translation helpful? Give feedback.
-
Strange, why then it works in IntelliJ, Eclipse, VSCode |
Beta Was this translation helpful? Give feedback.
-
Because they have a different approach. If all IDEs would be the same, they would not exist. All approaches have drawbacks and advantages. It might be possible to enhance the compilation process to consider generated code from a previous maven run (from a quick glance the compilation results in three files in For the "it just works everywhere else": Just downloaded Eclipse 2025-03 (Enterprise Java and Web Developers Variant), unzipped the sample again. Imported the maven project and I'm greeted with red error indicators under the import declaration and the |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
I have the same problem with jstachio <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.14.0</version>
<configuration>
<annotationProcessorPaths>
<path>
<groupId>io.jstach</groupId>
<artifactId>jstachio-apt</artifactId>
<version>${io.jstach.version}</version>
</path>
<!-- other annotation processors -->
</annotationProcessorPaths>
</configuration>
</plugin> |
Beta Was this translation helpful? Give feedback.
-
No idea what you tested, but the quick example works: pom.xml: <?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>
<groupId>eu.doppelhelix.test</groupId>
<artifactId>mavenproject1</artifactId>
<version>0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.release>23</maven.compiler.release>
<exec.mainClass>eu.doppelhelix.test.mavenproject1.Mavenproject1</exec.mainClass>
<io.jstach.version>1.3.7</io.jstach.version>
</properties>
<dependencies>
<dependency>
<groupId>io.jstach</groupId>
<artifactId>jstachio</artifactId>
<version>${io.jstach.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.14.0</version>
<configuration>
<release>17</release>
<annotationProcessorPaths>
<path>
<groupId>io.jstach</groupId>
<artifactId>jstachio-apt</artifactId>
<version>${io.jstach.version}</version>
</path>
<!-- other annotation processors -->
</annotationProcessorPaths>
</configuration>
</plugin>
</plugins>
</build>
</project> Mavenproject1.java: package eu.doppelhelix.test.mavenproject1;
import io.jstach.jstache.JStache;
import io.jstach.jstache.JStacheLambda;
import io.jstach.jstachio.JStachio;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.time.temporal.ChronoUnit;
import java.util.List;
public class Mavenproject1 {
public static void main(String[] args) {
Person rick = new Person("Rick", LocalDate.now().minusYears(70));
Person morty = new Person("Morty", LocalDate.now().minusYears(14));
Person beth = new Person("Beth", LocalDate.now().minusYears(35));
Person jerry = new Person("Jerry", LocalDate.now().minusYears(35));
String actual = JStachio.render(new HelloWorld("Hello alien", List.of(rick, morty, beth, jerry)));
System.out.println(actual);
}
@JStache(template = """
{{#people}}
{{message}} {{name}}! You are {{#ageInfo}}{{age}}{{/ageInfo}} years old!
{{#-last}}
That is all for now!
{{/-last}}
{{/people}}
""")
public record HelloWorld(String message, List<Person> people) implements AgeLambdaSupport {
}
public record Person(String name, LocalDate birthday) {
}
public record AgeInfo(long age, String date) {
}
public interface AgeLambdaSupport {
@JStacheLambda
default AgeInfo ageInfo(Person person) {
long age = ChronoUnit.YEARS.between(person.birthday(), LocalDate.now());
String date = person.birthday().format(DateTimeFormatter.ISO_DATE);
return new AgeInfo(age, date);
}
}
} |
Beta Was this translation helpful? Give feedback.
-
IDE has red balls, when I run it it works, but is so bad DX with this red balls |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Why don't you just show your project. Screenshots are beyond useless as I can't place them in my IDE. |
Beta Was this translation helpful? Give feedback.
-
I have some work staff there I'll prepare simple project soon I have time |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
Ok, looked into the processor of Jstachio and there I find: And indeed. When run by the NB infrastructure and break in line 100, I check the two options:
The first variant is used in the code, the second is documented in the code as the "right" variant and indeed the second does the right thing. Easiest solution: Convince JStachio developers to check both options and use the most sensible one. |
Beta Was this translation helpful? Give feedback.
-
As this strayed far from a bug report, I converted this to a discussion. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Apache NetBeans version
Apache NetBeans 26 latest release candidate
What happened
mvn compile
ormvn package
in target I see compiled classes but editor has redcannot find symbol
Language / Project Type / NetBeans Component
java maven projcet
How to reproduce
ManifoldTemplate.java
see result in outputmanifold-template.zip
Did this work correctly in an earlier version?
Apache NetBeans 24
Operating System
win 11
JDK
jdk 8 - 23
Apache NetBeans packaging
Apache NetBeans binary zip
Anything else
No response
Are you willing to submit a pull request?
Yes
Beta Was this translation helpful? Give feedback.
All reactions