How to exclude quarkus from an external package (ai.timefold.solver.quarkus)?

80 views Asked by At

I have an error like that

java.lang.RuntimeException: java.lang.RuntimeException: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
        [error]: Build step ai.timefold.solver.quarkus.deployment.TimefoldProcessor#recordAndRegisterBeans threw an exception: java.lang.IllegalStateException: Multiple classes ([Model1.domain.Solution1Table, Model2.domain.Solution2Table]) found with a @PlanningSolution annotation.

And I've got a piece of advise to exclude timefold-quarkus module.

I've tried to remove this module through application.properties

quarkus.arc.exclude-types=ai.timefold.solver.quarkus**,ai.timefold.solver.quarkus*,ai.timefold.solver.quarkus

I've tried to remove this module through pom.xml At first:

      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>${compiler-plugin.version}</version>
        <configuration>
          <compilerArgs>
            <arg>-sourcepath</arg>
            <arg>doesnotexist</arg>
          </compilerArgs>
          <excludes>
            <exclude>**/ai/timefold/solver/quarkus/*</exclude>
          </excludes>
        </configuration>
      </plugin>

then:

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <version>3.2.0</version>
        <configuration>
          <excludes>
            <exclude>**/ai/timefold/solver/quarkus/*</exclude>
          </excludes>
        </configuration>
      </plugin>

At last:

      <dependency>
        <groupId>ai.timefold.solver</groupId>
        <artifactId>timefold-solver-bom</artifactId>
        <version>${version.ai.timefold.solver}</version>
        <exclusions>
          <exclusion>
            <groupId>ai.timefold.solver</groupId>
            <artifactId>timefold-solver-quarkus</artifactId>  
        </exclusion>
        </exclusions>
        <type>pom</type>
        <scope>import</scope>
      </dependency>

Nothing helps.

1

There are 1 answers

2
Lukáš Petrovický On BEST ANSWER

There is no way to remove Quarkus from Timefold Solver's Quarkus support module.

I understand what the original advice was trying to say, but it was perhaps not very clear. The point of the original advice was not to use the timefold-solver-quarkus module at all and use the basic timefold-solver-core module instead. Whether that is feasible in your case, I do not know.