0

I am trying to use the GraphQL router for MuleSoft components which is available at MuleSoft labs GitHub repository at https://github.com/mulesoft-labs/graphql-router

Created a Folder in your local system: graphql-demo. In command prompt typed the following command:

git clone https://github.com/mulesoft-labs/graphql-router.git

Once the project was cloned in my local system, I went to pom.xml and changed the mule-modules-parent version from 1.0.0 to 1.1.3.

From the location where project is cloned went to command prompt and ran command:

mvn clean install

The project was not built successfully please assist.

Error: Some problems were encountered while processing the POMs: resolvable build extension: plugin org.mule.runtime.plugins:mule-extensions-maven-plugin:1.1.6 or one of its dependencies could not be resolved: Failed to read artifact description for org.mule.rntime.plugins:mule-extensions-maven-plugin:jar:1.1.6.

I am trying to understand how to use GraphQL with mulesoft any suggestions would help.

Is this the right approach to use GraphQL for Mulesoft?

1 Answers1

1

The actual root error is missing in your question:

Caused by: org.eclipse.aether.transfer.NoRepositoryConnectorException: Blocked mirror for repositories: [mulesoft-plugin-releases (http://repository.mulesoft.org/releases/, default, releases+snapshots), mulesoft-plugin-snapshots (http://repository.mulesoft.org/snapshots/, default, releases+snapshots)]

The issue is that newer Maven versions have increased security restrictions for repositories with http:... URLs. You can resolve that issue by adding unblocked mirrors for the repositories that fail but pointing them to the https:... URLs. Add this snippet in the <mirrors> element of your Maven settings.xml file:

    <mirror>
      <id>my-repository-http-unblocker1</id>
      <mirrorOf>mulesoft-plugin-releases</mirrorOf>
      <name></name>
      <url>http://repository.mulesoft.org/releases/</url>;
      <blocked>false</blocked>
    </mirror>

    <mirror>
      <id>my-repository-http-unblocker2</id>
      <mirrorOf>mulesoft-plugin-snapshots</mirrorOf>
      <name></name>
      <url>http://repository.mulesoft.org/snaphosts/</url>;
      <blocked>false</blocked>
    </mirror>    

Ensure that the build is done with a JDK 8, like OpenJDK 8, or it might fail for a different reason.

Note that the graphql-router is an open source community project that has not been updated in a couple years, not an official MuleSoft product.

aled
  • 21,330
  • 3
  • 27
  • 34
  • Thank you very much that was helpful. My build was successful after adding the mirror element in my Maven Setting.xml. Is this the right approach to use GraphQL? Do we have other options recommended by Mulesoft? – user1987750 Jun 17 '21 at 14:42
  • If you mean for Mule runtime I'm not aware of other official components. Other MulesSoft products support GraphQL in different ways. It depends on what are you trying to do. There's no right answer. – aled Jun 17 '21 at 16:23
  • "Ensure that the build is done with a JDK 8, like OpenJDK 8, or it might fail for a different reason." Does that mean we should not install JDK version other than 8? Like OpenJDK 11? The build failed on my personal computer, I am not sure what is different . – user1987750 Jun 17 '21 at 16:27
  • You can install whatever Java version you want, just ensure to use a JDK 8 for this particular build. I had problems with JDK 11 until I switched the version used. – aled Jun 17 '21 at 16:29
  • What could this mean? [ERROR] Failed to execute goal org.bsc.maven:maven-processor-plugin:2.2.4:process (process) on project mule-module-graphql: Error executing: java.lang.ExceptionInInitializerError: java.lang.reflect.InaccessibleObjectException-->Unable to make protected final java.lang.Class java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain) throws java.lang.ClassFormatError accessible: module java.base does not "opens java.lang" to unnamed module @57ad1178 – user1987750 Jun 17 '21 at 16:32
  • That's caused by building with a newer JDK than JDK 8. See https://stackoverflow.com/a/41265267/721855 – aled Jun 17 '21 at 17:00