Eclipse Plugin - one of the plugin projects in "features" won't compile - eclipse

My plugin is built by two plugin projects (two plugin projects are in the same workspace).
One of them is an ordinary plugin which has toolbars etc. The other one is a Scala-based XML interpreter.
Everything runs fine and works great while I use "Run/Debug" as "Eclipse Application".
But, after I tried to pack it as a Feature project then Build it with and Update Site Project, the auto-generated JARs are wierd: the content of the ordinary plugin JAR is classes, which is correct; however, the other one (in scala), Eclipse packed the JAR with the original file - filename.scala in the JAR!
In other words, the plugin project didn't get compiled after Build(in Update site project by putting Features in).
But it worked fine when I used "Run" as "Eclipse Application".
Does anyone know how to fix this? Or any hint?
I've tried this but it didn't fix my problem.

Related

AEM error on real time

Is there a way to configure AEM into an IDE like IntelliJ,Eclipse...
So that the IDE shows the errors on my project before I compile it even if I put it outside the source folder like for example the components created.
If possible both the .java and .jsp
I'm not entirely sure what you mean by outside the source folder, but have you taken a look at adobe's documentation?
They have instructions for IntelliJ + AEM with Maven. It also instruct on jsp support as well. It's for 5.6.1 but it should be valid for 6.x as well.
https://docs.adobe.com/docs/en/cq/5-6-1/developing/developmenttools/howto-develop-aem-projects-with-intellij.html
Here's one for Eclipse
https://helpx.adobe.com/experience-manager/using/creating-aem-project-using-eclipse.html
They also have a more generic set of instruction
https://docs.adobe.com/docs/en/cq/5-6-1/developing/developmenttools/how-to-build-aem-projects-using-apache-maven.html#How-To%20Work%20with%20JSPs
Yes, you can maintain CRX data(AEM folders like /etc, /apps, /content, etc) in an IDE like eclipse. This will help you iron out all the compilation errors using features of IDE. Make use of this eclipse plugin called vaultclipse. You can install it from eclipse marketplace.
There is also another plugin called AEM plugin, details on how to use it here.

GWT+Eclipse without GWT_CONTAINER

The situation
I'm using GWT with Eclipse and Google Plugin for Eclipse (GPE).
Gradle is the build tool and the Eclipse classpath is generated by Gradle. As I have no "com.google.gwt.eclipse.core.GWT_CONTAINER" on my classpath, GPE always shows the error "The project 'Test' does not have any GWT SDKs on its build path" and the Console sometimes prints "GWT SDK not installed.".
Annother effect is that Eclipse doesn't let me GWT-compile the project (but running dev mode works fine). But that one is ok for me, as I compile using Gradle.
Things I'm aware of
I know that I can exclude all GWT depedencies from the Eclipse classpath and add the container through Gradle (I did that for other projects). But as I can't enforce the GWT version provided by Eclipse (I can only specify the SDK's name in the classpath by adding the suffix "/" to the conatiner), I think thats an ugly solution. Another point is that the GPE update site only lists the latest GWT version available. There's no way to automatically install an older version (yes you can provide one externally).
When using GPE together with Maven and m2e it simply works: GPE links no real SDK for Maven projects but there's a link to the "com.google.gwt" group in the local Maven repository. But that's magic I can't use because:
Gradle's local repository format is different to Maven's
This logic is implemented in the plugin "com.google.gdt.eclipse.maven" and I can't use that without adding a pom.xml to the project
The questions
Is there a possibility to deactivate this nasty error without loosing other GPE features?
Is it possible to do something similar to what GPE+m2e does without
creating my own Eclipse plugin?
Am I right that excluding the jars and adding the container is the only viable solution by now?
You can adapt this library to launch with custom classpath and other settings: https://github.com/eclecticlogic/gwt-launcher

Eclipse running lift project (project configuration issues)

