Author |
Message
|
junzi88 |
Posted: Fri May 22, 2015 7:43 am Post subject: mqsipackagebar archive dependent java lib twice |
|
|
Novice
Joined: 25 Sep 2013 Posts: 16
|
We use ant to build bar file in Jenkins. First the ant script call mqsicreatebar to compile application project with compileOnly. This project reference another java project. We put all apache dependent jars inside java project lib directory. The second step calls mqsipackagebar which use com.ibm.broker.config.appdev.FlowRendererBar". The second step does jar the java project as jar with those apache dependent jars inside. However, insider final bar file and inside .appzip, those dependent jars are archived again along with java project jar file at same level. I tried to use -d -y apachedxxx.jar. It does not work. The bar is not generated. With duplicated apache jar file inside the bar, the bar file works on broker but when we use toolkit to build bar file, the apache jars are not duplicated, they are in java project lib directory. Anyone has idea how to use mqsipackagebar to package bar same as Toolkit does? How to use -d option correctly? |
|
Back to top |
|
 |
mqjeff |
Posted: Fri May 22, 2015 8:01 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Is toolkit build set to use mqsicreatebar or mqsipackagebar ? |
|
Back to top |
|
 |
junzi88 |
Posted: Fri May 22, 2015 12:44 pm Post subject: |
|
|
Novice
Joined: 25 Sep 2013 Posts: 16
|
How can I know which command my toolkit used when I used New Bar file in pop menu. Project->Build for msqipackagebar says bar has been created. I am guessing it is using msqipackagebar.
The bar that my script created with duplicate dependant jars does not really work. Some function is fine some not. I still need find the solution to use script to build. |
|
Back to top |
|
 |
mqjeff |
Posted: Tue May 26, 2015 5:16 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
junzi88 wrote: |
How can I know which command my toolkit used when I used New Bar file in pop menu. Project->Build for msqipackagebar says bar has been created. I am guessing it is using msqipackagebar.
The bar that my script created with duplicate dependant jars does not really work. Some function is fine some not. I still need find the solution to use script to build. |
The Toolkit will show you the exact command at the bottom of the Bar File Editor - if you're on the right tab. |
|
Back to top |
|
 |
junzi88 |
Posted: Tue May 26, 2015 7:28 am Post subject: |
|
|
Novice
Joined: 25 Sep 2013 Posts: 16
|
On the Manage tab, after expended Command for packaging the BAR contents, it shows mqsipackagebar -a <barName> -w <rootLocaion> -k myApp. However, when I just used this command to build whole appliation, the bar does NOT contain the java project which is supposed to build as a jar file. The bar does contains the thid party jars, like apache jars and other refrenced projects as .libzip. I know it only package the bar, not build the whole thing. Then I came back to my old approach to use mqsicreatebar. Instead of just using -compileOnly, I added -b option to have it create bar file. Finally it built a bar as I expected. Thank you so much Jeff for your hint. |
|
Back to top |
|
 |
mqjeff |
Posted: Tue May 26, 2015 7:37 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
You will have to add the java projects to the command.
Also make sure that they exist in the workspace you are building from... |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue May 26, 2015 8:25 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Would'nt the compile-only create the jar files? Then the dependency for the project should add them in..., at least that's the theory  _________________ MQ & Broker admin |
|
Back to top |
|
 |
junzi88 |
Posted: Tue May 26, 2015 8:58 am Post subject: |
|
|
Novice
Joined: 25 Sep 2013 Posts: 16
|
It appears -compileOnly did not really work. The bar file I created earlier with -compileOnly and -b has .cmf files. The java project is created as jar file. When I tried to deploy the bar, I got errors. The esql files could not be found. Then I removed -compileOnly, the result is same. The java code was recompiled but it still created .cmf file. After I used -deployAsSource, not -compileOnly, It created the bar file that is working after I deployed on broker server.
Jeff, I put java project, application, other 3 lib projects at same level. So the final bar has all of them. Now I can use maven to automatically build it in Jenkins. Thanks! |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue May 26, 2015 3:36 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Have you tried using -deployAsSource and -compileOnly together when running mqsicreatebar ?
You should then be able to run mqsipackagebar  _________________ MQ & Broker admin |
|
Back to top |
|
 |
junzi88 |
Posted: Wed May 27, 2015 5:26 am Post subject: |
|
|
Novice
Joined: 25 Sep 2013 Posts: 16
|
mqsipackagebar archive the same jar twice as I described earlier. Maybe it is default behavior and no negative impact during runtime. But it is not same Toolkit does. |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed May 27, 2015 5:33 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
junzi88 wrote: |
mqsipackagebar archive the same jar twice as I described earlier. Maybe it is default behavior and no negative impact during runtime. But it is not same Toolkit does. |
Don't see this behavior in IIB 9001  _________________ MQ & Broker admin |
|
Back to top |
|
 |
|