I'm planning to create a java maven web project. I would like to know whether I have to install Maven in windows or install maven in eclipse? I'm using windows 10 and eclipse oxygen. My network has some restrictions so I would be adding a proxy in settings.xml.
I have already tried creating a maven project in eclipse with maven embedded in my eclipse, but it was giving multiple errors during jars download.
Please suggest me on which way I should proceed and which way is better, whether I should use maven in eclipse or install in windows and use?
Usually, you use the embedded Maven in Eclipse, which is part of a standard modern Eclipse installation.
If you get errors with jar downloads, this is probably an issue with your network. Whether putting a proxy in the settings.xml is enough to remedy the problem depends on you actual network.
To find out the exact network restrictions, talk to your admin.
I think you should just try use a different network to create your maven project (for example you can use tethering or ask for permission to get around those network restrictions). After that you should be able to use your maven project even offline.
An alternative would be to just download a maven project and change it to your own.
You can try installing maven:
Go to maven's website to install/configure maven for your os
Set Maven's settings.xml
Configure Maven in your eclipse, choose the installed maven rather than embedded
If your have any errors, please post them here.
Related
I need to use the oracle database driver (oracle.jdbc.driver.OracleDriver) for a project but Oracle does not have a Maven repository for it, so the only way that I have found is to download it onto my machine and then "install" the .jar to Maven as seen in this article.
However, now it is time to add the project to my work's Bamboo build server, but of course the build fails because it can't find the oracle driver.
My question is: how is this sort of thing generally handled? There doesn't seem to be a way to "add" a .jar to a Bamboo build and then point Maven on Bamboo to that .jar. Another alternative that I'm trying is putting the oracle .jar on an internal git repository but I don't know how to point Maven to pull a .jar from a git repository (my current understanding is that maven repos and git repos are different thing entirely).
Any tips or suggestions appreciated, thank you.
The usual way is to set up a Nexus/Artifactory on a server. This server is used for the built artifacts (your Bamboo deploys the EARs/WARs/JARs to it), to proxy external repositories (not necessary, but will speed up things) and to manage third party jars that are not available elsewhere.
In your settings.xml you just point to this Nexus/Artifactory and do the same for the Bamboo.
I've been dealing with this problems for days now.
I need to install maven and the eclipse plug-in "maven2eclipse" on an offline environment.
So far I've installed maven on the computer but I'm not able to import or open a maven project in eclipse when I right click and select "import source" in the package/project explorer. Maven alternatives simply aren't there for me to use even though I've installed all of the plug-ins that m2e repository has to offer.
I've downloaded the m2e-repository for a local version with these commandlines:
Artifact and metadata (replacing .artifact. with .metadata. and running it again)
"C:\eclipse Java EE\eclipse.exe" -application org.eclipse.equinox.p2.artifact.repository.mirrorApplication \ -source http://download.eclipse.org/technology/m2e/releases \ -destination C:\Maven2Eclipse\repos
I then moved this local folder to the offline system and used it as a local repository.
I've also downloaded the helios repository, but I haven't installed anything from it. Becuase I seemed to be lacking some important dependancies without it. Something with eclipse.UI.. haven't been able to reproduce it.
Anyways, I've added the downloaded repositories to the disposal of my offline environment.
I installed everything with "m2e" and/or "maven" in it's name but I still can't import an "existing maven project". The option simply isn't there.
Here's a screenshot of what m2e software I have installed using the "install new software".
http://i.imgur.com/xPKN6qn.png
Have I missed something? There's something missing and keeping me from actually being able to select the import source "import an existing maven project".
I've been searching the web like crazy and I cannot find anything that resembles my problem.
There's quite a lot on mirroring eclipse repositories and what not but I don't seem to have a problem whit that, unless something didn't get downloaded.
Thanks in advance for any help.
It is better if you can update eclipse with the automatic update by using the url online directly.downloading and then installing the plugin manually causes a lot of issues as some plugins might not get downloaded properly in the installer or some plugins may be completely missing from the installer itself.
Please check the proper url to install the plugin automatically which matches with the version of the eclipse you may be using.
Just...check this two things, if you go in eclipse configuration, inside the Maven tab?
1: Check the Offline mode...
2: Try to use the Maven you've installed (not the embedded one..)
I solved the issue by manually copying all plugins and feature files into their respective folders, making sure everything was installed as well and then restarting eclipse a couple of times with the -clean addition. After that, it started working.. weird :/
Thanks for the answers though!
we recently migrated to Maven Build manager & git hub repository for our Java web-app. Also i switched to eclipse as eclipse has good set of plugins.
As a new bie, i am simply running mvn clean package from terminal at the code root directory. And then moving the compiled code i.e., /target/SNAPSHOT/* to tomcat/webapps/ROOT location.
And then starting Tomcat7 server. The process is time taking especially when i do code changes in Java & configuration .xml files.
I want to do it completely in IDE environment as i did earlier in Netbeans, update code -> build and run in debug mode, -> do code changes and then commit.
Heard of egit & m2e in eclipse for maven & github integration, but not sure how to use it.
Please walk me through the steps required in doing so. I am completely new to eclipse.
--
Thanks
You might want to consider using maven-jetty-plugin http://docs.codehaus.org/display/JETTY/Maven+Jetty+Plugin for running the webapp. You will not need to copy over stuff to tomcat. After configuring this plugin, you can simply run your application by doing mvn jetty:run
I generally do not like running webapps inside Eclipse. It's a personal prefrence, but it is always nice to have an IDE neutral way of building and running your applications. If you have m2e things should work simply fine. I have seen maven-jetty-plugin having hot pluggability where if you changed your web.xml, jetty would reload your application.
We use Git for version control and Maven for dependency management and build automation. Once your project has successfully imported into Eclipse and recognized as a valid java web project, you don't need either Git or Maven in order to build/run it inside IDE. Just creat a server using you existing tomcat installation, add the project to server, then select Run as > Run on Server.
The Complete Guide:
Creating a server
Adding projects to a server
Starting a server
For more details, check out Testing and publishing on your server.
m2e is no longer working in my Eclipse Indigo. Nothing is printed to the Maven console, I can't download any sources and some dependencies won't be resolved.
I'm using the embedded Maven installation.
Do you know how to fix this issue?
Just a wild guess (due to similar problems I had in the past):
If you use the embedded m2e Maven installation, Maven has no information to your settings.
If you are in a corporate environment, you have to set your proxy in a Maven related location:
In your users settings.xml file.
In your Maven installation settings.xml file
m2e can only use the proxy set in your Maven settings file, not the one in your eclipse environment. So as a result, you could see all the old libraries contained in local repositories, but no new ones contained only in remote repositories located somewhere on the internet.
Please add some more information about your configuration in eclipse (does eclipse find your user settings.xml file?) and the errors you get.
Try -clean workspace option. Or if it doesn't help, create new workspace, test if m2e started working and import your old projects. I just resolved issue very similar to yours using second option.
Here is good explanation of such kind of troubles: http://www.eclipsezone.com/eclipse/forums/t61566.html
I have a project (built from an AppFuse template) that requires Maven 2.2.1. So I upgraded to this (from 2.1.0) and set my path and my M2_HOME and MAVEN_HOME env variables.
Then I ran mvn eclipse:eclipseand imported the project into Eclipse (Galileo).
However, in the problems list for the project (and at the top of the pom.xml GUI editor) it says:
Unable to build project
'/export/people/clegg/data/Workspace/funcserve/pom.xml;
it requires Maven version 2.2.1
This persists whether I set Eclipse to use its Embedded Maven implementation, or the external 2.2.1 installation, in the Preferences -> Maven -> Installations dialog.
I've tried closing and reopening the project, reindexing the repository, cleaning the project, restarting the IDE, logging out and back in again, everything I can think of! But Eclipse still won't believe I have Maven 2.2.1.
I just did a plugin update so I have the latest version of Maven Integration for Eclipse -- 0.9.8.200905041414.
Does anyone know how to convince Eclipse I really do have the right version of Maven? It's like it's recorded the previous version somewhere else and won't pay any attention to my changes :-(
Eclipse allows you to specify an external Maven installation. But there's a catch. :(
Have a look at Windows > Preferences > Maven > Installations.
You will see a message like this:
Note: Embedded runtime is always used for dependency resolution, but does
not use global settings when it is used to launch Maven.
To learn more, visit the maven web page.
Translating to English, it means that Eclipse will continue to employ its internal Maven instance in order to perform some tasks.
When you "Run As > maven install" it will run your pom.xml script employing the external Maven instance you specified but when Eclipse performs some of its internal stuff, it will continue to use the embedded Maven instance, whatever version it is.
(edited)
As far as I know, when you install M2Eclipse you are implicitly defining which "internal Maven instance" you will have, which is exactly that one packaged by the plugin.
In the plugin configuration, you can add external Maven instances by telling where they are installed.
If you are using a recent m2eclipse version, you can try this too:
<prerequisites>
<maven>>=2.2.1</maven>
</prerequisites>
Notice the greater than in >=2.2.1. It works fine for me.
A common source of trouble (of this kind) is if you change global preferences and don't remember or know that you have enabled some project specific settings. At least it's a chance that the global setting is now set to use the external maven but the project setting is still set to 'embedded'.
M2Eclipse uses an embedded maven instance, not the maven instance you have installed on your system.
Have you tried switching workspaces?
You can still reference the same project in the new workspace. This would provide about as much of a reset as you can do in terms of eclipses internal settings.
Try creating your eclipse project with mvn project:m2eclipse or use the maven import option under import project.
Using m2eclipse, my fallback in these situations is to do Maven > Update Dependencies and then Maven > Update Project Configuration. The first is just me being supersticious, but the second will rewrite .project and .classpath.
As Pascal says about, m2eclipse can also be pointed at an external instance. I've done this in the past, though not at 2.2.1.
Dan
I got the same issue. Resolved it by restarting the system because every time you change the 'Path' in environment variables you should restart the system or else if would not pick the changes.