According with the Spring Roo 1.3 Docs, MongoDB is supported, and can be configured with:
roo> mongo setup
But with Spring Roo 2.0.0.RC1 you get:
roo> mongo setup
Command 'mongo setup' not found (for assistance press TAB or type "hint" then hit ENTER)
Searching 'mongo setup' on installed repositories
0 matches found with 'mongo setup' on installed repositories
MongoDB persistence layer was removed? Can be added in some way?
In this task, during the Spring Roo 2.0 definition, we decided to create a smaller and easier to maintain Spring Roo distribution.
From 2.0, Roo will contain the runtime and the main addons only, so new versions could be released more frequently and being kept up to date with lastest Spring projects. This provide us the posibility of make a better separation between the Spring Roo runtime and the main addons. The Roo runtime APIs (classpath, metadata, support, etc.) must be kept as stable and backwards compatible as possible.
On the other hand, we moved the addons not classified as ”main addon” (GWT, JSF, Mongo DB ...) to their own Git repository
https://github.com/spring-projects/spring-roo-community-addons
These addons will be maintained by the Roo community.
From now on we will know this addons as “Spring Roo Community Addons”.
As you could see, these addons are not migrated to the Spring Roo 2.x version, so if you want to use the Mongo DB addon you should download from there and apply some updates. After apply changes, generate the .jar files and use the addon install commands to include them in the Spring Roo shell.
Hope it helps,
Related
We have developed a Spring roo project in STS with roo 1.3.1. I have now updated my STS to the latest version and installed roo 2.0.0 in it. When I try to import the existing roo project does not build successfully.
Can some one please tell me whether there is any compatibility issues with different versions of roo?
It was complaining about 2 dependency jars. So I added the below code.
<!-- https://mvnrepository.com/artifact/org.springframework.roo.wrapping/org.springframework.roo.wrapping.inflector -->
<dependency>
<groupId>org.springframework.roo.wrapping</groupId>
<artifactId>org.springframework.roo.wrapping.inflector</artifactId>
<version>0.7.0.010</version>
</dependency>
the above dependency was not needed for older roo version.
Eventhough I added the above code it is not working as expected.
Sorry, there is no way to do that. Spring Roo 2.0 has changed all its architecture and there is no way to migrate a project from 1.3 to 2.0.
By example:
Generated project in 2.0 is build on top Spring Boot
Data access layer has been changed from Active Record pattern to Repository (using Spring Data)
Default UI layer in 2.0 is based on Thymeleaft instead of JSP and tagx
There is no support in 2.0 for Reverse Engineering feature
To see the differences just try to generated the clinic.roo script in both versions and compare the projects.
I am using Spring Roo 2.0 and I am not able to add GWT addon. These have got moved to Spring Roo community but I am not able to find the repository URL to download the add ons.
The GWT add-on has not been migrated to 2.0 version yet (see pom.xml).
If you or your organization are interested to do it look at the community add-on repository.
I am using the latest (by the time of writing) Spring-Boot-starter-data-jpa (version 1.2.6.RELEASE). I find it actually uses the Spring-data-jpa version 1.7.3.RELEASE, which is considerably behind the latest (1.9).
Is it a supported approach to upgrade individual dependencies such as the Spring-data-jpa? If I do this myself, for example, by declaring a direct dependency on the wanted newer version (may just override the version properties), any side effect you guys foresee?
The reason why I am doing this is that I need to use a special parameter in this annotation:#EnableJpaRepositories(repositoryBaseClass = JpaRepositoryWithI18n.class)
That is not available in the supplied 1.7.3 jpa library.
Any workaround would be appreciated too.
Thanks
EDIT:
I tested the following two ways: 1) declared a direct dependency to Spring-JPA-data 1.9.0 and excluded it from spring-boot-starter-data-jpa 2) upgrade Spring-boot-web-starter to 1.3.0m5
2) worked out well for me. This is also what dunni's answer suggested.
I have not tested Andi's answer as this is a new project, we could easily upgrade the entire spring boot and regression test it without worrying too much about side-effects.
But I can see Andi's answer is an easier approach than 1). More importantly, it shows how you can upgrade other dependencies independently -- just overide the versions in parent pom.
Thanks
Spring Data JPA 1.9 is part of the Spring Data Gosling release train. As described in the Gosling announcement you can use it with Spring Boot 1.2:
To upgrade to the new release train use the BOM we ship as described in our examples repository and configure its version to Gosling-RELEASE. If you’re using Spring Boot, upgrading to the release train is as easy as setting the Maven property spring-data-releasetrain.version to that version. Note, that to use Spring Data REST with Boot 1.2, you also need to upgrade to Spring HATEOAS 0.19.0.RELEASE (by setting the spring-hateoas.version property) and Jackson 2.5 or better (current 2.6.1 preferred, via the jackson.version property).
In short, add this to your pom:
<properties>
<spring-data-releasetrain.version>Gosling-RELEASE</spring-data-releasetrain.version>
</properties>
It's not supported in that matter, that the Spring Boot test cases don't include newer versions. So your application might work with the newer version, but there may be some errors. With minor releases it's more likely to work without problems than with major version upgrades. You can also upgrade Spring Boot to 1.3.0.M5 (you should note however, that this is a milestone version, not yet the release).
I want to use a Spring Roo addon for Timestamp. https://github.com/rcaloras/spring-roo-addon-timestamp
The instructions are
osgi start --url file://$PATH_TO_DOWNLOAD/com.rcaloras.roo.addon.timestamp-0.1.3-SNAPSHOT.jar
timestamp setup
timestamp all
But roo replies
Command not found for osgi. Has this changed for 2.0.0?
I have also tried addon install bundle, addon install url, but to no avail. I've downloaded the jar file, but don't know how to get roo to recognize the addon. OR, is there a way to install an addon via spring STS in eclipse?
This add-on is developed to install it on Spring Roo 1.2.5. You can't install it on 2.0. Spring Roo 2.0 has mayor changes that makes it impossible (included a OSGi upgrade and a new system to handle add-ons).
Also, keep in mind current Spring Roo 2.0.0 is a Milestone, not a final release. It's not recommended for production environments.
On another hand, gvNIX jpa add-on can help you. This is developed for Spring Roo 1.3.0, and includes a add-on which includes this functionality (jpa audit setup, jpa audit add and jpa audit all). In addition this add-on can integrate your application with Hibernate Envers to store all changes on your entities (jpa audit revisionLog).
Good luck!
Is there a Mongo-based job repository for Spring Batch? If not, would I need to implement JobInstanceDao and its siblings? Are there any examples or existing works that would help in this endeavor?
there is a https://github.com/jbaruch/springbatch-over-mongodb project, it looks discontinued, but it might give you a better start
I have a github project which enhanced JBaruch's Springbatch-over-mongodb to newer versions of
Spring framework (4+)
Spring-batch (3+)
Mongo DB driver: 2.11.2
https://github.com/vfouzdar/springbatch-mongoDao
Though I have tested it and have a upgraded almost all of junits from JBaruch's project but it is still under BETA phase. If somebody is interested then s/he can give a try.