Maven Dependency classes are not resolved in runtime eclipse during plugin development

285 Views Asked by At

I am trying to create an Eclipse plugin-in project. The functionality of the plug-in is to simply send a gRPC request to another server.

So, I have included the required Maven Dependencies as below:

(Based on the documentation, https://github.com/grpc/grpc-java#readme )

<dependencies>
    <dependency>
        <groupId>io.grpc</groupId>
        <artifactId>grpc-netty-shaded</artifactId>
        <version>1.41.0</version>
    </dependency>
    <dependency>
        <groupId>io.grpc</groupId>
        <artifactId>grpc-protobuf</artifactId>
        <version>1.41.0</version>
    </dependency>
    <dependency>
        <groupId>io.grpc</groupId>
        <artifactId>grpc-stub</artifactId>
        <version>1.41.0</version>
    </dependency>
    <dependency> <!-- necessary for Java 9+ -->
        <groupId>org.apache.tomcat</groupId>
        <artifactId>annotations-api</artifactId>
        <version>6.0.53</version>
        <scope>provided</scope>
    </dependency>
</dependencies>

But when I try to launch the application in runtime-Eclipse, the gRPC dependencies are not resolved and so I am getting the below error:

!ENTRY org.eclipse.e4.ui.workbench 4 0 2021-10-28 08:19:37.492
!MESSAGE Unable to create class 'grpcclientmyplugin.parts.SampleView' from bundle '23'
!STACK 0
org.eclipse.e4.core.di.InjectionException: java.lang.NoClassDefFoundError: io/grpc/Channel
    at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:414)

I think the Maven Dependencies are not detected by the launched Eclipse Application.

But if I create a normal maven project and execute it, everything is working fine.

I am not sure what needs to be configured (something like Target Platform or VM arguments) so that I can create an Eclipse plug-in that can send gRPC requests.

Any help is highly appreciated.

0

There are 0 best solutions below