Trying to get a lift project to run on windows, I've installed maven on my computer, then tried to use
mvn archetype:generate from cmd, then chose the lift basic one , but it always failed on the jetty:run part. Before that, I had to change a lot of the pom.xml file to even get a successful build (since the tutorial I was using was obsolete and it couldn't find the dependencies).
So I've decided to try with the eclipse plugin, thinking it should be easier.
I've installed the maven plugin for eclipse and created a project with the lift archetype.
The project was succesfully created, but I have all kinds of errors in the editor for missing ; and so on (I have scala ide installed on eclipse also and creating a normal scala project works and compiles/runs fine). I have also tried to include the scala-library.jar in the buildpath, with no change.
The odd part is that I can run the cmd and go to the project folder, then run mvn jetty:run and it will actually work (?!) Trying to run in eclipse with jetty:run as goal will give me ClassNotFoundException on the HelloWorld snippet.
So what might be wrong with my settings?
UPDATE: no luck whatsoever, after trying 3 different eclipse versions, installing the maven for scala plugin and following every tutorial I could find. It just simply feels all is outdated on the instructions:
this is how it looks after I include the scala libraries for eclipse on every project (after I create it from an archetype):
is this "mvn archetype:generate" up to date? I don't know if anybody guarantees it will work at all..
Anyway, the default way to at least try Lift and see it working is the following: https://github.com/lift/lift_25_sbt
It uses "Simple Build Tool" instead of maven, but maven should work, too. Also, you can easily read "build.sbt" to get all the dependencies.
Plugins for creating eclipse/intellij project definitions are included. (See the README of the demo project.)
The target to create eclipse project is "eclipse" or "eclipse with-sources=true".
The target to launch the app is "container:start".

Can't access class in Eclipse plugin from a Java Project

In abstract, my problem is the following: I want to access a class contained in an Eclipse plugin from a Java Project. Is it possible? I've included that class in the "Exported Packages" of the plugin, which supposedly are "all the packages that this plug-in exposes to clients." Can my Java project be a "client" or only other plugins can be clients?
More concretely, I've encountered this problems when using XText. I built an editor for a language, and programs written with this language are stored in a text based format that follows the grammar defined with XText.
I want my users to be able to write Java programs that load and manipulate those xtext-based files. For that, they need to access all the classes that XText generated in the plugin project. However, I haven't been able to use those classes: in an Eclipse instance that is running the plugin with my editor, those classes are not visible.
How can I access them? The only solution I've found is to export my plugin as a jar and then include it in the Build Path of the Java project, in the other Eclipse instance, but this doesn't sound elegant.
Another way of looking at this problem is the following: I want a certain class to be available to any Java project built in an Eclipse instance where a certain plugin is loaded. How can I do it?
Thanks for your help.
PS. I'm launching the second Eclipse instance (the one where the plugin is loaded) from within the first Eclipse instance.
Once you generate your XText support, you need to make sure every package is exported from the Runtime tab by editing your MANIFEST.MF.
Then once you deploy your plugins into an eclipse, that eclipse environment will be able to see those classes.
But that would only help other plugin developers. Java apps can see classes that exist on the classpath (if you add the plugin jars, for example) but as most eclipse plugins depend on the eclipse lifecycle to work, it's unlikely that their java programs would run. That's not always the case (you can use JFace without a running eclipse) but only for plugins specifically designed that way.
If your plugin is installed, you can create a java project and add the plugin jar as an external jar, using *ECLIPSE_HOME* variable. If your plugin is a project in the workspace, you can depend on it (from the java build path) just like another java project. But since it's a plugin, that probably won't help them run.

JavaRebel with a Multi-module Enterprise Project in Maven

Does anybody have experience working with JavaRebel, specifically for a large web application built using Maven? There is a JavaRebel plugin for Maven that seems under-documented, does anybody have comments on how it works, can you really update one class in a Multi-module Enterprise Project and have it "automagically" change on your Server?
Are there any issues with different IDEs and this setup? For example NetBeans will not let you compile one class at a time in a Maven project (from what I can tell).
Disclaimer: I work for ZeroTurnaround.
JRebel (formerly JavaRebel) installation involves the application configuration file "rebel.xml" and modifying the container startup command line.
The Maven plugin is used to generate the "rebel.xml" file, that is used by the JRebel agent running in the container to find the files in the workspace. This allows to use IDE building to compile .java files and skip the Maven build process, as the changes to files will be picked up from the workspace. However as it relies on the IDE to compile the classes, it does depend on the IDE ability to compile efficiently. I know for sure that Eclipse will compile classes one at a time and am fairly sure you can configure NetBeans and IntelliJ IDEA to do the same.
In addition to the Maven/rebel.xml configuration you also need to configure the container startup command line. You may also need to install and IDE plugin or do some additional configuration to have the best expirience with JRebel. Following through the steps of Installation manual ensures that.
Hope this helps.
Disclaimer: I've not actually used this plugin myself.
This tutorial implies that JavaRebel works well with Eclipse 3.4. If you are also using m2eclipse it should work ok with Maven projects as well (as long as you ensure that Maven and Eclipse are compiling to the same target folder so the Eclipse incremental compiler can be used to modify the class file).
According to this post, you should configure the javarebel-maven-plugin to generate the rebel.xml (used to mount external folders to the application classpath). There's also a general installation guide you may find useful.