Eclipse JavaEE (Maven)project WAS 7 migration to IntelliJ - java

I'm trying to migrate a maven project from Eclipse to IntelliJ and would like to start/run/deploy to WebSphere portal.
My problem is that Eclipse IDE allows multiple open projects and one of the projects is an EAR that deploys a war file to WebSphere portal.
Eclipse Project structure:
Websphere Artifact deployed:
So how can I achieve the same thing in IntelliJ IDE using the already installed WebSphere?
I already configured successfully Websphere Portal and I can start the server but I donĀ“t know what type of artifact I'm supposed to configure here because there's no EAR artifact because that was a project back in eclipse:
If I go to artifacts setting for WebSphere I can add the war file, but it is not deployed.
I have googled a lot about this in IntelliJ documentation, IBM documentation but there are no concrete solutions, at least that I have the knowledge to implement. I'm a bit new to IntelliJ. Can someone share a light on this please, thx.

If it is a Maven-based project - just open and import it from the main pom.xml in IntelliJ IDEA - IDE will automatically configure project structure.
If Maven project has corresponding configuration for ear artifact - IDE will automatically create the artifact of the same ear type which then you will deploy to an application server.
If you do not configure ear in Maven, you can create one manually, see examples in documentation.

The name of your artifact is important, even if deployed as an exploded-archive. The file (archive) or directory (exploded) must end with .ear, .war or .jar. The default name set by Intellij may not work.
myProject_ear/ is wrong
myProject.ear/ is correct
The deployment system of your application server is likely configured to only deploy files or directories ending with the correct file-type. This is especially true if the server is using the file scanner to detect modules to deploy or un-deploy.

Related

Eclipse Jboss Tools - Deploying parent child project

I am new to jboss-tools. I am facing some configuration issues. I have configure jboss-tools and added wildfly 8.1 runtime.
I have one web application and many supporting java project. I have configured build path for the web application,added all the child projects in the build path.
Now I want to deploy them.
The problem is that child projects are deployed as "jar" files. They are deployed in web-inf/lib as jar file. I am unable to debug them.
I want to delploy them as exploded archive in the web-inf/classes.
Using the "Deployment Assembly" when ever I add a project, it is added as for example "abc.jar"
Please help.
Thank you,
Rashid
Deploying modules as exploded jars is a new feature in JBoss Tools 4.3.0.Final. From the release notes:
In Wildfly 8.2, support was added for exploded jar deployment inside exploded wars. This has allowed our tooling to support this use case as well. This new functionality will be very useful when creating a modular web application, with different parts implemented in separate projects. Hot deployment of resources such as Facelets' XHTMLs is crucial for rapid development and testing
JBoss Tools 4.3.0.Final is available in the Eclipse MarketPlace

Is there a way to deploy a Maven project with "jar" packaging into Tomcat7?

My project generates a Jar as the output package and uses an external War file, available on our Artifactory, as the Web Application to be deployed on Tomcat (currently using version 7). This War file contains all libs and modules required for the application to run.
I have already packaged and ran those projects outside eclipse on a "vanilla" Tomcat installation. In this scenario, the Jar my project generates is loaded on the context.xml file this way:
<Loader className="org.apache.catalina.loader.VirtualWebappLoader" virtualClasspath="/home/igor/workspace/myapp/myapp-2.4.3.jar"/>
Is there a way I can deploy this project on Tomcat using Eclipse and still be able to debug it? Can I use the Jar generated for this purpose or do I have to deploy the workspace project?
As for the War file, do (or can) I have to add it as an dependency?
Thanks in advance!
EDIT
We actually provide an Web Framework, which is packaged as a war. Other applications that use that framework are exported as jars and loaded into the framework through the context file as cited above.
Your question is confusing probably because of your custom plugin/classloader and deployment which is sort of orthogonal to debugging.
What I recommend is you keep whatever system you have to build/package/deploy and use JVM remote debugging. That is do not use the Eclipse WTP since you seem to have custom steps for deployment but rather build your code deploy & run a separate Tomcat instance and then run the remote debugger in Eclipse.
You will get some hotcode swapping with this method but not as much as something like JRebel.. (which you could use also) it will certainly be better than constantly redeploying.

Jboss Quickstart using Maven (jboss-as:deploy)

I am new to Maven, I am trying to go through the EAP(JBoss) clusterhasingleton quick start guide.
http://www.jboss.org//quickstarts/eap/cluster-ha-singleton/index.html
I can deploy the jar and everything works fine by running
mvn clean install jboss-as:deploy
I need someone to please explain what does "Deploy" mean in Maven/EAP as i have used JBoss 5 and deployment in that version meant copying the jar in deployments folder(i was using ant) where as i can't find the jar file in the deployments folder in EAP although everything is working.
I can see the jars in the local repository in .m2 folder and target folder in the workspace. How does Jboss know that is deployed? and does it look at the local repository and how?
Kind Regards,
Why does it matter?
In any case the maven repo is not relevant. In JBoss 5/6, placing applications in the "deploy" directory would indicate to JBoss that those applications should be deployed.
You can do the same thing in JBossAS 7.x (aka EAP 6) and WildFly 8.x using the "deployments" directory.
It's important to understand that deployments are not in-situ. The actual deployment is stored in a virtual file system. The deployment is written directly to this VFS when you use the maven tool.
The deployment process is much more than just copying WAR and EAR artifacts into the server. For instance, servlets, EJBS, JPA components, CDI components and other managed objects get wired up, validated and perhaps made available in JNDI.

deploy maven war file to tomcat from IntelliJ

I have a maven war project. How can I do do the following from within IntelliJ IDEA:
create .war file
deploy it to a local Tomcat
start Tomcat in debug mode
You need to configure maven-war-plugin to build your war. tomcat<x>-maven-plugin will allow you to deploy it to a tomcat instance and may in fact do the war generation too - I use JBoss at my current office so haven't got any experience with the maven tomcat integration.
see http://tomcat.apache.org/maven-plugin-2.0-SNAPSHOT/ and http://maven.apache.org/plugins/maven-war-plugin/ for some more details on both of these plugins.
You can use the cargo plugin too. It works pretty well for me.

How do I build .war file in Eclipse for Glassfish server

I have web application written in java using Eclipse. It has just one servlet that does some file manipulations. How do I build war file so I can easily deploy it to my remote server.
Right-click on the project, select 'Export...', then choose web -> WAR.
You should be able to use Maven to package a WAR to deploy to your remote server. It looks a little daunting, but once you create your own WAR file you should be ok, check out:
http://maven.apache.org/plugins/maven-war-plugin/usage.html
In fact you should be able to manage deployment using the Maven Glassfish plugin here:
https://maven-glassfish-plugin.dev.java.net/
That will allow you to start,stop,deploy,undeploy etc... your web app. Example here:
https://maven-glassfish-plugin.dev.java.net/examples/complete.html
Just for the record,
The default build artifact for a
NetBeans Web project is a war
The default build artifact for a simple
Java project is a jar

Categories

Resources