Is it possible to create same ear file in maven which is generated from ant in Ant to Maven migration? - maven

I am trying to migrate enterprise application from ant to maven. Can we generate same kind of ear file in maven which is generated from ant?
Because ant ear file has different folders in it along with group of jar and war files.Few folders contains dependency jars and one of the folder has shell scripts. How to add this folders in maven project?

Related

maven-war-plugin - changing the location of files in the output war file

I am converting existing projects to maven.
My task is to just write a POM which will create an exact deployables as ANT script is producing.
I have to match MAVEN output war file with ANT generated war file.
Ant script is copying a.jsp, b.jsp, c.jsp, d.jsp directly under the myProject.war and e.jsp under "myProject.war/def/e.jsp"
How to implement it using maven. I tried using resource plugin but it is just changing the location under "target" directory and not in the final war file.

Compile a jar during Maven build then package as ear from single pom.xml?

I have a maven project currently structured that has to build a jar first from some source files, then create an ear file containing that jar along with some other xml resources. The way I do it at the moment is by building the jar seperate in a 'child' pom.xml then at the root of the project folder I have a parent pom that does the ear packaging.
I know it isn't ideal, but I what to be able to compile the jar and then package it into an ear all with just one pom.xml file. Any ideas on how to do this?

How do I build an exploded WAR in a multi-module Maven project and also include sibling JAR files in its WEB-INF/lib directory?

I’m using Maven 3.3.3 with the Maven WAR 2.6 plugin. I have a multi module project with both JAR and WAR projects within it. My WAR projects depend on my JAR projects, however, I do not want to package my WAR files, opting instead to keep them in an exploded form. So I tried running this command
/usr/local/apache-maven-3.3.3/bin/mvn -B -f /home/jboss/.jenkins/jobs/subco/workspace/pom.xml -B clean prepare-package war:exploded -DskipTests -T 3
Although this keeps my WAR exploded, the JAR projects do not get included in my web application’s target/myproject/WEB-INF/lib directory. Instead what is included are empty directories where my JAR files would have been, for instance
.jenkins/jobs/subco/workspace/myproject/target/myproject/WEB-INF/lib/child-jar-module-2.0.0-SNAPSHOT.jar/
How can I keep an exploded WAR, include my JAR files, and do it all from the command line (as opposed to creating a custom profile in my parent pom to do it for me)?
Edit: If you think this is a duplicate of another one, notice the part of my question where i point out that empty directories are generated when using the "prepare-package" phase. I don't want that.

How to build project WAR file and it's dependencies in TAR/ZIP file

I am new to Maven and know the basic concepts of Maven. I got a requirment to work on mavenizing multiple projects which uses most of common/same jars.
I was asked to build a TAR/ZIP file that contains all the jars and build WAR file for each project with out jars. So that Project (WAR) can use jars present in TAR/ZIP file.
finally after build, TAR/ZIP file needs to be deployed on server forst and later WAR file. so that, in run time WAR can have refrence to jars.
Can anyone please help me in this ?
Actually this structure will reduce size of WAR files as we are keeping these jars in single TAR/ZIP file and deploying it in tomcat server.

how to make maven war:explode do not pack a jar file

I'm new to maven.
I'm now working on a multi module maven project, when i use maven war:exploded ,it will packaging classes files to WEB-INF/lib/***SNAPSHOT.jar.
Is there any way to leave the classes files under WEB-INF/classes , for when java file changes, there is no need to replace the whole jar file?
Thanks

Resources