2
votes

I have a quarkus application which has dependencies to another maven module within the same project within that module are REST endpoints

For some strange reason i cannot access those endpoints tho.. It seems quarkus will only accept endpoints of java classes within the quarkus module, or am I mistaken?

3

3 Answers

2
votes

I foudn a solution: if yopu add the jandex, endpoiints of other modules are being scanned, and can thus be found :

<build>
    <plugins>
        <plugin>
            <groupId>org.jboss.jandex</groupId>
            <artifactId>jandex-maven-plugin</artifactId>
            <version>1.1.0</version>
            <executions>
                <execution>
                    <id>make-index</id>
                    <goals>
                        <goal>jandex</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>
1
votes

Check https://quarkus.io/guides/cdi-reference. You need to add a beans.xml to external models, create an index or reference the dependency using quarkus.index-dependency in the application.properties.

Then it will work when running tests or using the runner. But not in dev, because there is a probably in the current version (1.1.1Final). This problem has been fixed in the master, though, and will be available in the next release next month.

Please check ClassCastException in Quarkus multi-module project for more details.

1
votes

You can do this by creating a dummy extended class:

Lets assume your imported jar has this pattern, app\proto-gen\1.0-SNAPSHOT\proto-gen-1.0-SNAPSHOT.jar

Add the below to application.properties,

quarkus.index-dependency.mygrpc.group-id=app
quarkus.index-dependency.mygrpc.artifact-id=proto-gen
@Singleton
 MyGrpc extends XImplBase{
  //your implementation
}

beans you extended/implemented in your current project will be started.