STS maven project not showing all files - spring

STS screen image
I have created new maven project from start.spring.io
But after importing .jar file in STS tool its not showing src/main/java ,src/main/resources etc files
what to do any idea?

Your POM.xml is indicating an error. Have look at your POM.xml and fix the error, maybe Maven is unable to find a dependency or your POM.xml is broken (-> bad syntax?). If Maven can properly find all dependencies and accepts your POM.xml , STS will then show the correct Maven project structure.

Related

When is it a maven project?

When I download the .zip-file from start.spring.io, I download a maven-project, right?
Is it a maven-project, as soon as I use maven to manage my dependencies? Or is a maven-project something seperate, which I include into my project?
You have two possibilities:
1. To download a Maven Project from start.spring.io using Spring Initialzr.
2. To download a Gradle Project from start.spring.io using Spring Initialzr.
The project that you download from start.spring.io, in your case it's a Maven Project with all the selected dependencies already. You can recognize a Maven Project about pom.xml file where all the dependencies are included. So, all you must do after downloading the zip file from start.spring.io is to unzip the archive and after that to import the maven project (chosing the pom.xml file) in you IDE.

How to make maven project to see dependencies in my local repository?

I have been facing difficulty with adding dependencies to maven war project .Everytime ,when i try to add dependency in my pom.xml, i don't see java ee 7 api in pom.xml dependencies tab.After i copied from maven repository dependency code to pom.xml source tab,then my project goes fine.
But when i create another new project , then i try to add dependency in pom.xml dependencies tab and i don't see any api.So, i have to copy dependency code from maven repository and add to my pom.xml again.How can i get rid of this?

Apache log4j 1.2.17 missing artifact error on pom.xml maven

I added the apache log4j 1.2.17 dependency in my pom.xml maven project. After saving the changes I have a lot of errors which are mostly "missing artifacts error". What should I do to fix this error?
This is the dependency I used from the maven repository
http://mvnrepository.com/artifact/log4j/log4j/1.2.17
I want to use Log4j as my logging framework for my selenium testing
Update your maven project by right click on it and choose options MAVEN>UPDATE PROJECT. It would resolve your problem.
If still you are getting same problem then use mvn eclipse:clean eclipse:eclipse to regenerate the eclipse project files -- hope that sorts you.

Getting jar not in the pom.xml

I am confused why my web application is getting a Jar in its Maven Dependencies even if I think its not on the pom.xml file.
Here's my complete pom.xml which the applications gets objectify-2.2.3.jar
However I need to put a new version of this jar and I am not sure why my application gets this jar.
Do just a
mvn dependency:tree
on the console and check the output.
I suppose this jar is referenced by one of your direct dependencies.
Some IDEs can show the full dependency tree. I know this could be done with IntelliJ IDEAs maven view. I think Eclipse has a similar view.
There is also a maven plugin for this.

Maven beginner question, get m2eclipse to download jar and add to build path?

From what I have read, after adding the relevant maven repositories, maven should automatically download the necessary jars to satisfy dependencies in the pom.xml file.
However, no jars ever get downloaded for me after I add dependencies in eclipse. Am I missing some glaringly obvious step?
I'd recommend to start from creating your project with m2eclipse. See more details in this article.
Basically, you need to make sure the following:
your Eclipse project has a valid pom.xml and all dependencies are available (you should see errors on Maven console, in the Problems or Markers view or when opening pom.xml in m2eclipse's POM editor)
Maven support is enabled for this project (you can use Maven / Enable Dependency Management from popup menu on that project)
project configuration is in sync with pom.xml (you can use Maven / Update Project Configuration from the project popup menu)
you can also use Maven / Update Dependencies to refresh your dependencies (e.g. when you got them in your Local Maven repo from the command line)
Dependencies jars aren't in your project but in your local maven repository.
These jars will be automatically used when you compile you project with maven (or m2eclipse).
If you don't have the needed jar yet, maven will download it for you.

Resources