IvyDe Eclipse plugin - how to exclude jar files - eclipse

I set up IVY with Ant and able to build a spring mvc project. I have configurations such as provided, compile, test, runtime etc and setup classpath as needed in build.xml for various tasks, ear file, unit test etc.
However I recently installed IvyDE plugin to manage classpath to automate everything from eclipse IDE. provided jar files are app server specific and i don't want them to be included in the classpath of eclipse. Is there a way to not include some dependencies (jar files) with certain conf.

I guess that the Ivy configuration you want in Eclipse is the "runtime" one. Then go into the configuration of the classpath container in Eclipse and select the appropriate Ivy configuration in the suggested list.
See the online documentation:
http://ant.apache.org/ivy/ivyde/history/latest-milestone/cpc/edit.html
http://ant.apache.org/ivy/ivyde/history/latest-milestone/images/ivy_file_def.jpg

Related

How to make M2E (Maven for eclipse) include required eclipse projects in WAR

I'm starting to use Maven (M2E) on Eclipse.
I have two projects
->Tools
->Main
The Main project requires the Tools project. I add "Tools" under the "Main"->"Deployment assembly" option, and when exporting to WAR, the WAR will automatically contain also Tools.jar. This is correct.
Now I installed M2E on the Main Project, to manage some spring dependencies. When I edit the pom.xml, Maven starts, and correctly downloads the Spring jars, but it removes the Tools project from the "Deployment assembly" option (it disappear from the org.eclipse.wst.common.component eclipse configuration file)
As a result, when I export the WAR from Eclipse->Export, the war will not contain Tools.jar, so the webapp will not work.
How do I configure pom.xml to do what Eclipse does with the "deployment assembly"?
That is, package all classes and resources and jar dependencies of the Tools project?
I think that I'm missing some understanding of Maven, but I've not been able to google about it?
thank you

Eclipse OSGi (Kura) Plugin and Maven

I have a simple basic question. If I develop plugin for Kura in eclipse with maven, can I use dependency feature of Maven? I mean, when I use Maven for my Spring projects, I simple add dependency to pom.xml file and I can use in my project. Since I run Spring project on my local machine, dependent .jar files can be used runtime. This time, I will deploy my plugin to another device (Raspberry) , I have to put everything in the bundle .jar package. Can Maven do this or should I add dependent .jar files to classpath manualy?
You can use maven shade plugin to build the so called uber-jar - one jar that will contain your project along with all the dependencies.

Maven Eclipse Runtime Plugin Dependency

We have a multi-module maven project that was recently converted from Ant+Ivy. One of the modules is a legacy custom pluggable component which looks for plugins on the classpath and loads them. Another module in the multi-module project is a plugin implementation that is run by the aforementioned plugin.
When running our custom application server from an eclipse run configuration, we must include each of our plugins on the classpath. As we build within the eclipse workspace these plugins are not compiled to a jar. Hence, there is no jar artifact to include.
If I add the plugin module project as a dependency in the eclipse run configuration, its transitive dependencies (supplied by Maven) are not inherited. Hence, class not found exceptions occur when the plugin is found and loaded by the Application Server.
The problem here is that upon importing the multi-module project, the m2e plugin does not set the maven container to be exported. Thus the missing transitive dependencies.
Is there any way to make this work whilst still running in eclipse using "build in workspace" for both the Application Server component and its plugins.
Ivy is just a dependency management tool where as Apache Maven is a software project management.
Means It can handle all process in software development like compiling,building it to jars, search for depencies,linking, etc.
you no need to give your jars in classpath instead put it in your local repository or edit the pom.xml to fetch from remote repository.
this link http://ant.apache.org/ivy/history/2.0.0/use/makepom.html

How can you specify where Maven puts the dependent JARs?

I have configured my POM to include the Maven-Surefire plugin, as well as a dependency to a repository with some Selenium stuff.
After running mvn eclipse:eclipse, my project now has 100 jars, including the Jetty, Spring, and Selenium jars, all at the root of the project.
The project builds and runs fine, but how can I put the jars into a directory so it doesn't look so bad? Is this something I can configure in the POM?
Instead of using the maven eclipse plugin ("mvn eclipse:eclipse"), you could use maven eclipse integration plugin (m2eclipse), all your jars will stay in the local repository.

Why does eclipse not find the beans.xml files in a spring based Maven project

I have a maven project under eclipse with m2eclipse.
WHen running integration tests the tests fail with the mention that the spring configuration files cannot be found on the classpath, and I get a similar error from log4j.
I was under the impression that m2eclipse would add the resources directories to the classpath but apparently not.
What am I doing wrong?
sometimes m2eclipse doesn't move resources as required. I haven't really figured out why. Anyway: a simple solution is to keep a shell open and do
mvn resources:resources
or in m2eclipse, create a new run configuration using Run Configurations -> Maven Build -> new Launch Configuration setting goals to: either process-resources (lifecycle) or resources:resources (plugin goal).