Building existing eclipse project with maven tool - maven

I am new to maven tool. I have a java project on RAD 7.0.Compiling the project and building jar with RAD 7.0 taking huge time. So to remove the time wastage we planed to use maven 2.
we are not permitted to change the application structure and package structure. Please help me ?

You can keep application structure, you just have to parametrize correctly the pom.xml that describe the project.
In your pom.xml, you'll have to add all dependencies included in your classpath and project structure (sourceDirectory, testDirectory) via plugins
You can find some samples in the older post :
How to create the pom.xml for a java project with Eclipse?

Related

Creating a maven project from existing sources. Best way to create the dependency entries from the jars in project library

Want to shift to maven for my old java web project. So created a basic pom.xml using IntelliJ Idea facility. The project is a J2EE web project and also uses axis 2 1.7.7 . All the jars are in 'lib' directory inside the project structure. Is there a easy way to find out the dependency entries which will be required in the newly created 'pom.xml' . What I mean is a a tool which can pickup the jars one by one and suggest the dependency entries
Any help will be highly appreciated here.Thanks
I don't think there is such a tool.
Note that you probably only need to add some of the dependencies because Maven resolves transitive dependencies automatically.
So I would look into the source code, figure out which classes you import and add the appropriate dependencies.

how to add jar creation to J2EE web project

I am a newbie with maven, I created a dynamic web project in eclipse and then converted into maven project.
Instead of deploying the project in a standard container I would use embedded jetty.
How can I create in maven the appropriate jar executable with all dependencies included?
Thanks
Roberto
Found solution by myself at
http://blog.anvard.org/articles/2013/10/09/embedded-jetty-executable-maven.html
Basically we can add as many maven plugin as we want, adding dependencies and then packaging all togheter.

MAVEN - generating jboss 7 (or EAP 6.x) modules from dependencies

I would like to ask, if there is some maven plugin (or another way) to generate jboss modules hierarchy (with modules.xml files) from maven dependencies (or in list of libraries for such a maven plugin) ?
I have found this plugin :
https://www.smartics.eu/confluence/display/SJBMMP/smartics+JBoss+Modules+Maven+Plugin;jsessionid=3CA5AE2D1DEB5DFB62C1E64692EDCAB6
But documentation / usage pages seem to be offline (or for some reason I cannot open page).
Thank you very much for your help !
I have tried SMARTICS plugin plugin and it created for each maven module special JAR file with ALL dependencies in it.
It is like using maven assembly plugin but all libraries are packed in standalone jar which can be placed into own jboss module. Than in your application : jboss-deployment-structure.xml you reference to this librari (e.g. jar file) and application has all libraries provided.
But splitting dependencies into own directories and generating modules.xml is not possible (confirmed by JBOSS EAP support).
I will create standalone maven project (something like "JBOSS-modules BOM project") which will generate such structure (this structure will be ready for usage on jboss).
I just would like to add an introduction to the mentioned plugin for Maven:
https://www.smartics.eu/confluence/display/BLOG/2013/10/18/Maven+Plugin+to+generate+a+Modules+Directory+for+JBoss+AS+7
The article includes screenshots that help new users to get an idea on how the plugin generates separate modules.
(I would like to comment to your answer, but unfortunately I'm some points from being entitles to do so :( )

how to generate .exe file using maven for RCP plugin project

I have created one RCP Plugin project and converted it into maven project.
I have to generate .exe file for this project using maven.
The problem is that this RCP project not have main method.
Please share how to to do this.
See the tutorials at the Code & Me blog. They take you from the basics of building a single plugin with Maven Tycho to building more complex artifacts such as products (which include the .exe), update sites and the like.

Netbeans Project Configuration When Using Maven Project

does anyone know how to configure a project using maven? My issue is that when I create a project by doing New->Maven->Enterprise Application Project, I don't get all the IDE helpers that are available when I create the equivalent project using the default (which is an Ant project) option by doing New->Java EE->Enterprise Application Project.
If I go to the generated Main.java in the default project I get the option to use ALT+Insert which brings up useful Java EE code insertion helpers such as "Call Enterprise Bean", "Use Database", etc. These are not available in the maven generated project.
Looking at the default project's files, the project.xml contains this entry "org.netbeans.modules.j2ee.clientproject", which I believe is the IDEs instruction to generate the Java EE helpers for this project.
The maven projects project files, pox.xml and nb-configuration.xml, haven't got this entry. The nb-configuration.xml file does however have these entries:
<org-netbeans-modules-maven-j2ee.netbeans_2e_hint_2e_j2eeVersion>1.7</org-netbeans-modules-maven-j2ee.netbeans_2e_hint_2e_j2eeVersion>
<org-netbeans-modules-maven-j2ee.netbeans_2e_hint_2e_deploy_2e_server>gfv3ee6</org-netbeans-modules-maven-j2ee.netbeans_2e_hint_2e_deploy_2e_server>
which must have something to do with the project setup. They don't give Java EE helpers though. Anyone have any idea how to add something like the defaults projects "org.netbeans.modules.j2ee.clientproject" to the maven project to get the helpers working??
Any help appreciated.

Resources