on 12-19-2006 3:10 PM
Hi there,
I have an EAR file/project that includes a standard Java project. Both projects are in the same workspace.
The standard java project references an external jar file. This external file is not marked under "Order and Export" in the java build path settings, so I shouldn't be exported.
Unfortunally the external jar file will always be included in the EAR file, even if it's excluded in my standard java project. Is there a possibility to prevent this?
(The jar file is sapjco.jar that should never be deployed to the J2EE server).
First I thought about a library project, but I don't think it's possible to include an external jar file there that can be used in my standard java project.
Has anybody an idea how to use the external jar file during development and leaving it out when building an EAR file?
Best regards,
Markus
Hi Markus,
If you are specific about the sapjco.jar, instead of including it in the project references you can include it as a Used DC. But for this you need to have JDI environment. You can follow this steps to include it as Used DC:
Expand your project -> DC Meta Data -> DC Definition -> Used DCs
Right click on Used DCs -> choose the development track -> SAP-JEE -> com.sap.mw.jco.
Choose finish. It will be added to your as used DC, and the JAR file also wont be generated.
Even if you want to use Library project also you should create project as DC Project only. But for sapjco you need not create new project as the DC all ready exist.
Regards
Abhilash
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Markus,
I didnt find any other way to exclude the file from .ear, but I can give alternate solution. I dont know if its a correct way to do it or not..
You can try this..
Copy the sapjco.jar to any of the standrad Class Path Variables:
for example:
Copy the jar file to <b>TSSAP_JAVAX_HOME/lib/</b> (You can find it in the Java build path library).
Then add the environment variable to the path. Follow this steps:
In libraries -> Add Variable -> TSSAP_JAVAX_HOME -> Extend -> From the folder structure select the jar file.
This file will be available for compilation, but it wont be there in generated ear file.
Regards
Abhilash
Hello Abhilash,
thanks, that works fine.
I addition I think it is correct way. You just have to take care that you re-copy the libraries when you install a newer version of NWDS. But I'll try around a little bit if those jars might also be excluded by defining an own variable.
Thanks for your help,
Markus
Markus,
Eclipse ignores the standard variables only. If you define new variables again, then again libraries will be copied to the generated archive. That's the reason I have chosen standard SAP variable. What we can do is, we need to find out where this standard variables are configured, so that we can define custom variable also as standard project variable. I will try in that way and update you.
Regards
Abhilash
Hi Abhilash,
hi Markus
I could confirm that defining your own variable works.
I created an user library "SAP_PI_RUNTIME_LIBS" in NWDS preferences Java -> Build Path -> User Libraries and added all PI runtime libs which are already available on the server and therefore not have to be included in the ear file.
In the EJB project I am referencing / using these libs by adjusting Build Path, Tab Libraries -> Add Library "User Library" and select the beforehand defined user library "SAP_PI_RUNTIME_LIBS".
As a result during build of ear these jars are excluded.
Best regards
Jochen
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.