RapidProM extension issue
Hi community,
I'm new to this forum and I hope I found the right place for discussing my problem. I found the manual for developing new RapidMiner extensions very useful. The initial project setup worked fine for me until I had to configure the dependencies on other RapidMiner extensions. Since I want to develop something that complements the RapidProM I thought it would me a good idea to add RapidProM to the gradle dependencies. Unfortunately I have no idea what information I have to fill in for "extension namespace" and "version". This seems somehow a different configuration style than with third-party-library dependencies. It would be awesome, if anybody already found a solution or had a hint for me.
Thank you very much in advance and kind regards,
Lars
Best Answer
-
Hi Lars,
you can add a RapidMiner plugin dependency to your extension by adding the following line to your build.gradle file:
[...]
extensionConfig {
name 'Your Extension Name'
dependencies {
extension namespace: 'extensionId', version: 'extensionVersion'
}
}
[...]So in regard to the ProM extension it would look like this:
[...]
extensionConfig {
name 'Your Extension Name'
dependencies {
extension namespace: 'rapidprom', version: '4.0.0'
}
}
[...]You can retrieve the the extension namespace attribute by looking inside the build.gradle of the dependent extension, or by exploring the corresponding jar file.
It might happen that the extension is not published via any repository, so gradle cannot resolve the defined dependency. To resolve this issue simply create a libs folder in your extension root folder and copy the dependent extension jar to this folder. Afterwards add the following line to your (global) init.gradle file:
[...]
repositories {
flatDir {
dirs 'libs'
}
[...]
}As consequence gradle will now also search in the created libs folder for the dependencies.
Cheers,
Marcel
2
Answers
-
It would also be a first step for me if I knew how to identify the extension namespace and extension version of RapidMiner extensions in general so that the gradle dependency works. Thx once again!
0 -
Hi Lars,
you can add a RapidMiner plugin dependency to your extension by adding the following line to your build.gradle file:
[...]
extensionConfig {
name 'Your Extension Name'
dependencies {
extension namespace: 'extensionId', version: 'extensionVersion'
}
}
[...]So in regard to the ProM extension it would look like this:
[...]
extensionConfig {
name 'Your Extension Name'
dependencies {
extension namespace: 'rapidprom', version: '4.0.0'
}
}
[...]You can retrieve the the extension namespace attribute by looking inside the build.gradle of the dependent extension, or by exploring the corresponding jar file.
It might happen that the extension is not published via any repository, so gradle cannot resolve the defined dependency. To resolve this issue simply create a libs folder in your extension root folder and copy the dependent extension jar to this folder. Afterwards add the following line to your (global) init.gradle file:
[...]
repositories {
flatDir {
dirs 'libs'
}
[...]
}As consequence gradle will now also search in the created libs folder for the dependencies.
Cheers,
Marcel
2 -
Hi Marcel,
thank you very much for your detailed and helpful response! Actually, I've run exactly into the issue that the extension does not seem to be published via any repository. Consequently, the following configuration does not work:
[...]
extensionConfig {
name 'Your Extension Name'
dependencies {
extension namespace: 'rapidprom', version: '4.0.0'
}
}
[...]But the second suggestion worked for me (at least I'm able to build my own extension so far). What I did:
- I've cloned the RapidProM repository: https://github.com/rapidprom/rapidprom-source,
- I've build the extension with the command: gradle clean build -x checkstyleMain (the exclusion of checkstyleMain was necessary since some Java classes seem to violate the coding style guidelines),
- I've created a folder called "libs" in my own extension project root and put the rapidprom-source-4.0.0.jar into it,
- I've added the following code snippet to my "build.gradle" configuration (thx to Marcel):
[...]
repositories {
flatDir {
dirs 'libs'
}
[...]
} - Since I'm using Eclipse, I was able to build the project after Right-click on Project -> Gradle -> Refresh Gradle Project
The final step, I still have to do, is to install the plugin in the RapidMiner platform. I will come back to this topic as soon as I did this.
Thank you once again for your help and kind regards,
LarsP.S.: I was a bit suprised that it was not possible to just use the rapidprom-source repository URL somehow to configure a new repository gradle uses for locating dependencies. Maybe I used a wrong configuration.
0 -
Hi Lars,
actually you don't need to build the extension on your own. You can also download the jar file directly from the marketplace.
Cheers,
Marcel
0 -
Hi Marcel,
again thank you very much for the hints! I will use the marketplace files for future build runs of my own extension.
I recently was thinking about potential conflicts and compatibility issues when I integrate my own extension containing the RapidProM extension as a library. So actually the most important question is whether the RapidMiner platform recognizes the RapidProM extension library in my own extension and "knows" that it is the same like the previously installed extension I need in order to use its operators. Or should I exclude RapidProM from the build contents and use it just for development since RapidMiner takes care for the dependency itself? This is currently the last building brick to get the things to work, I think.
Thx once again and kind regards,
Lars0 -
Hi Lars,
you should not bundle other extensions - depending on the extension license you might even violate it. Also the bundling of other extensions does not work well with our existing plug-in mechanism.
If the required extension is not available RapidMiner will print out a log message with the required extension and version number. If you publish your extension via the Marketplace, all required extensions will be checked and will also be installed.
Cheers,
Marcel
0 -
Hi Marcel,
thank you for the latest and the previous hints. Finally it works perfectly for me!
Cheers and thx again,
Lars0