Packaging issue with Maven project in STS - spring-boot

I have set up one spring boot project at STS IDE .
Getting issue with maven read with JDK 1.8 java version
I have restart the IDE
Error - Project build error: Invalid packaging for parent POM
org.springframework.boot:spring-boot-starter:1.5.9.RELEASE, must be
"pom" but is "jar".

Related

How do I instruct Spring Boot Devtools where to find dependencies in a Maven project

I've got a Spring Boot Maven project that creates an executable fat .war. I can run this .war using java -jar without any issues as all dependencies are located within the far .war.
However, I can't run the project with the Spring Boot Devtools using mvn spring-boot:run as it fails to find some dependencies at runtime and throws unhandled exceptions.
For example, we've got an indirect dependency on jaxb-runtime-2.3.1.jar which in turn has a dependency on jaxb-api.2.3.1.jar. Both .jars are present in the fat .war but if I run the project with mvn spring-boot:run it can find jaxb-runtime ok but fails to find jaxb-api with the message:
java.nio.file.NoSuchFileException: ~/.m2/repository/org/glassfish/jaxb/jaxb-runtime/2.3.1/jaxb-api-2.3.1.jar
Note, jaxb-api-2.3.1.jar is present in the maven cache at:
~/.m2/repository/javax/xml/bind/jaxb-api/2.3.1/jaxb-api-2.3.1.jar
however it seems to be looking for it in the same location as the parent jaxb-runtime-2.3.1.jar which is located at:
~/.m2/repository/org/glassfish/jaxb/jaxb-runtime/2.3.1/
There's a long list of similar exceptions that follow this pattern. It's quite a large project but here are some of the versions we're using:
Spring Boot: 2.1.9.RELEASE
spring-boot-maven-plugin: 2.1.9.RELEASE
maven-compiler-plugin: 3.8.1
spring-boot-devtools: not specified in pom
Why does spring-boot:run not locate dependencies in the same way as the maven build? How can I instruct it where to find these dependencies?

deployment error through maven using ----java jar <jarfile>.jar

I have created a Spring Starter data jpa project and its connecting with mysql. through STS its running fine.
i wanted to deploy it individually so i clean install the application using maven and used java jar <jarfile.jar> in command prompt.
I followed the video of java brains.
Below is the error which get
JAXB is not found.
It seems that you set the scope of the JAXB dependency to provided or built the project for an old Java Version (like Java 8) that comes with JAXB and run it with a newer Java version (like Java 10) that does not come with JAXB.
You can fix this by adding the JAXB dependency to the classpath when running the JAR or by adding the dependency to your project manually(or set the scope to compile)

maven is unable to clean up spring 5.0.5 jars from intellij when i changed version to 4.3.16

I was trying to upgrade to spring 5.0.5. Now when i reverted pom.xml file back (to version 4.3.16) maven is unable to clean up spring 5.0.5 jars from Intellij Idea.
enter image description here
How can i clean up the 5.0.5 imported jars?

Mavenize Grails project not works in STS

I am using STS 3.6.1, Java 7, Grails 2.4.3.
When create a normal Grails project, it works good. However, my Grails project need to depends on other java projects, so I convert it to maven project. After that STS prompt error
Could not find the grails dependency file. This probably means that there is a bad dependency in the pom file.
java.lang.Exception
The maven grails project can be build in grails command.
How to resolve is issue? Or if there is walk around to let grails project depends on other Java project.

maven does not copy dependencies

I have Dynamic Web Application project in eclipse that was converted to maven project.
Problem is that all dependencies are copied to:
<project>/target/<project>-SNAPSHOT/WEB-INF/lib
not <project>/WebContent/WEB-INF/lib
so when I run application from eclipse, there are no libs from maven and I get some errors.
I assume that application started from eclipse i.e on tomcat server gets it source from <project>/WebContent/WEB-INF/lib.
You should use m2e (Maven Plugin for Eclipse). It automatically adds Maven dependencies to the classpath, so you donĀ“t need them in /WEB-INF/lib while running from Eclipse.

Resources