I am not able to use 1.3.0.RELEASE version of spring-boot in my project. Following is my pom.xml:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.abc</groupId>
<artifactId>xyz</artifactId>
<packaging>jar</packaging>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.3.0.RELEASE</version>
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
I am getting following error:
Project build error: Non-resolvable parent POM for
com.elm:elm:[unknown-version]: Failure to find
org.springframework.boot:spring-boot-starter-parent:pom:1.3.0.RELEASE
in https://repo.maven.apache.org/maven2 was cached in the local
repository, resolution will not be reattempted until the update
interval of central has elapsed or updates are forced and
'parent.relativePath' points at wrong local POM pom.xml /elm line
8 Maven pom Loading Problem
Your local cached repository seems to be messed up.
Either you can force maven to download dependencies with
mvn clean install -U
or you can clean your cached repository by removing <USER_HOME>/.m2/repository directory.
Related
After getting a new laptop, I am facing this issue very frequently, the spring dependencies particulary spring boot is not getting downloaded, the message that I got was
[ERROR] The project com.john:EmployeeH2Demo:1.0-SNAPSHOT (C:\Users\John\IdeaProjects\EmployeeH2Demo\pom.xml) has 1 error
[ERROR] Non-resolvable parent POM for com.john:EmployeeH2Demo:1.0-SNAPSHOT: org.springframework:spring-boot-starter-parent:pom:2.5
.2 was not found in https://repo.maven.apache.org/maven2 during a previous attempt. This failure was cached in the local repository and resolutio
n is not reattempted until the update interval of central has elapsed or updates are forced and 'parent.relativePath' points at no local POM # li
ne 6, column 13 -> [Help 2]
First I did not had settings.xml but it was not working then I checked the url https://repo.maven.apache.org/maven2 this url did not had spring-boot-starter-parent, and when I googled I could find spring-boot dependency in this repo http://www.mvnrepository.com, so I tried using that repo, resulting in the below settings.xml
Here is my settings.xml
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
https://maven.apache.org/xsd/settings-1.0.0.xsd">
<localRepository>${user.home}/.m2/repository</localRepository>
<interactiveMode>true</interactiveMode>
<offline>false</offline>
<pluginGroups>
<pluginGroup>org.apache.tomcat.maven</pluginGroup>
</pluginGroups>
<profiles>
<profile>
<repositories>
<repository>
<id>mvnrepository</id>
<name>mvnrepository</name>
<url>http://www.mvnrepository.com</url>
</repository>
</repositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>mvnrepository</activeProfile>
</activeProfiles>
</settings>
and here is the pom.xml for this project.
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.5.2</version>
<relativePath/>
</parent>
<groupId>com.john</groupId>
<artifactId>EmployeeH2Demo</artifactId>
<version>1.0-SNAPSHOT</version>
<description>Demo Project for H2 in memory database using SpringBoot</description>
<properties>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<java.version>11</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>>
But even after several attems to clean build the project, I am not able to do it.
After removing the settings.xml from the .m2 directory, still getting the following error.
$ mvn clean install -U
[INFO] Scanning for projects...
Downloading from central: https://repo.maven.apache.org/maven2/org/springframework/spring-boot-starter-parent/2.5.2/spring-boot-starter-parent-2.
5.2.pom
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM for com.bablo:EmployeeH2Demo:1.0-SNAPSHOT: Could not find artifact org.springframework:spring-boot-starter-pare
nt:pom:2.5.2 in central (https://repo.maven.apache.org/maven2) and 'parent.relativePath' points at no local POM # line 6, column 13
#
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project com.john:EmployeeH2Demo:1.0-SNAPSHOT (C:\Users\bablo\IdeaProjects\EmployeeH2Demo\pom.xml) has 1 error
[ERROR] Non-resolvable parent POM for com.bablo:EmployeeH2Demo:1.0-SNAPSHOT: Could not find artifact org.springframework:spring-boo
t-starter-parent:pom:2.5.2 in central (https://repo.maven.apache.org/maven2) and 'parent.relativePath' points at no local POM # line 6, column 13
-> [Help 2]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException
I am not behind a proxy, neither I am using a vpn or anything like that.
Also on checking on the url being hit by maven to download the spring-boot-starter-parent, that is this url,
https://repo.maven.apache.org/maven2/org/springframework/spring-boot-starter-parent/2.5.2/spring-boot-starter-parent-2.
5.2.pom
nothing is there at that location, can I not get any other url to be searched by maven, to download spring-boot-starter-parent dependency.
The <groupId> of the <parent> in your pom is incorrect. You have org.springframework. It should be org.springframework.boot.
Very trivial error, sorry guys but the issue was that I was not giving the correct group id org.springframework.boot, so the correct pom is.
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.5.2</version>
<relativePath/>
</parent>
<groupId>com.john</groupId>
<artifactId>EmployeeH2Demo</artifactId>
<version>1.0-SNAPSHOT</version>
<description>Demo Project for H2 in memory database using SpringBoot</description>
<properties>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<java.version>11</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
I have a library module that I created through Maven, there is pom.xml what get dependencies:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.18.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.example.library</groupId>
<artifactId>commons</artifactId>
<version>1.0.0</version>
<packaging>jar</packaging>
<name>commons</name>
<description>common dependencies library</description>
<properties>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
With the above pom, I successfully installed it into the local maven repository by using mvn install.
In another project my-service, which uses this installed library, within the IntelliJ IDEA, it is fine compiling and running. There is the pom.xml for the my-service
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>my-service</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>my-service</name>
<description>My Services</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.18.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
</properties>
<dependencies>
<!-- other dependencies ... -->
<dependency>
<groupId>com.example.library</groupId>
<artifactId>commons</artifactId>
<version>1.0.0</version>
</dependency>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
However, when running with mvn compile, I got the following errors:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project my-service: Compilation failure: Compilation failure:
[ERROR] /Users/doe/IdeaProjects/my-service/src/main/java/com/example/myservice/configs/WebSecurityConfig.java:[3,45] package com.example.library.commons.filters does not exist
[ERROR] /Users/doe/IdeaProjects/my-service/src/main/java/com/example/myservice/configs/WebSecurityConfig.java:[17,13] cannot find symbol
[ERROR] symbol: class SessionFilter
[ERROR] location: class com.example.myservice.configs.WebSecurityConfig
[ERROR] /Users/doe/IdeaProjects/my-service/src/main/java/com/example/myservice/configs/WebSecurityConfig.java:[19,36] cannot find symbol
[ERROR] symbol: class SessionFilter
[ERROR] location: class com.example.myservice.configs.WebSecurityConfig
The library project is created as part of the IntelliJ IDEA module within the same project as the my-service module. I guess the IntelliJ IDEA knows how to internally references module to compile the depending modules, but with Maven, it is a different story.
My goal is to compile and package the my-service module as a single jar that includes the commons library module. Now I can't even get it to compile with Maven, what did I do wrong?
Apache Maven version 3.3.9 . Operating system: OS X.
It turns out the Spring-boot-maven plugin is not needed in the library project because a library doesn't need to produce an executable ueber jar. After removing the plugin, it compiles successfully.
I have created a new Springboot application. I am getting an error in POM.xml which is,
Project build error: Non-resolvable parent POM for
org.springframework.boot:spring-boot-sample-activemq:[unknown-version]: Could not transfer artifact org.springframework.boot:spring-boot-samples:pom:${revision} from/to central (https://repo.maven.apache.org/maven2): PROXY and 'parent.relativePath' points at wrong local POM
I have tried updating and cleaning the project. But did not work.
Tried deleting the contents in m2/repositry folder but did not work.
My Settings.xml looks like this,
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
http://maven.apache.org/xsd/settings-1.0.0.xsd">
<proxies>
<proxy>
<active>true</active>
<protocol>http</protocol>
<host>PROXY</host>
<port>3120</port>
<nonProxyHosts>maven</nonProxyHosts>
</proxy>
</proxies>
</settings>
and also i am trying to connect the url through telnet in cmd. but it say
Connecting To repo.maven.apache.org...Could not open connection to the host, on port 3120: Connect failed
My POM.xml Looks like this,
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<!-- Your own application should inherit from spring-boot-starter-parent -->
<artifactId>spring-boot-samples</artifactId>
<groupId>org.springframework.boot</groupId>
<version>${revision}</version>
</parent>
<artifactId>spring-boot-sample-activemq</artifactId>
<name>Spring Boot ActiveMQ Sample</name>
<description>Spring Boot ActiveMQ Sample</description>
<properties>
<main.basedir>${basedir}/../..</main.basedir>
</properties>
<dependencies>
<!-- Compile -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-activemq</artifactId>
</dependency>
<!-- Test -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
I am working in office environment ..could it be because of firewall issue.. please help ??
There is maybe a proxy issue, but first, you're getting Could not transfer artifact org.springframework.boot:spring-boot-samples:pom:${revision} just because there is no artifact org.springframework.boot:spring-boot-samples in Maven Central : https://search.maven.org/search?q=g:org.springframework.boot%20AND%20a:spring-boot-samples. You are also referring to a property (${revision}) not defined in your POM.
I think you have just copied the example from GitHub where spring-boot-samples is actually defined, but this is an internal module.
You should first read Spring Boot docs about bootstraping projects. Have you noticed the comment in <parent> section of the POM?
<!-- Your own application should inherit from spring-boot-starter-parent -->
For issues related to the proxy, I suggest you to read more about configuring proxies. You also probably need authentication.
I am new to Spring.I downloaded SpringToolSuite 3.7.2 and i am trying to create a simple SpringBootApplication.
I go to File->New Spring Starter Project,Select Type as Maven project and Under dependencies i selected Web and click on Finish. I get an error on my parent tag in pom.xml and also not able to see the maven dependency libraries.
I tried right clicking on the project->Select Maven->Update Projects-> Checked all boxes and Update but does not work. I also tried cleaning the repository under C:{User}.m2 clean and rebuild the project but did not work for me.Screenshot of the STS
Project build error: Non-resolvable parent POM for com.example:demo:0.0.1-SNAPSHOT: Could not transfer artifact org.springframework.boot:spring-boot-starter-parent:pom:1.4.3.RELEASE from/to central (https://repo.maven.apache.org/maven2): repo.maven.apache.org and 'parent.relativePath' points at no local POM
Please tell me what am i missing.
Below is my pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>demo</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>SpringApplication1</name>
<description>Demo project for Spring Boot</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.4.3.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
The error suggests that you are not able to connect to (https://repo.maven.apache.org/maven2).
Please check your maven settings.xml (Window -> Preferences -> Maven -> Global/User Settings):
If you are using proxy, you need to add it on your settings.xml.
Something like this :
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
https://maven.apache.org/xsd/settings-1.0.0.xsd">
...
<proxies>
<proxy>
<id>myproxy</id>
<active>true</active>
<protocol>http</protocol>
<host>proxy.somewhere.com</host>
<port>8080</port>
<username>proxyuser</username>
<password>somepassword</password>
<nonProxyHosts>*.google.com|ibiblio.org</nonProxyHosts>
</proxy>
</proxies>
...
</settings>
As you can see on https://maven.apache.org/settings.html.
If you are not using proxy, be sure that you don't have any proxy configuration on your settings.
To construct a project Spring Surf on Alfresco, I used the command:
mvn archetype:generate -DarchetypeCatalog=https://artifacts.alfresco.com/nexus/content/groups/public-snapshots/archetype-catalog.xml
I gave groupId=surfcmistest and artifactId=surfcmistest-1.0-SNAPSHOT. Then, on the folder surfcmistest-1.0-SNAPSHOT created by the project, I try to make build and package with Maven. I run:
mvn install
and I obtain the error:
Failed to execute goal on project surfcmistest-1.0-SNAPSHOT: Could not resolve dependencies for project surfcmistest:surfcmistest-1.0-SNAPSHOT:war:1.0-SNAPSHOT: Failed to collect dependencies at org.springframework.extensions.surf:spring-surf:jar:5.1-BF-SNAPSHOT: Failed to read artifact descriptor for org.springframework.extensions.surf:spring-surf:jar:5.1-BF-SNAPSHOT: Failure to find org.alfresco:alfresco-parent:pom:5.1-BF-SNAPSHOT in https://artifacts.alfresco.com/nexus/content/groups/public-snapshots/ was cached in the local repository, resolution will not be reattempted until the update interval of Alfresco-Artifacts has elapsed or updates are forced -> [Help 1]
My pom.xml is:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>surfcmistest</groupId>
<artifactId>surfcmistest-1.0-SNAPSHOT</artifactId>
<packaging>war</packaging>
<name>sample-app Maven Webapp</name>
<url>http://maven.apache.org</url>
<repositories>
<repository>
<id>Alfresco-Artifacts</id>
<name>Alfresco Artifacts SNAPSHOTS</name>
<url>https://artifacts.alfresco.com/nexus/content/groups/public-snapshots/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.extensions.surf</groupId>
<artifactId>spring-surf</artifactId>
<version>5.1-BF-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.springframework.extensions.surf</groupId>
<artifactId>spring-surf-api</artifactId>
<version>5.1-BF-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.tuckey</groupId>
<artifactId>urlrewritefilter</artifactId>
<version>4.0.4</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>9.2.2.v20140723</version>
<configuration>
<scanIntervalSeconds>0</scanIntervalSeconds>
<scanTargets>
<scanTarget>src/main/webapp</scanTarget>
</scanTargets>
</configuration>
</plugin>
</plugins>
</build>
<version>1.0-SNAPSHOT</version>
</project>
What is my error?
The error message you are getting is:
resolution will not be reattempted until the update interval of Alfresco-Artifacts has elapsed or updates are forced
This is a very classic error and it is resolved by running Maven with the -U option.
You should restart from scratch and follow this procedure:
Remove your whole m2 repository (the default location is ~/.m2/repository) and remove any directory created by an earlier execution of the maven-archetype-plugin.
Run the command:
mvn archetype:generate -DarchetypeCatalog=https://artifacts.alfresco.com/nexus/content/groups/public-snapshots/archetype-catalog.xml
Choose the option org.springframework.extensions.surf:spring-surf-archetype (for me, it was option 1 but it can change).
Choose the version 5.1-SNAPSHOT, which was option 4 for me (but again, this can change)
Select a groupId, an artifactId, a version, a package and confirm all those properties by pressing Y.
Go into the newly created directory (it will be named after the artifactId you chose earlier) and run the following Maven command:
mvn -U clean install