How to convert spring based java project into maven projects? - spring

I am planning to convert my spring based java project into maven project, so in this conversation what kind of project structure and configuration I should follow

You need to figure out the dependencies of your project and it would be better to unify them through either ready made BOM or you create your own
Maven BOM
To facilitate code organization, it is advisable to use multi-module projects
Maven multi-modules tutorial

Related

Migrating legacy ant project to maven / gradle

I have a legacy JAVA project and we use Ant to build it. We are planning to keep using ant for building the project but delegate the dependency management to maven/gradle without affecting the existing build process.
What might be the best way to move forward - with Maven or with gradle?
Since existing project has it's own structure(which may not conform to standard Maven archtypes), I know might have to make a custom archtype if using maven.
https://stackoverflow.com/a/48791837/2458858 provides one way to solve it but I am trying to find a standard solution in which I am able to delegate dependency management within the same project rather than a separate project.

Edit Java source code before compile

I am new to gradle. I am looking forward to migrating from maven to gradle.
I had few requirements:
Existing project is maven based, and is generating a fat jar/uber jar. I am planning to split this into multiple projects, and creating smaller/thinner jars/libraries
I am currently evaluating the Multi-project Build support.
I have to also edit the Java source code, automatically, like making the java source modifications based on certain conditions
Publish the project as maven based, as other projects which need these split-up jars are still maven based.
I suppose Maven plugin can be used for publishing?
Would Gradle be a good, scalable solution for these two requirements which I am looking into currently?
Also please provide some pointers around these two topics.
Gradle has very good multi-project support, far better than Maven's. You can start with this documentation section
You can setup compilation of generated/auto-edited sources as well. Take a look at this forum post, discussing compilation of sources created from database using hbm2dao
You can setup publishing of projects using the Maven plugin. pom.xml files will be generated automatically

create gradle multimodule project for AEM using lazybones templates

I had heard of lazybones, which is a command line tool for project creation and it is more interactive or customizable than Maven Archetypes. Thus, I created a maven multimodule aem project using lazybones.
The Command and template for AEM multimodule project is:
lazybones create aem-multimodule-project <target-folder>
This creates a maven multimodule project for AEM. Then, I tried to find the same for Gradle, but I didn't find any template regarding that.
Can anyone give me any direction how can I achieve the same.
Please consider using gradle aem plugin. It has a lot of features and might be good for your case
https://github.com/Cognifide/gradle-aem-plugin

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.

Can maven create a project from a war file?

I want to create a adobe flex blazeds project. How can I create the project using the blazeds.war as the project template ?
war -> maven
you can't do that, there's no way maven can guess how the war was produced only by analyzing the result
generating a project stub for blazeds
that you can do. You can used a defined archetype like this one: http://code.google.com/p/maven-blazeds-spring-archetype/
it will force you to stick to the technology (spring) chosen by the archetype developer, however.

Resources