I am using eclipse kepler edition. I install eclipse sts plugin for kepler. But when I want to create a spring-roo project in the dialog it say that there is no roo installation configured. then I try to add dependency from spring site
<dependency>
<groupId>org.springframework.roo</groupId>
<artifactId>spring-roo</artifactId>
<version>1.2.4.RELEASE</version>
</dependency>
to my project pom file. but when i run command mvn clean package -U it say no dependency information available. I was looking for it on mvnrepository i cant find it and on findjar.com. It seems the spring foo does not exist on repo.maven.apache.org/maven2. I have no problem in getting other dependecy and every thing work fine except spring roo.
You need to configure the following repository to access Spring Roo artifacts:
http://spring-roo-repository.springsource.org/release
Related
The official page(https://www.ninjaframework.org/documentation/modules.html) mentions Mustache template engine and its referenced page(https://github.com/kpacha/ninja-mustache) seems to say that Mustache template engine can be used. Is it true?
We added the following dependency to our pom.xml, but the Eclipse reported an error at the first line of this dependency in the pom.xml and we couldn't build our Ninja Web application.
<dependency>
<groupId>org.ninjaframework</groupId>
<artifactId>ninja-mustache-module</artifactId>
<version>0.1.1</version>
</dependency>
If possible, what should we do to avoid the error and to use Mustache template engine instead of FreeMarker?
I have checked out the project and it seeems its Maven artifact is not published on any Maven artifactory, neither Maven Central Repository nor Github Maven registry.
The landing website https://kpacha.github.io/ninja-mustache/ contains links for downloading the project itself. The repository https://github.com/kpacha/ninja-mustache contains the following directories:
ninja-mustache-demo
ninja-mustache-module
The ninja-mustache-demo imports the ninja-mustache-module in the pom.xml and serves as an example. It assumes the ninja-mustache-module was packed and installed to the local Maven repository manually through the command mvn clean install.
The only way I see is to include ninja-mustache-module as a Maven module into your repository and add it as a dependency.
Is there any way to add dependencies to existing spring project using Spring CLI (for instance via shell)?
I tried to looked for on this website
docs.spring.io.
But I couldn't find working way of adding dependency like Spring Web or Spring Data JPA to existing spring project.
If you are using STS or Eclipse for your development then you can easily add dependencies using CLI. You need to press the Ctrl+Space Bar in your pom.xml. It will show you the option with Edit starters as shown below, then click on it it will open your CLI interface
Ctrl+Space Bar
You can use pom.xml to add dependencies to your existing spring project whether you created your project by using Spring CLI or any other way.
Go to Maven Repository: https://mvnrepository.com/
Search for your required dependencies
Copy the dependency for maven and paste it in your pom.xml
To add a dependancy from Spring CLI, you can use the following command:
spring init -a <name_of_your_artifact> --dependencies=web,data-jpa <my_project>
where:
<name_of_your_artifact>: the artifact Id for the project.
and
<my_project>: name of the file where the .zip of spring initilizer will be extractred.
I am starting a new project with maven and spring boot and got problems already at the very beginning :-) Finally it works now, but I would like to know what I did wrong:
I simply wanted to add spring boot to my project by adding the maven dependencies:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-build</artifactId>
<version>1.5.9.RELEASE</version>
</dependency>
which can be found in Maven-Central.
This doesn't work.
Then I found out, that the correct dependency is without "-build":
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot</artifactId>
<version>1.5.9.RELEASE</version>
</dependency>
I would like to understand, where is the problem:
Do I get the info on the wrong place and maven central is wrong ?
Or why did I get problems from beginning. What is the correct aproach ?
I think one of the best approaches for creating new SpringBoot projects is to use the Spring Initilizr: https://start.spring.io/. With this tool you will get a generated .zip file which containts the basic maven/gradle folder structure and has the correct dependencies in your pom.xml or build.gradle file. During the creation of the .zip you can easily search for you required SpringBoot dependencies like Web or Security and with a tick in the checkbox will get you the right dependency.
You can also use a Plugin for Eclipse called Spring Tool Suite which enables you to create fresh SpringBoot project out of eclipse with rightclick -> New -> New Spring Starter Project. This is also available in IntelliJ or you use the dedicated IDEA STS from Eclipse https://spring.io/tools/sts/all
I am trying to create a simple Maven project in Eclipse Luna. I am trying to create a simple web project using the Artifact Id spring-webmvc 4.0.5.RELEASE.
Now, when I click finish it's giving me the following error...
Spring_mvc_err
I thought, may this arctifact id does not exist in my Eclipse Luna, therefore search google for this artifact id and found this url:
Spring Web MVC
Any idea, how i can add this artifact id in my eclipse IDE.
i have managed to create and successfully deploy (on web server) the basic spring MVC application for the archetype 'maven-archetype=webapp', using following command on command-line:
mvn archetype:generate -DgroupId=com.wiley.beginningspring -DartifactId=basic -DarchetypeArtifactId=maven-archetype-webapp -DinteractiveMode=false
I've managed to resolve my issue by following this link https://maven.apache.org/guides/getting-started/maven-in-five-minutes.html
I want to use GAE with Spring MVC
so, I found this following site.
here
but This site's example seems to manually add jar files.
I think it is inefficient.
In eclipse, Is there another way like adding dependency on pom.xml in spring MVC project?
I would suggest you to git clone the guestbook-spring project (it's adding Spring MVC to the GAE guestbook example) and continue from there.
We have builded our webapp app based on this, and it's great.
P.S. Also, it got tests for the controller included. It's good to have it as inspiration for testing you future app (as a developing practice).
Yes, if you have created a maven project, then it is much easier to add dependencies using pom.xml.
You can edit directly, or use eclipse maven pom manager to add dependencies directly, or from a repository.
The link you gave does not create a maven project, but you can modify the instructions so it does.
You can create maven project instead of Web Application at the start, then add Spring dependencies and continue adding dependencies from there.
You could use gae archetype to create your project firstly, and then add spring components to pom.xml:
mvn archetype:generate -Dappengine-version=1.9.14 -Dapplication-id=your-app-id -Dfilter=com.google.appengine.archetypes
where -Dappengine-version is set to the most recent App Engine Java SDK version, and application-id is set to the Developer console application ID used for your app.
I found simple way.
1.First, Create Spring MVC Project, and add dependency and plugin in pom.xml
1.1 add gae dependency
<dependency>
<groupId>com.google.appengine</groupId>
<artifactId>appengine-api-1.0-sdk</artifactId>
<version>1.9.14</version>
</dependency>
1.2 add gae plugin
<plugin>
<groupId>com.google.appengine</groupId>
<artifactId>appengine-maven-plugin</artifactId>
<version>1.9.14</version>
</plugin>
In WEB-INF, create appengine-web.xml and logging.properties
then, you can run it on server
Create a new Web Application project as it is shown, after that right click project -> Configure -> Convert to maven project.