Hello Guys,
I am new to both maven and spring. I want to create a maven based spring project and Here is what I am doing.
New->other -> maven project -> next -> next -> ?
Here I want to select a type of project with required folder set up. For example to set up a simple maven based java project i select maven-archetype-quickstart . But coming to spring I dont know which artifact to select and I have the feeling that it is not showing all the artifacts. I am attaching some screenshots of that step where I got confused.
To be more brief:
1) If I want to get a spring project which artifact should I select
2) It looks like I am not able to see all artifacts here. For example when I look for spring I see only two artifacts. when I search for webapp i see only two artifacts. Should I do any configurations?
3)How to know which artifact suites for example for basic spring project which artifact should I choose?
My questions might be pretty basic. Please help me
Thanks
The appfuse-basic-spring archetype should create a single directory spring project. This is probably what you want for a simple project.
The appfuse-modular-spring should create a multi-module (read: parent module with several child modules) project. For more information on multi-module maven projects I would suggest looking at chapters 6 and 7 of Maven by Example.
Related
i'm trying to create a spring MVC project using intellij Ultimate 2020 but i don't have it available in my menu :
Is there a way to get the Spring option ? i already checked that the Spring plugins are all enabled .
The Spring Initializr can generate a Spring Boot project structure for you. It will give you a basic project structure and either a Maven or a Gradle build specification to build your code with.
You can use Spring Initializer to generate a spring project. It will provide you with all the dependencies required for SpringMVC project
Go to https://start.spring.io/.
Just specify the dependencies.
Download the generated project.
Open the project with IntelliJ.
Resolve the dependencies by specifying the unmet ones in pom.xml if found any.
Good to go!
I don't know are u new in spring, but if u are, here some advice to start in idea.
First of all, visit https://start.spring.io/
First 5 steps of instruction matches with numbers on this picture
https://i.stack.imgur.com/T6NW1.png
Choose dependencies u need, for example start with spring web(mvc)
Choose your language, u need java
Choose which dependency manager u will use, for example maven
Choose spring boot version, for example 2.3.3
Give a proper name to your future project, it's not necessary
Press GENERATE
Unzip downloaded file
IntelliJ Idea -> Open or Import - > select unziped folder
Suppos that repo and share module were generated from maven alfresco archetype as described here. And now it needed to install one of alvex addons. It is clear that jars/amp can be build from sources, but what to do with this? Where to put they in generated maven project to get them installed in alfresco when mvn integration-test -Pamp-to-war is executed?
That tutorial assumes two separate maven projects created using the repo archetype and the share archetype, respectively.
If you want to be able to run integration tests with multiple AMPs you may rather use the all-in-one archetype instead.
See How to use external AMP in alfresco Maven Project
I am new to web prog. and wicket, so i went to below site to run example source codes to play with applications.
http://www.wicket-library.com/wicket-examples/index.html
Simply i create a "dynamic web project" and try to copy source codes to project.
All example's application classes are that type,
public class ...(ex.name).Application extends WicketExampleApplication
On the internet i found some of those examples with classes WebApplication, and i managed to run those examples, like that
public class ...(ex.name).Application extends WebApplication
So my question are;
1-How can i simply run those examples using dynamic web projects?
2-Copying source codes to my project after that how can i call libraries in my project using maven?
I searched many questions but couldnt find any topic who is trying to run those examples simply in a project.
Thanks.
Soso
instead of doing all the messy work just run mvn using tthis
[http://wicket.apache.org/start/quickstart.html]
now just copy the sources
if you any problem and you want to add wicket to an existing project just copy the web..xml , wicket jars and you would have wicket project (i would recomend wicket from another opm connecting you existing services and this way decouple services from the web container ...)
P. S the WebApplication thing they just inehrited it and called ExampleWebApplication
The best you can do is to use maven integration
Install Eclipse (that support Java EE)
Add all required maven related plugins
Version Control: Use Subclipse 1.8.x, see: http://subclipse.tigris.org/update_1.8.x
Maven Integration: m2e , is included in Eclipse Classic. Use
Help->Install New Software, select "--All available sites--" and
choose Collaboration -> m2e - Maven Integration for Eclipse
Subclipse/Maven Integration: Update site: http://subclipse.tigris.org/m2eclipse/1.0/
Then, just checkout the maven examples you got on the web
Go Eclipse--Window-->Show view-->Other
Type svn and select SVN repositories and open it
Then copy the check out address and add it to the svn repositories View
finaly, right click on the link you have added and check out as maven projects.
If you want to create new Maven projects
Create new maven Projects, new-->project-->Maven project
then in new Maven Project Window, in the Filer Text box, Type wicket and select org.apche.wicket as a groupID
After that, you can have your maven codes working well.
If still you got some debug errors, you can open your pom.xml file and add dependencies such as wicket-core and wicket-extensions
I need to build java project. The project should include two modules: domain and web.
The domain module contains all the entities, the business logic and hibernate integration.
The web module should be depend on the domain module and contains web application using apache wicket.
I wonder about the maven usage.
Should I create a project and modules using maven? If so, how?
What kind of archetype are relevant for my project and modules?
What is better experience - create the project myself or use maven?
I am using intellij.
I'm assuming you don't need a server for others to access your code,
but rather, you want to use maven/ant for internal project
organization/dependency resolution/source organization.
Should I create a project and modules using maven?
Yes, either maven or ant will be useful for any non-trivial Java or Java EE project with external dependencies, and build/testing requirements.
If so, how?
Either ant/maven will allow you to easily setup a platform independent "build" file, so that you can easily resolve dependencies, build your jar executables, and run unit tests in order by issuing a single command, rather than multiple clicks to different plugins in whatver the ide-of-the-month is. You can do this in eclipse using the maven plugin to create a new maven project, or , as you suggest, by creating an artifact by running the regular mvn install.
What kind of archetype are relevant for my project and modules?
To learn use maven-archetype-quickstart.
For a regular (simple) j2ee app, try maven-archetype-webapp.
There is also a j2ee archetype as well.
What is better experience - create the project myself or use maven?
A simple, 3-step, robust method for setting up a maven project :
1) Use maven archetypes to create and setup your "hello world" project.
2) Import the maven project into your ide as a java project.
3) Edit/refine/fix code in your IDE, but use maven to build and test the whole application.
Update: external web frameworks
Creating a wicket (or gwt or any other framework) oriented web app will
Be best done following specific tutorials related to the framework itself. In order to add theframework libs, just paste the maven info in your pom.xml like thus, and run a "mvn install" command :
<dependency>
<groupId>org.apache.wicket</groupId>
<artifactId>wicket-core</artifactId>
<version>1.5.3</version>
</dependency>
I'd recommend you to use maven. The reasons why I use maven:
IDE agnostic. You can use idea, eclipse or some other ID.
Dependencies management
Powerful plugin system
You can manually create 3 maven module
app.parent with pom packaging and no parent.
app.domain with jar packaging and app.parent parent
app.web with war packaging and app.parent parent
and import app.parent to idea.
Also checkout Wicket quick-start Maven archetype creation page http://wicket.apache.org/start/quickstart.html
Like in most spring+hibernate enterprise cases, I want to separate Dao, Service, Web layers into different modules, so that I can reuse Dao layer simultaneously in front-end and admin web site. The issue is I found m2eclipse does not support this multi-module project very well, any solutions?
I'm using eclipse 3.7 and Sonatype m2eclipse, I have a typical multiple-module structure project, one abstract parent, 2 children modules(A and B). I can run "package" from the parent, but I can not get hint when I input a "dot" after any object like system.out, and it says "This compilation unit is not on the build path of a Java project." Moreover, I can not invoke methods in A from B after I set dependencies in A's pom.xml.
I found a very similar issue here Issues with maven project running in eclipse, not recognized as Java project, but which does not solve my problem. I heard m2eclipse has removed this support for multiple-module project, but the need is so common that I'm 100% sure that there must be some kind of solution.
Thanks.
I got it working by importing the whole project and sub-module as individual projects as well. I find in individual projects I can get prompt hint methods and debug, but I'm using the whole project's pom to build.
Multi-module is still supported in m2e, I don't know where you heard that was removed but that's utterly wrong.
You simply need to import your sub modules as existing maven projects.
Also take a look at http://www.sonatype.com/books/m2eclipse-book/reference/creating-sect-importing-projects.html#fig-creating-import-multi