How to mavenize eclipse RCP application? - java

Current state:
Multi-module Java 6 project using Eclipse plugins, application is distributed for Windows platform only as an exe file with directories with many jars and some init and configuration files. These client distribution is build via Jenkins using Eclipse Buckminster plugin. These project was written around years 2010-2012 and desperately needs refresh.
I mavenized project, which means that each module has now its own pom.xml with dependecies. All modules were successfully built using mvn install command.
Question is how to build and distribute complete application with maven and say goodbye to jenkins & buckminster.
Where I see problem(s):
I don't fully understand what Buckminster actually do and how to set up properly OSGi/Eclipse Equinox launcher. There are few files like .cspex, .cquery, .rmap and even some Ant xml files where some magic happened, but it's not clear for me.
Is it even possible to use Maven (maven shade plugin) to build such app? Has somebody experience with it?

Related

Java plugin for Visual Studio Code cannot load Spring Boot classes when start debugging a multi-module Maven project

I am using Visual Studio Code with Red Hat Java Plug-in and Debugger for Java plugin. I got a problem that:
1) If I work with a single module Maven project, everything is ok.
2) But if I open a multi-module Maven project, the debugger cannot start because of "java.lang.ClassNotFoundException: org.springframework.boot.web.servlet.support.SpringBootServletInitializer"
3) The project can be built with Maven, and running the Jar is all right
I guess the problem is because of the classpath settings, however to my understanding, the .classpath file should be derived from the POM file, which should be correct, otherwise Maven would have not been able to build the project.
I did not manually modify the launch.json, and the plug-ins generated the settings for me.

How can I add Normal Java project capabilities to EJB project in Eclipse (.ear)?

Just started working with EJB (already developed project).
Imported the project from git and converted it to Maven project. However the project looks like a normal folder structure unlike regular java project. I cannot have any eclipse Java capabilities in side those files. Though they are Java files they look like class files to me with different symbol (can see that in image).
It won't compile unless I do maven build. Eclipse not showing any errors for those files even there are compile errors.
Running each time maven kills time and its irritating too.
Any help will be greatly appreciated. How to make that a normal Java project with eclipse compiler capabilities.
What configuration I have to do achieve this ?
Try running the command mvn eclipse:eclipse from the root folder of the project. It will create eclipse configuration files after which the project can be imported in Eclipse.

How do I use LibGDX, Gradle, Git, and Eclipse together?

I have a LibGDX project for Android and Windows which I created with the LibGDX project setup app (https://github.com/libgdx/libgdx/wiki/Project-Setup-Gradle), and I have no problems running the project on my main development computer. I want to work on this project from multiple computers and with other developers using Git, and so I placed all three projects into a Git repository. When I try downloading and importing the projects from the repository, I get a bunch of Build Path errors in
Eclipse, since my main computer is a Mac and the other computers are Windows and Gradle downloaded the libraries for the projects to my User library (which I've always understood to be normal behavior). How do I fix this issue? Should my Git repository contain all the libraries, and then must I fix the build path by hand? If this is the case, what was the purpose of using Gradle in the first place?
If you have gradle integration with eclipse setup in all the computers, it will work if you do the following,
Do not commit any of eclipse metadata directories/files to the repo.
In the new computer (any OS) import(either after cloning externally or materializing from git) the gradle project and allow the tool chain to download dependencies and setup the eclipse project.

Managing Maven project in Eclipse with git repository

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.

deploy multi-module maven project to Tomcat from IDE

I have a mutil-module Maven project wherein the pom's have the following packaging types
pom
|--jar
|--jar
|--war
The war project depends on jar projects. I imagine this is a pretty typical setup for a webapp built with Maven. I can deploy and debug the project by
running mvn install
copying the war to Tomcat
starting Tomcat in debug mode
from the IDE, connecting the remote debugger to Tomcat
Obviously, performing these steps after every change, quickly becomes a pain. Is there a simpler way to build and deploy the project to Tomcat, such that it can be debugged from the IDE? Instructions for either Eclipse or IntelliJ (ideally both), would be welcome.
In case it makes any difference, I normally create the Eclipse project files using the m2eclipse plugin. In intelliJ I use the import maven project feature.
Thanks.
If you install the m2eclipse-extras (wtp support) you will be able to configure tomcat server within eclipse and deploy the applications from within eclipse. This will also watch the project for changes and automatically redeploy. This might not work well if it is a large application.
The other approach is to use the maven jetty plugin or the maven tomcat plugin that runs it as a web-app without requiring to build a war.
You can also look at jrebel (a commercial tool) that can load the changes to class files / cofiguration without requiring a redeployment.
How about tomcat:run-war-only?
m2e is between maven and eclipse (Tomcat is not involved here). Choose "Build Automatically" (make sure there is nothing under "Problems" tab. If it is,just delete the errors entry from "Problems" tab). This will compiler and convert everything to .class files.
wtp is between eclipse and tomcat (servers in general) for deployment.
m2e-wtp is like a bridge used for deployment of maven projects in tomcat

Categories

Resources