0
votes

Till now we are using myeclipse to for development.

Now we started development using eclipse keplar.

My first problem is jars are not deployed in webapps lib directory which we solved by referring [link] Adding 3rd party jars to WEB-INF/lib automatically using Eclipse/Tomcat

but every time if want to add third party jar's dependency then we have to add in build path and Deployment Assembly

so please let me know if there is any workaround to add entry only in build path and this jar is automatically deployed in tomcat directory.

Thanks in advance.

3
right click on project>build path > export/import > add libs - Sachin Verma
i think you want to know how to add jars in eclipse.If this is your requirement then check this stackoverflow.com/questions/19179687/… - SpringLearner
@SachinVerma thanks for reply But i think this option is for exporting war/jar or other file not for running project directly from eclipse.. correct me if i am wrong.. - Darshan Patel

3 Answers

2
votes

Suppose here we have an example to add an external jar using eclipse kepler:

suppose we have have a project here RIGHT-CLICK on it and select its PROPERTIES...

enter image description here

Then click on JAVA-BUILD-PATH..

enter image description here

click on LIBRARIES tab and click on ADD-EXTERNAL-JARS...

enter image description here

now select whatever you want to add an external jar or API and click ok

enter image description here

after taht you will see on libraries CONGRATS you have successfully added a jar file..

enter image description here

1
votes

go to Run > Run Configuration create a configuration node if there isn't any, go to the Classpath tab and add whatever you want: Projects, JARs, External JARs, then they would be deployed, when you run your tomcat.

0
votes

Darshan,

As you have added a "myeclipse" tag, I guess you are using MyEclipse. In this case, just use the deployment assembly to add dependencies, whether it is another project or an external jar file. When added this way, it will automatically be added to the build path (you will see it in the "Web App Libraries" container in the Package Explorer, under the project).

The MyEclipse developers are looking at the possibility of synchronizing the deployment assembly when adding to the build path directly but it's not clear that this is possible. So, just use the deployment assembly, in future, for adding dependencies to web projects.