| View previous topic :: View next topic |
| Author |
Message |
emmbec
Joined: 27 Nov 2008 Posts: 49 Location: Queretaro, Mexico
|
Posted: Fri Jun 26, 2009 3:25 pm Post subject: Create Single JAR file from a Module |
|
|
Hi I created a NetBeans Platform application with lots of modules, it has a very nice GUI and it works perfectly fine, however I have been asked to create some sort of API that I can use inside Matlab to call some functionalities of my NetBeans Platform application from within it, functionalities that are not GUI related. I already know how to call a JAR file from Matlab, however what I don't know is how to create a single JAR file for an specific module.
Let me explain a little more what I want to achieve, I have one module (Module A) that includes like three more modules and some NetBeans platform APIs. What module A does is basically wrapps up all of the other module features into a single class, and I would like to create a single JAR file for Module A, that includes ALL the other modules and NetBeans JARs, so that I can use that single JAR file inside Matlab.
Can I create a single JAR file for a module that includes all of its libraries on that same JAR?
I looked at some post where they said that I could do simething like this:
| Code: | <target name="-pre-jar">
<unjar src="${file.reference.MyObject.jar}" dest="${build.classes.dir}"/>
</target> |
But I don't know what to write in the file.reference section...
Any help is highly appreciated.
Thanks! |
|
| Back to top |
|
 |
emmbec
Joined: 27 Nov 2008 Posts: 49 Location: Queretaro, Mexico
|
Posted: Mon Jun 29, 2009 11:49 pm Post subject: |
|
|
Ok I beleive it is not possible then, what I did right now was to create a new Java Project and then included the built JARs that I need from my NetBeans Platform application into that project, this way if I make any change in the Platform application I will just need to build that Platform application and then go to my Java project and recompile with the pre-jar options to get a single JAR file with all of the classes and objects I need. Its a bit messy but this way I can have my API separated from my platform project but include the necessary module classes that I need for my API.
Thanks anyway, hope this helps someone else. |
|
| Back to top |
|
 |
Oliver Rettig Posted via mailing list.
|
Posted: Tue Jun 30, 2009 1:07 pm Post subject: Create Single JAR file from a Module |
|
|
Hallo,
I had a simlar problem. And I descided to create normal java SE projects for
the APIs I also want to use in the Matlab environment. Then I create Library-
wrapper modules for them to use them in my netbeans app. This works well.
There is a nice blog from Geertjan which describes how to change the build
scripts etc. to manage that after changes all is up to date: The wrapper
module links to the jar in the se project etc.
I don not remember the link the blog but I think you can find it.
best regards
Oliver
| Quote: | Ok I beleive it is not possible then, what I did right now was to create a
new Java Project and then included the built JARs that I need from my
NetBeans Platform application into that project, this way if I make any
change in the Platform application I will just need to build that Platform
application and then go to my Java project and recompile with the pre-jar
options to get a single JAR file with all of the classes and objects I
need. Its a bit messy but this way I can have my API separated from my
platform project but include the necessary module classes that I need for
my API.
Thanks anyway, hope this helps someone else. |
|
|
| Back to top |
|
 |
Fabrizio Giudici Posted via mailing list.
|
Posted: Tue Jun 30, 2009 1:55 pm Post subject: Create Single JAR file from a Module |
|
|
Oliver Rettig wrote:
| Quote: | Hallo,
I had a simlar problem. And I descided to create normal java SE projects for
the APIs I also want to use in the Matlab environment. Then I create Library-
wrapper modules for them to use them in my netbeans app. This works well.
There is a nice blog from Geertjan which describes how to change the build
scripts etc. to manage that after changes all is up to date: The wrapper
module links to the jar in the se project etc.
I don not remember the link the blog but I think you can find it.
best regards
Oliver
| Quote: | Ok I beleive it is not possible then, what I did right now was to create a
new Java Project and then included the built JARs that I need from my
NetBeans Platform application into that project, this way if I make any
change in the Platform application I will just need to build that Platform
application and then go to my Java project and recompile with the pre-jar
options to get a single JAR file with all of the classes and objects I
need. Its a bit messy but this way I can have my API separated from my
platform project but include the necessary module classes that I need for
my API.
|
| I'm trying to solve this stuff in the opposite way: having a JSE project
which delivers a JAR, plus an already packed NBM. At the moment I'm
playing with a specific Maven plugin, but I know for sure there's an Ant
extension written by Tim Boudreau... I seem to recall he blogged about
that quite a few time ago. Tim?
--
Fabrizio Giudici - Java Architect, Project Manager
Tidalwave s.a.s. - "We make Java work. Everywhere."
weblogs.java.net/blog/fabriziogiudici - www.tidalwave.it/blog
address-removed - mobile: +39 348.150.6941 |
|
| Back to top |
|
 |
tomwheeler
Joined: 03 Sep 2008 Posts: 564
|
Posted: Tue Jun 30, 2009 5:28 pm Post subject: Create Single JAR file from a Module |
|
|
I am not Tim, of course, but is this the Ant extension you have in mind?
http://weblogs.java.net/blog/timboudreau/archive/2007/02/generate_a_netb.html
On Tue, Jun 30, 2009 at 8:30 AM, Fabrizio
Giudici<address-removed> wrote:
| Quote: | I'm trying to solve this stuff in the opposite way: having a JSE project
which delivers a JAR, plus an already packed NBM. At the moment I'm playing
with a specific Maven plugin, but I know for sure there's an Ant extension
written by Tim Boudreau... I seem to recall he blogged about that quite a
few time ago. Tim?
|
--
Tom Wheeler
http://www.tomwheeler.com/ |
|
| Back to top |
|
 |
Fabrizio Giudici Posted via mailing list.
|
Posted: Tue Jun 30, 2009 5:35 pm Post subject: Create Single JAR file from a Module |
|
|
Tom Wheeler wrote:
Yes Tim or Tom didn't make any difference in this case :-D
--
Fabrizio Giudici - Java Architect, Project Manager
Tidalwave s.a.s. - "We make Java work. Everywhere."
weblogs.java.net/blog/fabriziogiudici - www.tidalwave.it/blog
address-removed - mobile: +39 348.150.6941 |
|
| Back to top |
|
 |
Eser Rashawn
Joined: 04 Jul 2009 Posts: 3
|
Posted: Sat Jul 04, 2009 8:56 pm Post subject: Create Single JAR file from a Module |
|
|
Hi
I created a NetBeans Platform application with lots of modules, it has a very nice GUI and it works perfectly fine, however I have been asked to create some sort of API that I can use inside Matlab to call some functionalities of my NetBeans Platform application from within it, functionalities that are not GUI related. I already know how to call a JAR file from Matlab, however what I don't know is how to create a single JAR file for an specific module.Let me explain a little more what I want to achieve, I have one module (Module A) that includes like three more modules and some NetBeans platform APIs. What module A does is basically wrapps up all of the other module features into a single class, and I would like to create a single JAR file for Module A, that includes ALL the other modules and NetBeans JARs, so that I can use that single JAR file inside Matlab.
Can I create a single JAR file for a module that includes all of its libraries on that same JAR?
I looked at some post where they said that I could do simething like this:
Code:
<target name="-pre-jar">
<unjar src="${file.reference.MyObject.jar}" dest="${build.classes.dir}"/>
</target> _________________ softphone
|
|
| Back to top |
|
 |
|