I created a maven project with JADE framework as a dependency but this framework requires different commands to execute the jar than ordinary java applications.
Build:
javac –classpath <JADE-classes> Class_name.java
Run:
java –classpath <JADE-classes> jade.Boot <agent-local-name>:<fully-qualified-agent-class>
Where <fully-qualified-agent-class>
is package_name.Class_name
or
java –cp lib\jade.jar jade.Boot [options] [AgentSpecifierlist]
Is it possible to build a runnable jar using maven plugins so I just type java -jar myjar.jar
instead of the command above?
Would mvn eclipse:eclipse
command change build parameters of the eclipse project after editing the pom.xml file?
A better solution for this :
There isn't any such plugin available for JADE because it is not widely used framework and anyone hasn't bothered to develop a plugin for it. But there is a workaround to run it the conventional way, but this would only work if you already know your
<fully-qualified-agent-class>
names. what you can do is write a class that extendsThread
and from thatThread
'srun()
method invoke the JADE framework agent by passing the<fully-qualified-agent-class>
as arguments. Refer to an example below.jadeBootThread.java
Now you can invoke this thread from your main method or any other way by creating runnable jar file with eclipse plugin etc.