When I use Run as > Maven Build in Eclipse, "Resolve Workspace Artifacts" checkbox is unchecked by default. Is it possible to make it checked by default?
Number of Maven plugins may conflict with "Resolve Workspace Artifacts" feature (e.g. maven war plugin), so it is generally not recommended.
However, if you really need that feature, "Run as / Maven build" remembers previously launched and saved configurations and you can invoke them again from the same menu or using keyboard shortcut Alt-Shift-X, M.
Related
I have a maven multi module project which has 5 modules. Some of my modules depend on one or more other modules, I am successfully able build the project and in eclipse also I am not getting any errors. However there is one problem which is bothering me, when i ctrl + click in my code and the class is defined on some other project eclipse does not open the file in the editor. I know i can attach the source code using maven but still i wont be able to make changes to that file.
Is there any way to be able to link projects in eclipse through maven?
Is there any way to be able to link projects in eclipse through maven?
That behaviour is the default. To check if for some reason that default is not in effect for your project, right click your project (the project you want to jump from) and go to "Maven". If there is an option "Disable Workspace Resolution" the workspace resolution is switched on, meaning you can theoretically jump from that project.
If you still cannot jump, then the project you want to jump to is not in your workspace. Take into account that for eclipse to identfy one project as dependency of another, everything including version must match.
Also check what rest_day said. You must have the projects importet as maven projects, but running eclipse:eclipse is not required anymore with current (up to ca 2 year old) eclipse.
Did you import the projects as Maven projects?
Also, could you go to the root of the project and run mvn eclipse:eclipse
eclipse:eclipse
Full name:
org.apache.maven.plugins:maven-eclipse-plugin:2.10:eclipse
Description:
Generates the following eclipse configuration files:
.project and .classpath files
.setting/org.eclipse.jdt.core.prefs with project specific compiler settings various configuration files for WTP (Web Tools Project), if the parameter wtpversion is set to a valid version (WTP configuration is not generated by default)
If this goal is run on
a multiproject root, dependencies between modules will be configured
as direct project dependencies in Eclipse (unless useProjectReferences
is set to false).
Instead of Ctrl+Click, click on the identifier and press F3. If you now see a red text reading "Current text selection cannot be opened in an editor", you've been hit by this bug.
See this question for a solution: How do I get rid of "Current text selection cannot be opened in an editor" in Eclipse?
After checking out a maven project from a svn-repository, eclipse shows dependency-errors.
To solve the problem,
I have to right-click on the project-folder,
then I have to click Maven --> Update Project
After doing that, the dependendicies of the pom-file are downloaded and the specific classpathes are set.
The problem: I have to do this everytime after a checkout of a maven-project.
My question: Why should I have to update manually the maven-project? Why didnĀ“t do this the maven-builder automatically? Is there any way to engage eclipse or the maven-builder to do this automatically?
If you have Subversive (installable via the Marketplace), you can checkout and set up the project in one step from Eclipse. In the dialog File -> Import try the entry Maven -> Check out Maven Projects from SVN.
Unfortunately, maven project configurations tend to get stale when you're changing stuff in the POM. Another tip from me is use the keyboard shortcut for "Update Project" (Alt-F5 on Mac & Windows) which should select the project you're currently in and has the option to update all projects at once.
I use Ivy for dependency management with the IvyDE Eclipse plugin and I have dependent libraries that change quite frequently and Eclipse doesn't seem to refresh the libraries when I refresh the workspace.
<eclipse.refreshLocal depth="*" resource="/" />
Is there a way to get eclipse to refresh the Ivy libraries using an ant task, or refresh them upon a workspace refresh?
You could try to touch the ivy.xml.
This might trigger an update of ivy after a workspace refresh.
You can go in the Windows -> Preference -> on Eclipse Startup and change to Trigger Refresh
Can't you use Refresh or Resolve on the right-click menu for the "ivy.xml" Eclipse Library in the project?
To add to oers' answer and Pat B's answer above, you would need to go to Window > Preferences > Ivy, and change the following preferences:
Set "On Eclipse startup" to "Trigger resolve", and
Set "On Ivy File Change" to "Trigger resolve"
These should do the trick, especially in combination with the "touch" suggestion that oers made in his answer.
I have a maven project in eclipse Indigo. The project's POM uses a certain profile by default, which I wish to disable from my eclipse. I know I can activate through right-click on project-->properties-->Maven-->Active Maven Profiles.
But how do I disable that profile?
Normally, you should be able to add a ! prefix to the given profile, in the project > Properties > Maven > "Active Maven Profiles" field. But, there's a bug in m2e that prevent profiles to be explicitely deactivated : https://bugs.eclipse.org/bugs/show_bug.cgi?id=337353
Sorry this doesn't constitute a solution to your issue, but you can at least now track progress on the resolution of the bug. And if you like living on the edge, you can clone m2e's git repo, apply the fix patch and build m2e from source.
Add a new (empty) profile to your POM (e.g. 'eclipse') and set this as the active maven profile in your eclipse.
I have an Eclipse workspace where a CDT project lives together with other unrelated projects. However, when I run "build as Ant build" in one of those projects, CDT insists on rebuilding its projects too.
Anyone have any ideas where to look to disconnect this "hidden" dependency? (And no, it's not in the "Linked Resources" or the "Project References"...)
The workspace wide build was actually caused by me failing to find the option for the build in "External Tools Configurations". There you can specify to build the whole workspace, the containing project, or some specific resource.
There is also an Eclipse bug for setting the default to something different than to build the whole workspace. (One could think that "Run as Ant build" would default to not build anything except running the specified Ant target.)
Project builders are run at the request of some build trigger. This might be resource changes (when you have build automatically enabled) or it could be the build action you're using: "build as Ant build". The build action may be inadvertently requesting a build of the whole workspace.
Put the following in a text file:
# Eclipse build
org.eclipse.core.resources/debug=true
org.eclipse.core.resources/build/interrupt=true
org.eclipse.core.resources/build/invoking=true
org.eclipse.core.resources/build/needbuild=true
#Managedbuild
org.eclipse.cdt.managedbuilder.core/debug/builder=true
org.eclipse.cdt.managedbuilder.core/debug=true
org.eclipse.cdt.managedbuilder.core/debug/pathEntryInit=false
org.eclipse.cdt.managedbuilder.core/debug/pathEntry=false
And run Eclipse with the additional switches:
-debug <trace_options>.file
This will echo trace prints to the shell in which you started Eclipse. You can use this to better target the bug report you'll no doubt file :)
Try to uncheck the Build Automatically checkbox, under Project menu.