Eclipse RCP & tycho - The type org.eclipse.swt.widgets.Button cannot be resolved. It is indirectly referenced from required .class files - eclipse

Situation:
I have an Eclipse RCP Application, which I am trying to build with tycho plugin for Eclipse.
When I am executing my Eclipse Application inside of the IDe - the Application is executed normally.
When using tycho to build the Application - the following error is thrown:
The type org.eclipse.swt.widgets.Button cannot be resolved. It is indirectly referenced from required .class files
What I did :
In other cases where a "missing requirenments" exception was thrown, which I found
- a missing transitive plugin-dependency was the reason.
In my case an SWT widget "Button" is missing, so I am trying to import swt.
SWT is platform dependant so I am importing swt inside of the product, as described here.
Anyway, during compilation the error occurs again.
Question:
Do someone have any Idea, how to solve this Problem?

I got the answer from the mailing list (Thnx Jeff MAURY!) - it seems to be a bug of tycho.
Here is a patch available.
For those, who do not know GIT yet, like me:
When checking out the patch on windows use TortoiseGit or MSYGit clients, not the EGit Client - it wont recognize the repository.
Additionally use the https repository, not the git repository - git didn't work for me
And the checkot syntax is git clone https://git.eclipse.org/r/tycho/org.eclipse.tycho.git - https://git.eclipse.org/r/tycho/org.eclipse.tycho.git is the repository URL here

Related

How can I file an issue for SonarQube Eclipse plugin

I went here but cannot see any means of reporting an issue:
https://jira.codehaus.org/browse/SONARIDE
The issue is that SonarQube plugin in Eclipse stops working when project is configured as "Groovy Project" and DSL jar is added to classpath. The Sonar run crashes with message saying that it cannot find the Groovy DSL jar in "{build folder}\C:\Users....", which makes no sense - why the hell is it treating an absolute path as relative.
You can't create issue in JIRA by yourself. We prefer issues to be first discussed on our user mailing list (or on SO) in order to avoid too many "won't fix/not a bug".
In your case it seems to be a valid report so I have created https://jira.codehaus.org/browse/SONARIDE-430. In next Sprint of SonarQube Eclipse we plan to highly improve multi language support and Groovy is a good candidate.
If you could provide a simple Groovy project (including Eclipse metadata .project, .settings, ...) it would be very helpful.

getting "no repository found at..." error when placing my plugin into Eclipse's dropins directory

i am using eclipse 3.5 to create a simple plugin bearing an extension point. i built it using headless pde build via ant. the plugin functions properly. i then proceeded to test its extension point by placing my plugin jar into eclipse_home/dropins with intention of eventually creating an extension. but after i start eclipse, i get the following error in its log:
!ENTRY org.eclipse.equinox.p2.core 4 0 2012-03-22 01:00:45.270
!MESSAGE Provisioning exception
!STACK 1
org.eclipse.equinox.internal.provisional.p2.core.ProvisionException: No repository found at file:/C:/eclipse35/dropins/MyPlugin/.
at org.eclipse.equinox.internal.p2.repository.helpers.AbstractRepositoryManager.fail(AbstractRepositoryManager.java:380)
at org.eclipse.equinox.internal.p2.repository.helpers.AbstractRepositoryManager.loadRepository(AbstractRepositoryManager.java:641)
at org.eclipse.equinox.internal.p2.metadata.repository.MetadataRepositoryManager.loadRepository(MetadataRepositoryManager.java:92)
at org.eclipse.equinox.internal.p2.metadata.repository.MetadataRepositoryManager.loadRepository(MetadataRepositoryManager.java:88)
at org.eclipse.equinox.internal.p2.reconciler.dropins.Activator.loadMetadataRepository(Activator.java:90)
at org.eclipse.equinox.internal.p2.reconciler.dropins.DropinsRepositoryListener.getMetadataRepository(DropinsRepositoryListener.java:184)
at org.eclipse.equinox.internal.p2.reconciler.dropins.DropinsRepositoryListener.addRepository(DropinsRepositoryListener.java:79)
at org.eclipse.equinox.internal.p2.reconciler.dropins.DropinsRepositoryListener.added(DropinsRepositoryListener.java:57)
at org.eclipse.equinox.internal.provisional.p2.directorywatcher.DirectoryWatcher.processFile(DirectoryWatcher.java:200)
at org.eclipse.equinox.internal.provisional.p2.directorywatcher.DirectoryWatcher.scanDirectories(DirectoryWatcher.java:161)
at org.eclipse.equinox.internal.provisional.p2.directorywatcher.DirectoryWatcher.poll(DirectoryWatcher.java:108)
at org.eclipse.equinox.internal.p2.reconciler.dropins.Activator.watchDropins(Activator.java:491)
at org.eclipse.equinox.internal.p2.reconciler.dropins.Activator.start(Activator.java:167)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:782)
at java.security.AccessController.doPrivileged(Native Method)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:773)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:754)
at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:352)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.resume(AbstractBundle.java:370)
at org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(Framework.java:1068)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:557)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.incFWSL(StartLevelManager.java:464)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLevel(StartLevelManager.java:248)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:445)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:220)
at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:330)
i have tried both just placing the plugin jar directly in the dropins directory, as well as using the following directory structure: eclipse_home/dropins/MyPlugin/plugins/myplugin.jar. both approaches work just fine with 3rd party plugins, but not with mine. please let me know what i am doing wrong. thank you!
It seems like two problems. The "no repository found" error message looks like this problem. And then there is the issue with your plugin not starting.
First you should check if the plugin is found.
Then you should check if the plugin is resolved, i.e if all requirements are fulfilled.
If you have the plugin development version of Eclipse, then you can open the plugin registry view. See if your plugin is in the list, if so, then the atleast it has been found. Then right click on it, enable advanced operations, and after that choose diagnose. Some requirement has probably not been fulfilled.
If you dont have the Plugin version of Eclipse, you can use the osgi console. Go to console view, and choose OSGI console in the view menu.
Run command ss to list all plugins, and diag 123 where the number is the id of your plugin to diagnose it.
Also, see a previous answer to a similar question
Edit: Oh, and I have been having some serious problems getting plugins placed in the dropins catalog to work at times... You could try to copy it to the eclipse/plugins catalog directly.

