How to build Spring Roo project without maven?
P.S. I use STS to create Roo project. I use maven for dependency management. Thanks to m2eclipse I have all libraries on eclipse classpath.
I have other non-Maven referenced. So maven fails to build.
You can't. Well, I suppose you could manually create an Ant-based build file that would do the same thing, but why?
One of the purposes behind Roo is that it helps manage the dependencies and build processes necessary for your chosen data persistence architecture. Maven is currently the standard build tool for doing just that, and you get its best practices implemented for you by creating the project via Roo.
Alternatively, if you're just trying to import a Roo-created project into Eclipse try ...
roo> perform eclipse
...
That will generate Eclipse project files that you can import.
This is about using custom maven artifacts.
Create a custom Maven repository, place your referenced jars in there and include them as dependencies in your pom.xml file.
Learn some Maven, it would really help - specially when working with Roo.
Related
I have a simple basic question. If I develop plugin for Kura in eclipse with maven, can I use dependency feature of Maven? I mean, when I use Maven for my Spring projects, I simple add dependency to pom.xml file and I can use in my project. Since I run Spring project on my local machine, dependent .jar files can be used runtime. This time, I will deploy my plugin to another device (Raspberry) , I have to put everything in the bundle .jar package. Can Maven do this or should I add dependent .jar files to classpath manualy?
You can use maven shade plugin to build the so called uber-jar - one jar that will contain your project along with all the dependencies.
I have recently started out on Maven. I am trying to integrate Maven+eclipse(Juno)+tomcat7.
I have downloaded m2e-wtp plugin for eclipse and created a Maven project whose structure follows a standard Maven project structure. It is also configured a dynamic web project.
It is a multi module project with two modules of flex(f1 AND f2) and one module of webapp(w).I have configured all the plugins correctly and there is no problem with configuration of POMs.
What I want to achieve is :
When I clean and Build project in Eclipse using Project-->Clean,Eclipse does not build the war in target folder of my web application project (w). I also does not copy any of the flex resources to target folder. However,
When I run the project as maven build by right-clicking the web application project and running it as a "maven install" it creates everything as expected.
My question is that if it is possible to achieve what I mentioned in point (1)? Or the only correct way to do this is the way mentioned in point (2).
I am also not able to deploy the generted files in step 2 automatically in tomcat.
Do I need to use another maven plugin for this?
Please note that this i my first experience with Maven + eclispe. I have followed certain tutorials. So, Please be lenient while voting negatively.
From what I know it is not possible to force Eclipse to use Maven directly (I would gladly be proven wrong).
Eclipse does not use Maven to build (1). Using the m2e plugin, it is possible to run maven to perform the build as you discovered (2).
If you are looking for that kind of tight integration you can look at NetBeans or IntelliJ who are using Maven natively.
EDIT:
About (3) there is a Tomcat-Maven-Plugin that can deploy the WAR file created on a running tomcat instance. Check the Usage page for more details.
How do I configure Spring STS to work with an existing multi-module Roo project or create a new one from scratch?
Let's take the first case: Creating the project outside of the STS with the Roo shell.
All I do is create the parent project and add a maven module to it. I have not setup JPA or created any entities.
When importing this kind of project (as an existing Maven project), Spring STS doesn't attach a Java project nature. As a result, I can't use the content-assist features of the IDE, or perform refactoring (STS complains the code isn't on the build path).
In the second case, I just want to create a new project from within the STS and start using Roo with multiple maven modules that will be created later.
When using the New Spring Roo Project wizard, I select the package type to be "POM" and let the wizard do it's job. However, errors are reported in the Problems view. STS is complaining it can't find the expected source folders (e.g., src/main/java ...).
Why is this so damn hard?
Thanks,
Jeff
Well I've been using Roo for a while and noticed the same anomalies you just reported. I didn't check your blog yet, but marked for further reading.
Anyway, for my multi-module projects, I usually create them inside or outside STS. Both resulting in the same problems you reported (#1 wrong parent project structure, not finding src, and #2 corrupting projects after importing as Maven projects).
First thing I'd like to clarify is that you don't have to run "perform eclipse" before importing a project into STS, or any Eclipse version with the Maven Plugin. The import will work (with previous flaws) just by the "Import Maven Project" option (and this is also explicitly written in Roo manual).
As for the issues we are talking about, well, I usually remove Roo nature from child projects' POM, to avoid opening Roo Shell (if it happens, Roo tend to delete some .aj files and, as you said, it will corrupt your project). Then I stick to Roo only by using inside the parent project, and then using the "module focus" command to work with child projects.
I believe Spring team will make everything works fine in due time, but for now, Roo is a great option and I believe those workarounds are worthy to keep using it inside Eclipse/STS.
Best regards,
Thiago Uriel
First of all, if you need to work with your Roo console based project in Eclipse - you need to run perform eclipse in your Spring Roo shell. Internally, it calls the Maven Eclipse Plugin and run mvn eclipse:eclipse to make sure your Maven project can be imported successfully to Eclipse / STS.
Related to the multi module projects, please see existing questions related to multi module projects on StackOverflow.
Cheers.
HI need some help or advice on converting or migrating an existing Ivy managed dependencies project to a Maven.
is there any good document or plugin? I am using eclipse.
Thanks
Ivy is an ANT plug-in meaning only responsible for dependency management. An ivy task called called makepom can be used to generate a maven POM from your existing ivy.xml.
Your real challenge is converting your project build over to the "Maven way" of doing things, which means you need to investigate migrating from ANT to Maven.
Hope that helps
Is there a way to do incremental deployments with these three tools when in a multi-module project?
Example of Maven project:
project
project-data
project-service
project-webapp
The above are Maven modules with dependencies between them. The project-webapp module contains the .war file, but I don't want to create a new .war file every time I need to deploy. Is there a way to perform deployments upon file saves?
Use the Eclipse WTP support (and either the maven eclipse plugin or m2eclipse to import your project as a dynamic project). Did you try? Are you facing any particular problem?