Maven Tags doubts - maven

Hi all as i am new to maven project so can any body clear me about the tags as what i am thinking is that " " is name of the package where you want to keep your source codes and is the tag where we are mentioning project name for example without using maven we are creating a project through eclipse so we foolow the following steps
1-> new project
2->project name (in case of maven this comes under tag)
3->we create a package name for keeping source codes inside it (in case of maven this comes under tag )
so like this we proceed in our developmennt.
please sujjest me whether my understanding is correct as i have described above.
waiting for your reply

I think you want to know some basic things about MAVEN project.
Like how to Create a maven project.
How is its directory Structure,etc.
Let me help you with it.
New Maven Project
Give some name,select type of packaging from dropdown(jar/war/pom)
Once project created add to your POM file.
Write web.xml(dispatcher servlet)(src->main->webapp->WEB-INF)
Write you Code in some package.
You need Maven installed on your eclipse and also you must set user settings.
INSTALLING MAVEN
Click Install new software option on your eclipse. You can find it under HELP tab.
search "maven for eclipse kepler" and install that particular setup.
Now once done open "preferences" Under Maven->Installation browse to the Apache-maven path wherever you have saved it.
Now change User setting,give path of your settings.xml(this xml has path of your repository)
Now you are done with installaion.
I hope this is answer to your queation as your question is already very confusing.

Related

unable to create maven project in eclipse photon

I have been trying to create a maven project in eclipse photon.I also tried checking proxy settings,linked a "settings.xml" file in user settings,linked a "catalog.xml" under archetype.But it didn't worked.Eclipse is configured with java 8 version.I am unable to upload photos so i will describe.
These are the steps I followed while creating Maven project.
File->New->other->Maven->Maven Project->Next->Next->Selected Archetype-quickstart1.1->Next->provided Artifact and Group Id and Finish.
Here I'm getting could not resolve archetype error.
It's not very clear the issue you are facing and how you are creating the maven project. Eclipse comes with a great in built maven support. It's not necessary to configure settings.xml unless you are using your own repository instead of the default repository .m2
However assuming that you have installed Eclipse Photon correctly. Here are the steps involved in creation of simple maven project.
Click on File-->New-->Others.
On the new window look for maven and click on Maven Project.
This will launch new window **New Maven Project*. If you don't want to select available archetypes, then click on the checkbox named "Create Simple Project(Skip Archetype Selection)" and click on next.
Fill in your project details and click on finish. That's it.
Eclipse will generate a fresh maven project for you.
The other configurations are required based on the type of project you are creating.
Hope this helps !!!

how the best way to create project with maven on eclips?

i know there are 2 methode to create project with Maven.
Create Dynamic project on eclipse and convert it into maven project
Create Maven project with command line and then import the project into eclips.
i always do the 1. choise.
If You have latest eclipse IDE then its very simple.
Go to Create new Project wizard and search maven project. (if its old eclipse IDE then you probably need to install m2e plug in from market place).
select maven project and next. Check (Create a simple project) if you want customization other wise just click Next and You will be presented a number of ready made archtypes.
For simple console projects you can chose maven-archtype-quickstart. or what ever project you want to create.
Now Give groupId e.g. com.yourcompany or com.yourprojectgroup and artifactId e.g. projectname-alias . and Click Finish.
First Time eclipse will create local repo if its not already created and then put default dependencies defined by provided pom in your local repo. Further you just need maven knowledge to customize project. e.g. New Dependencies and build system etc.
I hope this will clear your mind. I prefer this way because its fast and easy.
If you create a new project in Eclipse (at least in Mars or Neon), you can choose "Maven Project" and get everything you need. Don't use eclipse goals of Maven. They are deprecated.

Spring STS not recognizing project structure with Gradle

I'm trying to do this getting started guide from Spring. So I cloned the project using git from the command line. As I'm working with Gradle, I removed the Maven files from the repository to clean the project.
After that I open my STS and go to File -> Open Projects from File System and navigate to the /initial folder of the repository. The project is imported correctly but when I try to add some "java stuff" (packages, classes, etc.) I get several errors and I can only add folders and files, which is quite annoying for working.
To be more descriptive, I'll add some images so you can see what's happening. This is the project initially imported into STS as I described above:
Then I try to add some java stuff, let's say for example a source folder. So Right Click on library -> New -> Source folder and this is the result:
And in the properties of library I have the following:
So the question is: how can I tell to STS to recognize the library folder as a Java Project (or Gradle module, I don't know how to call it) instead of a plain folder so I can add my packages and classes?
Thanks in advance for your answers.
In case you would like to work with Gradle, you should use the Gradle integration for Eclipse (project Buildship) and install that into your STS environment. After that, you should be able to import the projects either from disc as existing Gradle project (not as file system) or via the wizard that integrates the spring guides into STS (Import Getting Started Content). The wizard for the guides also let you choose between the Maven and the Gradle variant, so you don't need to close and delete stuff yourself.
Hope this helps!!!

IntelliJ No files were downloaded for xyz

I've created a new project in IntelliJ.
When I go in to:
Project Structure -> Libraries -> Add -> From Maven -> 'com.atlassian.seraph:atlassian-seraph:3.0.3'
I get the error message 'No files were downloaded for com.atlassian.seraph:atlassian-seraph:3.0.3'
Backstory:
I'm using IntelliJ to write a custom SSO authenticator for JIRA. This is not a JIRA plugin, it's just a class that a custom JSP will use.
I intend to produce a JAR and put it in WEB-INF/lib.
I'm not sure what I've missed here. This is my first exposure to maven and I've googled this extensively.
If you did not change the default remote repository of your maven, it should be this . It seems that the artifact (com.atlassian.seraph:atlassian-seraph:3.0.3), you are looking for, is not in the default remote repository. There are two solutions for your case,
1.Add a new remote repository, which has this artifact, to your project.
2.Find the jar file somewhere on internet, add it to your project as an external jar file. Here is a great tutorial about this.
I've changed from idea 14 to idea 15, and downloading maven jar feature started to work)
My Maven setup in ide aimed to external v3.2.1, but may be it would work even with bundled one.

Maven archetype for JSP

I have a problem. I want to create Java Project which uses Servlets and JSP. So I create new Maven project and choose maven-archetype-webapp. So it creates the project, but there are .idea and src folder. There isn't source folder. What should I do to be generated "source" folder. I have the dependencies needed. I am using IntelliJ. While using Eclipse I have absolutely the same problem. I fix it with checking "Maven Dependencies" in "Java Build Path/Order and Export". It worked in eclipse, I don't know why. Or can someone tells me how to create project in IntelliJ which has generated pom.xml, web.xml and "source" folder. The question may be stupid, but I really don't know how and obviously I make something wrong.
Thanks for your attention.
You should try to stick to the maven default project layout convention.
All tooling defaults to this structure (see the link given above).
In Intellij you can easily create a Maven project via the "New Project" dialog.
If you want to keep your current project layout, you can try to right click on your "source/production/java" Folder and click "Mark Directory As" and then "Source root".
This marks it as Java source folder.
You should then be able to create new classes via Context menu.

Resources