I need to execute a maven plugin on a system that does not have both maven and java installed and installing both of them on the system is not an option. While searching for the ways, I found out that by using gradle we can build executable binaries that does not even require gradle to get executed, which perfectly fits my situation . Is there any way to execute maven plugins by using gradle. Thanks in advance
Just read the article, but it is on how to execute maven goals programatically which has the requirement of both
maven being installed on the system. What I need is a way to run
maven plugins in a environment where both
java does not exists. For example, by executing a binary built from
gradle ( that can be run without gradle being installed) which run specified
maven plugings inside it. Is there a way to reach that?
It’s probably best to split this into the individual pieces
- You want to build an application
- Which executes a maven plugin without installing maven
- Which runs without a pre-installed jre
- Can be solved using gradle (or maven or ant)
- Can be solved with maven embedder
I’m not 100% sure how to solve 3, perhaps you could pack a jre inside your application zip and have a batch file (windows) or shell script (xnix) which fires java from the packed jre
Thank you Lance for your valuable time. Could you please be kind enough to inform me if you find out a way to solve the third part of the question ( Which runs without a pre-installed jre)
As I said, you’ll probably need to pack the JRE inside your application and have a batch file / shell script which invokes
java from the embedded JRE. Do you need to support multiple operating systems? If so you’ll probably need multiple versions (flavours) of your app since each OS has its own version of the JRE.
There’s likely licensing issues embedding the Oracle JRE, you might find the OpenJDK JRE has a more permissive license.