Closed ivy-lli closed 1 year ago
Possible workaround Generate the meta-model java sources with maven.
Example with the perstistence-utils-demo
Generate first the meta-model sources (java files), then overwrite the default-comileProject
of the project-build-plugin that it should not run the annotation process.
<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.axonivy.utils.persistence</groupId>
<artifactId>persistence-utils-demo</artifactId>
<version>10.0.3-SNAPSHOT</version>
<packaging>iar</packaging>
<dependencies>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-jpamodelgen</artifactId>
<version>5.4.33.Final</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.axonivy.utils.persistence</groupId>
<artifactId>persistence-utils</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>axonivy.public</id>
<url>https://maven.axonivy.com</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<build>
<plugins>
<plugin>
<groupId>com.axonivy.ivy.ci</groupId>
<artifactId>project-build-plugin</artifactId>
<version>10.0.3</version>
<extensions>true</extensions>
<configuration>
<compilerOptions>
<compilerOption>-XprintProcessorInfo</compilerOption>
<compilerOption>-XprintRounds</compilerOption>
</compilerOptions>
</configuration>
<executions>
<execution>
<phase>generate-sources</phase>
<id>generate-meta-model-sources</id>
<goals>
<goal>compileProject</goal>
</goals>
<configuration>
<skipScriptValidation>true</skipScriptValidation>
<compilerOptions>
<compilerOption>-proc:only</compilerOption>
<compilerOption>-s</compilerOption>
<compilerOption>${project.build.directory}/.apt_generated</compilerOption>
</compilerOptions>
</configuration>
</execution>
<execution>
<phase>process-classes</phase>
<id>default-compileProject</id>
<configuration>
<compilerOptions>
<compilerOption>-proc:none</compilerOption>
</compilerOptions>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
The NPE is fixed for the Axon Ivy Designer 10.0.7: XIVY-11172 And it is also fixed in the eclipse.jdt.core project: https://github.com/eclipse-jdt/eclipse.jdt.core/issues/917
Currently, the meta model generation fails if the project contains a dependency to a packed iar project.
Way to reproduce:
Error: Errors running builder 'Java Builder' on project 'persistence-utils-demo'.
Is is a know problem that the method
IResource#getLocation
return null on packed iar projects. So we should maybe add a hint in the product Readme.md that this doesn't work.@peters-axon FYI