Trying to include a maven built library in Eclipse, giving missing artifact error

I've seen that there are quite a few questions regarding this problem, but unfortunately none have solved it for me. Here is a screencap of what's going on:
It is dependent on the android-support-v4 jar file which as you can see is added to my build path. It the exact jar file from the maven library directory's libs folder. I've tried the following:
Restarting Eclipse
Cleaning the project
Right-clicking the project and updating dependencies
Updating project configuration Disabling and re-enabling workspace resolution
Nothing has helped. Is there any other tricks to getting this resolved? All of the answer's I've seen suggest doing these things that I have already tried.
Thanks a lot!
Actual root cause:
The OP JMRboosties reports in this instance having to desactivate Proguard (the tool which shrinks, optimizes, and obfuscates your code by removing unused code and renaming classes, fields, and methods with semantically obscure names)
disabling proguard on the line where the error occurred (the <plugin> item) in pom.xml solved the problem
(See "How to use ProGuard with android-maven-plugin ").
Certain side-effects can result from using Proguard: For example, the Proguard page does mention:
The default proguard.cfg file tries to cover general cases, but you might encounter exceptions such as ClassNotFoundException, which happens when ProGuard strips away an entire class that your application calls.
Original answer:
As mentioned in this GitHub post:
you need to use maven Android SDK Deployer to install it:
I'm going to deploy my own android artifacts to my personal repository to avoid having this problem again.
If you're not explicitly using Maven you can just import it as a regular Android project into eclipse and it'll pick up the .jar from the libs/ directory.
(Note your android-support-v4.jar isn't in libs in your project)
declare it in your pom.xml.
You have to install both Android 1.6 and the compat lib using the maven SDK deployer for now.
cd to platforms/platform-4/ and extras/compatibility-v4/ in the deployer and run mvn install in each.
Hopefully the compat lib makes it into maven central soon so I can avoid this step.
Again, the project is set up to be used as a normal Android project in eclipse too completely separate from maven.
File, New, Project, Android, use existing sources, select library/ folder.
Assuming you're using m2e-android behind the scenes, the reason you're getting compile problems is that the m2e-android plug-in strips out all provided scope dependencies from the Eclipse project classpath.
We do this because, due to changes in ADT 16.0.0, any JAR file in the Eclipse classpath will be packaged into distributable APK file.

gwt-maven-plugin with Eclipse Indigo

I would just like to setup a new GWT project in Eclipse and use Maven for dealing with all the jar jungle. I used gwt-maven-plugin with this instructions, but I can't get the project to work in Eclipse.
What I've actually done:
Created a maven project using the archetype gwt in command line.
Imported the projet in eclipse using import > existing maven project
While doing that I had errors saying:
gwt-maven-plugin:2.3.0-1:generateAsync - "No marketplace entries found to handle"
gwt-maven-plugin:2.3.0-1:i18n - "No marketplace entries found to handle"
gwt-maven-plugin:2.3.0-1:exploded - "No marketplace entries found to handle"
These errors don't go away even if I ignore them on the import.
How can I make these projects working? Is the problem that I skipped the "process-resources" setting? (There is no such setting in the latest version of m2e.)
Should I even use gwt-maven-plugin? Is there any other way of making a GWT project to use Maven? Or – is there any other way to fight with the jar jungle? What does GWT guys use?
I use Eclipse Indigo with m2e plugin 1.0.0 and Google suite plugin version 2.3.3.
Eventually I gave up Maven. As one other developer said "good ideas and bad code build communities faster" , I also remember my experience with Maven on all the projects: very promising on the beginning, but eventually you get to some problems and end up working more with configuring Maven than actually dealing with your own code.
I decided to manually copy needed .jar-s into /lib folder. I spent some time due to transitive dependencies, but LESS than dealing with Maven and now I have things under control. If sometime in the future working with libraries will become an overhead, I will consider using Ivy.
If someone wishes to stick with Maven, I lately found a very useful link by Google team:
http://code.google.com/p/google-web-toolkit/wiki/WorkingWithMaven
They recommend using their sample projects and not gwt-maven-plugin archetypes (due to issues). I agree. They also provide needed pom lifecycle changes for Eclipse Indigo.
According to a recent post on the gwt-maven-plugin mailing list the Maven integration is not complete for Eclipse Indigo, since the M2Eclipse 1.0 release has brought about a large number of changes. The suggested workarounds from David Chandler, Google engineer, are:
You can run "mvn package" on the command line or right-click on the project > Maven > Run as > Maven build.
The plugin execution failures you're seeing can be resolved by adding lifecycle mapping metadata as in the sample POMs. They are only needed for Indigo. You should not get these errors in Helios or when running mvn package from the command line.
Disclaimer: The following guidelines are for Windows users. These steps are on the basis that, they have worked when tried by the replier and doesn't guarantee fulfledge working unless experimented by self and tried with proper prerequisites.
::Creating a simple gwt project using archetype::
Following are few commands that can be used to create a simple gwt project "Web Starter Application":
mvn archetype:generate -DarchetypeGroupId=org.codehaus.mojo
-DarchetypeArtifactId=gwt-maven-plugin -DarchetypeVersion=2.3.0
mvn -DarchetypeGroupId=org.codehaus.mojo
-DarchetypeArtifactId=gwt-maven-plugin -DarchetypeVersion=2.3.0 -DgroupId={project packaging} -DartifactId={application name} -Dversion=1.0 org.apache.maven.plugins:maven-archetype-plugin:generate
mvn -DarchetypeGroupId=org.codehaus.mojo
-DarchetypeArtifactId=gwt-maven-plugin -DarchetypeVersion=2.3.0 -DgroupId={project packaging} -DartifactId={application name} -Dversion=1.0 -Dmodule={module name} org.apache.maven.plugins:maven-archetype-plugin:generate
(The value of archetypeVersion can be 2.3.0 or any higher stable version.)
Few coordinates are required by maven to create the gwt project. They are as follows:
groupId
artifactId
version
module
The first command doesn't take any of the above coordinates hence, we need to supply them at the time it executes. Notice that the archetype goal is mentioned right at the beginning of the command. It is mandatory to give the archetype goal.
The meanings of these coordinates can be found here.
One of the best ways to start with understanding maven is this.
The second command doesn't consider the module name hence, you will be prompted to give it at the time the command executes.
The third command is equivalent to running it in batch mode where you just have to confirm the inputs for groupId, artifactId, version, module as mentioned in command itself.
Once any of these commands gives a BUILD SUCCESS result, then navigate to the just-now-created project folder from command line and execute the following command:
mvn gwt:run
It should start the project in Development Mode so that you can Launch the Default Browser to run the project or Copy the URL to clipboard and navigate to it through any browser.
Good luck with the execution.

Eclipse: Import Maven project, missing maven-gae-plugin

Coming from Visual Studio, I'm pretty new to the Eclipse IDE.
And finding it very difficult. I seem to get error messages of the type "missing ..." a LOT.
The latest issue I'm having, where I just can't get around is this:
I"m trying to compile & run this sample project: http://code.google.com/p/gwtgae2011/
When I choose "checkout maven projects from SCM" my SCM drop down is empty...
So I just checked it out with Hg manually. No problem.
Trying Import > Existing Maven Project. Seems to read the pom.xml alright, but shows an error:
"No marketplace entries found to handle maven-gae-plugin:0.8.1:unpack in Eclipse. Please see Help for more information."
Since I can't find it through updates or market within eclipse I downloaded maven-gae-plugin (http://code.google.com/p/maven-gae-plugin/downloads/list). I figured just dropping it into the "plugins" or "dropins" folder should be enough. Apparently not so...
Question: How do I fix this error?
(I tried both 3.6 & 3.7)
Links to some good eclipse tutorials covering these kinds of topics are very welcome too!
THANKS!
maven-gae-plugin is in central repo so it should be found.
Did you set the path to your local repo? http://united-coders.com/phillip-steffensen/maven-2-part-3-configuring-eclipse-for-apache-maven-2-projects
I ran into this error, what worked for me was:
Comment the plugin
Import into eclipse
Uncomment the plugin
Discover an error in the plugin XML
Fix error found in the plugin XML
I am not certain, but it seems like this is a unclear error that something about the pom.xml is invalid.