In Anypoint Studio 7.x/Mule 4.x connectors are not installed into Studio as in previous versions. They are Maven dependencies, because all Mule 4.x projects are Maven based. So the problem is to install the Maven dependency for the Mule 4 Kafka connector into your local Maven directory. This is done automatically by Maven when building a project assuming there is internet access. In your case there is no internet access, that is the way Maven expects to work. You can try one of the following alternatives, but neither is perfect for every scenario:
- (Recommended) Install a Maven proxy: some Maven servers support working as proxies
of other repositories. It would need internet access, and you have to
configure your settings.xml to use the server as a proxy, instead of
accessing the internet directly. Your company would have to allow
internet access for the proxy. This method is the more simpler to use once the setup is done. You don't need to do anything for new releases of dependencies. Having said that the new server will require some administration.
- Install the jar dependency in the
local repository: if you have the jar file for the connector you can
try to install it locally with the command
mvn install:install-file -Dfile=<path-to-file>
. Note that connectors are like other Maven dependencies and have their own dependencies. You will have to be
sure to add those dependencies too for the build to work. You will
need to repeat this process every time there is a new release that
you want to use. The command to install a dependency from a jar built from Maven works in recent versions of Maven. If using an older version -not recommended- you will have to use a less convenient alternative: https://maven.apache.org/guides/mini/guide-3rd-party-jars-local.html
- Copy the local repository dependencies from another
computer: build a project with the Kafka connector from a computer
with access to internet, then copy the dependencies from the local
repository (Linux/mac:
~/.m2/repository
, Windows:
%USERPROFILE%.m2
to your restricted computer. Note that copying
the entire repository might override dependencies that were installed
manually. You might want to cherry pick the dependencies of the
connector and copy those directories only. You will need to repeat
this process every time there is a new release that you want to use.
The connector will not be visible in Studio palette until you add it to the project, by adding its dependency to the pom.xml file of the project as documented at https://docs.mulesoft.com/kafka-connector/4.4/kafka-connector-xml-maven#add-a-pom-file-dependency
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…