Im trying to convert an autogenerated pom.xml from (https://start.spring.io) online tool to gradle.
I have Java gradle project that needs some features in Spring boot.
(https://start.spring.io) online tool generates this 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 https://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.4.0.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>gov.nasa.jpl.ccsds.oais.if_prototype</groupId>
<artifactId>OaisInteropFramework</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>OaisInteropFramework</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
After issuing "gradle init", based on this blog (https://howtodoinjava.com/gradle/convert-maven-project-to-gradle-project/) the pom.xml is suppose to be converted to gradle projet.
It seems several gradle files are created however gradle.build is empty & there is an error:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':init'.
> Could not convert Maven POM C:\Users\xyz\Documents\NetBeansProjects\test_pom\pom.xml to a Gradle build.
> Unable to create Maven project model using POM C:\Users\xyz\Documents\NetBeansProjects\test_pom\pom.xml.
> 1 problem was encountered while building the effective model for com.abc.defccsds.oais.if_prototype:OaisInteropFramework:0.0.1-SNAPSHOT
[FATAL] Non-resolvable parent POM: Could not transfer artifact org.springframework.boot:spring-boot-starter-parent:pom:2.4.0.RELEASE from/to central (http://repo.maven.apache.org/maven2): Failed to transfer file: http://repo.maven.apache.org/maven2/org/springframework/boot/spring-boot-starter-parent/2.4.0.RELEASE/spring-boot-starter-parent-2.4.0.RELEASE.pom. Return code is: 501 , ReasonPhrase:HTTPS Required. and 'parent.relativePath' points at no local POM @ line 5, column 10
for project com.abc.defccsds.oais.if_prototype:OaisInteropFramework:0.0.1-SNAPSHOT at C:\Users\xyz\Documents\NetBeansProjects\test_pom\pom.xml
How can I get back a proper gradle.build from pom , hopefully automatically using gradle init
?
2.4.0.RELEASE
does not exist yet...the most recent version of Spring Boot is2.3.0.RELEASE
...