Could not transfer artifact Transfer failed - java

I am getting below error for maven projects in intellij.
Could not transfer artifact org.apache.maven.plugins:maven-site-plugin:pom:3.3 from/to other-mirror (http://insecure.repo1.maven.org/maven2/): Transfer failed for http://insecure.repo1.maven.org/maven2/org/apache/maven/plugins/maven-site-plugin/3.3/maven-site-plugin-3.3.pom ProxyInfo{host='123.45.6.
This 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>org.example</groupId>
<artifactId>test</artifactId>
<version>1.0-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>3.3</version>
<type>maven-plugin</type>
</dependency>
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<version>2.4</version>
<type>maven-plugin</type>
</dependency>
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.7</version>
<type>maven-plugin</type>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.kafka/kafka-clients -->
<dependency>
<groupId>org.apache.kafka</groupId>
<artifactId>kafka-clients</artifactId>
<version>2.3.0</version>
</dependency>
</dependencies>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<name>Central Repository</name>
<url>https://repo.maven.apache.org/maven2</url>
<layout>default</layout>
<snapshots>
<enabled>false</enabled>
</snapshots>
<releases>
<updatePolicy>never</updatePolicy>
</releases>
</pluginRepository>
</pluginRepositories>
<repositories>
<repository>
<id>central</id>
<name>Central Repository</name>
<url>https://repo.maven.apache.org/maven2</url>
<layout>default</layout>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
</project>
'''
This is my settings.xml
'''
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd">
<mirrors>
<mirror>
<id>internal-repository</id>
<name>Maven Repository Manager running on https://repo1.maven.org/maven2</name>
<url>https://repo1.maven.org/maven2</url>
<mirrorOf>*</mirrorOf>
</mirror>
</mirrors>
<repositories>
<repository>
<id>central</id>
<name>Central Repository</name>
<url>https://repo.maven.apache.org/maven2</url> <!-- the https you've been looking for -->
<layout>default</layout>
<snapshots>
<enabled>false</enabled> <!-- or set to true if desired, default is false -->
</snapshots>
</repository>
</repositories>
<proxies/>
</settings>
'''
I tried to add proxy but no use. tried to add mirror as well but not working. Please let me know if you faced and fixed the same issue

Related

Problem with Maven in POM Don't copy file

I have a problem with my ear in Maven, I find this error, but i don't find answer, please help
Error to compile in Maven Goals Clean Install
Failed to execute goal org.apache.maven.plugins:maven-ear-plugin:2.7:ear (default-ear) on project DashboardOSM-ear: Cannot copy a directory: C:\Users\Coneja\Desktop\OSM_DashboardBackend\OSM_DashboardBackend\commonModule\target\classes; Did you package/install DashboardOSMEar:commonModule:jar:1.0-SNAPSHOT:compile? -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-ear-plugin:2.7:ear (default-ear) on project DashboardOSM-ear: Cannot copy a directory: C:\Users\Coneja\Desktop\OSM_DashboardBackend\OSM_DashboardBackend\commonModule\target\classes; Did you package/install DashboardOSMEar:commonModule:jar:1.0-SNAPSHOT:compile?
And the pom file 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>DashboardOSMEar</groupId>
<artifactId>DashboardOSM</artifactId>
<version>1.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<groupId>DashboardOSMEar</groupId>
<artifactId>DashboardOSM-ear</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>ear</packaging>
<name>DashboardOSMEar</name>
<url>http://maven.apache.org</url>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<name>Central Repository</name>
<url>https://repo.maven.apache.org/maven2</url>
<layout>default</layout>
<snapshots>
<enabled>false</enabled>
</snapshots>
<releases>
<updatePolicy>never</updatePolicy>
</releases>
</pluginRepository>
</pluginRepositories>
<repositories>
<repository>
<id>central</id>
<name>Central Repository</name>
<url>https://repo.maven.apache.org/maven2</url>
<layout>default</layout>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ear-plugin</artifactId>
<version>2.7</version>
<configuration>
<version>5</version>
<defaultLibBundleDir>lib</defaultLibBundleDir>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>2.6</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>DashboardOSMWar</artifactId>
<version>${project.version}</version>
<type>war</type>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>commonModule</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>configurationModule</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>queryModule</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>

Failure to find org.geoserver:gs-wms:jar:2.5.2

I have failed to build a maven web application because of one dependency gs-wms from geoserver.
Here is pom.xml
<dependency>
<groupId>org.geoserver</groupId>
<artifactId>gs-wms</artifactId>
<exclusions>
<exclusion>
<!-- xerces incompatible with JasperReports -->
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
</exclusion>
</exclusions>
</dependency>
Error returned is
Could not resolve dependencies for project my-app:web:jar:1.5.0: Failure to find org.geoserver:gs-wms:jar:2.5.2 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 -> [Help 1]
I tried to use mirror in settings.xml as follows
<settings xmlns="http://maven.apache.org/SETTINGS/1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd">
<mirrors>
<mirror>
<mirrorOf>Maven repository</mirrorOf>
<id>mirror-for-geoserver-gs-wms</id>
<name>Repo for old geoserver version</name>
<url>https://mvnrepository.com/artifact/org.geoserver/gs-wms/</url>
</mirror>
</mirrors>
<profiles>
<profile>
<id>mainProfile</id>
<repositories>
<repository>
<id>Maven repository</id>
<url>https://repo.maven.apache.org/maven2/</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
<releases>
<enabled>true</enabled>
</releases>
</repository>
<repository>
<id>repo-for-geoserver-gs-wms</id>
<url>https://mvnrepository.com/artifact/org.geoserver/gs-wms/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>Maven repository</id>
<url>https://repo.maven.apache.org/maven2/</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
<releases>
<enabled>true</enabled>
</releases>
</pluginRepository>
<pluginRepository>
<id>repo-for-geoserver-gs-wms</id>
<url>https://mvnrepository.com/artifact/org.geoserver/gs-wms/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>mainProfile</activeProfile>
</activeProfiles>
</settings>
But I got the error
Could not resolve dependencies for project my-app:web:jar:1.5.0: Failure to find org.geoserver:gs-wms:jar:2.5.2 in https://mvnrepository.com/artifact/org.geoserver/gs-wms/ was cached in the local repository, resolution will not be reattempted until the update interval of mirror-for-geoserver-gs-wms has elapsed or updates are forced -> [Help 1]
Any advice will be appreciated.

Spring-boot-maven-plugin doesn´t deploy to one of two artifact repositories

I have two artifact repositories, one for snapshots and other for releases. The older project uses maven-release-plugin and successfuly deploys to both repositories depending on the parameters passed.
But I have a Spring Boot application which uses spring-boot-maven-plugin, and with the same configuration it only deploys to my snapshot repository, even though I pass release as parameter. I´d also like for it to remove -SNAPSHOT of the resulting artifact.
I´m using Jenkis for build and deployment.
Can anyone shed a light on this? I´ve researched but came out empty. Please ask me if you need any more information. Thanks in advance!
These are the parameters in my 'Goals and options' section on jenkins for both applications.
deploy -P release --batch-mode release:prepare release:perform -DscmCommentPrefix=RELEASE -DignoreSnapshots=true -D https.protocols=TLSv1.2
Working legacy 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.myapp</groupId>
<artifactId>myapp</artifactId>
<version>10.28.0-SNAPSHOT</version>
<packaging>pom</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.scm.id>git-myapp</project.scm.id>
<!-- Sonar properties-->
<sonar.java.source>7</sonar.java.source>
<sonar.jacoco.itReportPath>${project.basedir}/../target/jacoco-it.exec</sonar.jacoco.itReportPath>
<sonar.jacoco.reportPath>${project.basedir}/../target/jacoco.exec</sonar.jacoco.reportPath>
<sonar.language>java</sonar.language>
<sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin>
<version.cdi-unit>3.1.5-SNAPSHOT</version.cdi-unit>
</properties>
<repositories>
<repository>
<id>ext-release-local</id>
<url>http://myapp.com:8081/artifactory/ext-release-local</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>ext-snapshot-local</id>
<url>http://myapp.com:8081/artifactory/ext-snapshot-local</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<scm>
<url>scm:git:https://git.myapp.com:1443/myuser/myapp.git</url>
<connection>scm:git:https://git.myapp.com:1443/myuser/myapp.git</connection>
<tag>myapp-10.28.0</tag>
</scm>
<distributionManagement>
<repository>
<id>ext-release-local</id>
<name>ext-release-local</name>
<url>http://myapp.com:8081/artifactory/ext-release-local/</url>
</repository>
<snapshotRepository>
<id>ext-snapshot-local</id>
<name>ext-snapshot-local</name>
<url>http://myapp.com:8081/artifactory/ext-snapshot-local/</url>
</snapshotRepository>
</distributionManagement>
<build>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.7.9</version>
<executions>
<execution>
<id>agent-for-ut</id>
<goals>
<goal>prepare-agent</goal>
</goals>
<configuration>
<append>true</append>
<destFile>${sonar.jacoco.reportPath}</destFile>
</configuration>
</execution>
<execution>
<id>agent-for-it</id>
<goals>
<goal>prepare-agent-integration</goal>
</goals>
<configuration>
<append>true</append>
<destFile>${sonar.jacoco.itReportPath}</destFile>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.5.3</version>
<executions>
<execution>
<id>default</id>
<goals>
<goal>perform</goal>
</goals>
<configuration>
<pomFileName>myapp/pom.xml</pomFileName>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
Non-working 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>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.1.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.myapp</groupId>
<artifactId>qrcode-api</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>qrcode-api</name>
<description>QRCode Processing API</description>
<properties>
<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>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
</dependency>
<dependency>
<groupId>com.github.detro</groupId>
<artifactId>ghostdriver</artifactId>
<version>2.1.0</version>
</dependency>
</dependencies>
<scm>
<url>scm:git:https://git.myapp.com:1443/myapp/qrcode-api.git</url>
<connection>scm:git:https://git.myapp.com:1443/myapp/qrcode-api.git</connection>
<tag>qrcode-1.0.0</tag>
</scm>
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
<repository>
<id>ext-release-local</id>
<url>http://myapp.com:8081/artifactory/ext-release-local</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>ext-snapshot-local</id>
<url>http://myapp.com:8081/artifactory/ext-snapshot-local</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<distributionManagement>
<repository>
<id>ext-release-local</id>
<name>ext-release-local</name>
<url>http://myapp.com:8081/artifactory/ext-release-local/</url>
</repository>
<snapshotRepository>
<id>ext-snapshot-local</id>
<name>ext-snapshot-local</name>
<url>http://myapp.com:8081/artifactory/ext-snapshot-local/</url>
</snapshotRepository>
</distributionManagement>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
For your non-interactive release, it appears that you're missing a few properties to actually ensure that the version is incremented.
mvn --batch-mode -Dtag=my-proj-1.2 release:prepare \
-DreleaseVersion=1.2 \
-DdevelopmentVersion=2.0-SNAPSHOT
Those -D flags are important; they set the release version (thus removing the -SNAPSHOT from your version) and set the new release version.

Spring-boot-start jar load error in maven project on Netbeans

I donwloaded a new spring boot application (version 2.0.0) from https://start.spring.io/ and I tried to build it using netbeans IDE.
During the maven build I got the following error :
The build could not read 1 project -> [Help 1]
The project com.deepit.springboot.example:spring-boot-in-deep:0.0.1-SNAPSHOT (~=NetBeansProjects\spring-boot-in-deep\pom.xml) has 1 error
Non-resolvable parent POM: Could not transfer artifact org.springframework.boot:spring-boot-starter-parent:pom:2.0.0.BUILD-SNAPSHOT from/to spring-snapshots (https://repo.spring.io/snapshot): repo.spring.io and 'parent.relativePath' points at no local POM # line 14, column 10: Unknown host repo.spring.io -> [Help 2]
To see the full stack trace of the errors, re-run Maven with the -e switch.
Re-run Maven using the -X switch to enable full debug logging.
Do you have an idea about the cause of this error ?
http://maven.apache.org/xsd/maven-4.0.0.xsd">
4.0.0
<groupId>com.deepit.springboot.example</groupId>
<artifactId>spring-boot-in-deep</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>spring-boot-in-deep</name>
<description>Demo project for Spring Boot</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.0.BUILD-SNAPSHOT</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>
<repositories>
<repository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>https://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>https://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
To resolve this I add a proxy in the settings.xml file in the config folder of maven.
To know the location of your settings file, start maven with -X option (debug) and examine the beginning of the output.
#Ayadi Akrem
Can you post the contents of your POM?
Update: POM looks ok. I would guess a connection error (even though you said you tested it).

Getting bunch of errors when try works with spring-boot

I am trying to work with spring boot but I am still getting damn errors.
I can't make it works so I can display jsps files.
[IMG]http://i63.tinypic.com/fkxnwk.jpg[/IMG]
[IMG]http://i66.tinypic.com/2hdw95v.jpg[/IMG]
package qq;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
#Controller
#EnableAutoConfiguration
public class DeadApplication {
public static void main(String[] args) {
SpringApplication.run(DeadApplication.class, args);
}
#RequestMapping("/")
String home(){
return "home";
}
}
application.properties
spring.mvc.view.prefix=/WEB-INF/jsps/
spring.mvc.view.suffix=.jsp
debug=true
<?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>dead</name>
<description>Demo project for Spring Boot</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.3.9.BUILD-SNAPSHOT</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>
<repositories>
<repository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>https://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>https://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</project>

Categories