Vaadin-addons Maven POM File Configuration - maven

I can't get a Vaadin + Spring project built due to vaadin-addons while someone can get it built. The pom file already has the addons repository. The following is the structure of the pom.xml. What is missing? Is the addons repository in a wrong place?
<dependencies>
…
<!-- Vaadin dependencies -->
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-server</artifactId>
<version>${vaadin.version}</version>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-push</artifactId>
<version>${vaadin.version}</version>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-client-compiled</artifactId>
<version>${vaadin.version}</version>
</dependency>
<dependency>
<groupId>org.vaadin.addons</groupId>
<artifactId>vaadin-combobox-multiselect</artifactId>
<version>2.6</version>
</dependency>
<dependency>
<groupId>org.vaadin.addons</groupId>
<artifactId>vaadin-grid-util</artifactId>
<version>2.1.1</version>
</dependency>
…
</dependencies>
...
<profiles>
<profile>
<!-- Vaadin pre-release repositories -->
<id>vaadin-prerelease</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<repositories>
...
<repository>
<id>vaadin-addons</id>
<url>http://maven.vaadin.com/vaadin-addons</url>
</repository>
</repositories>
Update:
I solve this probule by adding the following in the pom file
<repositories>
<repository>
<id>central</id>
<url>https://repo.maven.apache.org/maven2/</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>vaadin-addons</id>
<url>https://maven.vaadin.com/vaadin-addons</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>sonatype vaadin</id>
<url>https://oss.sonatype.org/content/repositories/vaadin/</url>
</repository>
<repository>
<id>vaadin-prereleases</id>
<url>https://maven.vaadin.com/vaadin-prereleases</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<url>https://repo.maven.apache.org/maven2/</url>
</pluginRepository>
<pluginRepository>
<id>vaadin-prereleases</id>
<url>https://maven.vaadin.com/vaadin-prereleases</url>
</pluginRepository>
</pluginRepositories>

You have defined a profile with the id <id>vaadin-prerelease</id> and the repositories are defined only under that profile. I think this is not what you want; instead, you should define the <repositories> on the same level as <dependencies>. Repositories for a specific profile are only used if you're building with that profile enabled.

Related

error pom.xml error resolving version and error packaging

I found the error in my pom.xml. the error below:
Multiple annotations found at this line:
- Error resolving version for plugin 'org.apache.maven.plugins:maven-site-plugin' from the repositories
[local (C:\Users\c76266.m2\repository), release.fusesource.org
(http://repo.fusesource.com/nexus/content/repositories/releases),
ea.fusesource.org
(http://repo.fusesource.com/nexus/content/groups/ea), central
(https:// repo.maven.apache.org/maven2)]: Plugin not found in any
plugin repository
- Project build error: Unresolveable build extension: Plugin org.apache.felix:maven-bundle-plugin:2.3.7 or one of its dependencies
could not be resolved: The following artifacts could not be
resolved: org.apache.maven:maven-core:jar:2.0.7,
org.apache.maven:maven-settings:jar:2.0.7,
org.apache.maven:maven-plugin-parameter-documenter:jar:
2.0.7, org.apache.maven:maven-profile:jar:2.0.7, org.apache.maven:maven-model:jar:2.0.7,
org.apache.maven:maven-artifact:jar:2.0.7,
org.codehaus.plexus:plexus-container-
default:jar:1.0-alpha-9-stable-1,
org.apache.maven:maven-repository-metadata:jar:2.0.7,
org.apache.maven:maven-error-diagnostics:jar:2.0.7,
org.apache.maven:maven- project:jar:2.0.7,
org.apache.maven:maven-plugin-registry:jar:2.0.7,
org.apache.maven:maven-plugin-api:jar:2.0.7,
org.apache.maven:maven-plugin-descriptor:jar:2.0.7,
org.apache.maven:maven-artifact-manager:jar:2.0.7,
org.apache.maven:maven-monitor:jar:2.0.7,
classworlds:classworlds:jar:1.1: Could not transfer artifact
org.apache.maven:maven-core:jar:2.0.7 from/to central
(https://repo.maven.apache.org/maven2): unexpected end of stream on
Connection{repo.maven.apache.org:443, proxy=HTTP #
idnproxy.pru.intranet.asia/10.171.74.5:8080 hostAddress=10.171.74.5
cipherSuite=none protocol=http/1.1} (recycle count=0)
Project build error: Unknown packaging: bundle
How to fix this problem? thanks.
The Maven xml include seems to be fine code wise, so I'd say you have imported/installed something wrong, a different version maybe?
this 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.prudential.integration.middleware.common</groupId>
<artifactId>prudential-fuse-common-model</artifactId>
<version>1.0.1</version>
<packaging>bundle</packaging>
<name>Prudential Fuse Common Model</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<repositories>
<repository>
<id>release.fusesource.org</id>
<name>FuseSource Release Repository</name>
<url>http://repo.fusesource.com/nexus/content/repositories/releases</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
<releases>
<enabled>true</enabled>
</releases>
</repository>
<repository>
<id>ea.fusesource.org</id>
<name>FuseSource Community Early Access Release Repository</name>
<url>http://repo.fusesource.com/nexus/content/groups/ea</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
<releases>
<enabled>true</enabled>
</releases>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>release.fusesource.org</id>
<name>FuseSource Release Repository</name>
<url>http://repo.fusesource.com/nexus/content/repositories/releases</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
<releases>
<enabled>true</enabled>
</releases>
</pluginRepository>
<pluginRepository>
<id>ea.fusesource.org</id>
<name>FuseSource Community Early Access Release Repository</name>
<url>http://repo.fusesource.com/nexus/content/groups/ea</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
<releases>
<enabled>true</enabled>
</releases>
</pluginRepository>
</pluginRepositories>
<dependencies>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-cxf</artifactId>
<version>2.15.1.redhat-620133</version>
<exclusions>
<exclusion>
<artifactId>asm</artifactId>
<groupId>asm</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxrs</artifactId>
<version>3.0.4.redhat-620133</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-jaxb</artifactId>
<version>2.15.1.redhat-620133</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>2.3.7</version>
<extensions>true</extensions>
<configuration>
<instructions>
<Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
<Bundle-Name>${project.name}</Bundle-Name>
<Bundle-Version>${project.version}</Bundle-Version>
<Import-Package>*</Import-Package>
</instructions>
</configuration>
</plugin>
</plugins>
</build>
</project>

JBoss Fuse/ Red Hat JBoss developer Studio, Fuse Integration Project error

I'm getting an error upon running maven install, or maven clean on the following POM file in a graphical Camel Project. I'm using Red Hat JBoss Developer Studio
My pom flie is as follows
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>com.mycompany</groupId>
<artifactId>camel-blueprint</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>bundle</packaging>
<name>Camel Blueprint Quickstart</name>
<description>Empty Camel Blueprint Example</description>
<licenses>
<license>
<name>Apache License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.html</url>
<distribution>repo</distribution>
</license>
</licenses>
<properties>
<camel.version>2.17.3</camel.version>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<version.maven-bundle-plugin>2.3.7</version.maven-bundle-plugin>
**<jboss.fuse.bom.version>6.3.0.redhat-187</jboss.fuse.bom.version>**
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.jboss.fuse.bom</groupId>
<artifactId>jboss-fuse-parent</artifactId>
<version>${jboss.fuse.bom.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-core</artifactId>
<version>2.17.3</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-blueprint</artifactId>
<version>2.17.3</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.5.4</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.7.5</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>2.7</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-test-blueprint</artifactId>
<version>2.17.3</version>
<scope>test</scope>
</dependency>
</dependencies>
<repositories>
<repository>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>fuse-public-repository</id>
<name>FuseSource Community Release Repository</name>
**<url>https://repo.fusesource.com/nexus/content/groups/public</url>**
</repository>
<repository>
<id>redhat-ea-repository</id>
<url>https://maven.repository.redhat.com/earlyaccess/all</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>red-hat-ga-repository</id>
<name>Red Hat GA Repository</name>
<url>https://maven.repository.redhat.com/ga</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>fuse-public-repository</id>
<name>FuseSource Community Release Repository</name>
<url>https://repo.fusesource.com/nexus/content/groups/public</url>
</pluginRepository>
<pluginRepository>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>red-hat-ga-repository</id>
<name>Red Hat GA Repository</name>
<url>https://maven.repository.redhat.com/ga</url>
</pluginRepository>
</pluginRepositories>
<build>
<defaultGoal>install</defaultGoal>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>${version.maven-bundle-plugin}</version>
<extensions>true</extensions>
<configuration>
<instructions>
<Bundle-SymbolicName>cameltry</Bundle-SymbolicName>
<Bundle-Name>Empty Camel Blueprint Example [cameltry]</Bundle-Name></instructions></configuration>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.0.1</version>
<configuration>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.camel</groupId>
<artifactId>camel-maven-plugin</artifactId>
<version>${camel.version}</version>
<configuration>
<useBlueprint>true</useBlueprint>
</configuration>
</plugin>
</plugins>
</build>
</project>
The error message I get in the console is as follows
Non-resolvable import POM: Failure to find
org.jboss.fuse.bom:jboss-fuse-parent:pom:6.3.0.redhat-187 in
https://(our nexus repository)/content/groups/public was cached in the
local repository, resolution will not be reattempted until the update
interval of (our nexus repository).com has elapsed or updates are
forced # line 29, column 19 -> [Help 2] [ERROR]
Any and all help will end my long search in order to solve the issue, and thus attain my eternal gratitude.
P.S. I have already gone through the maven configuration in order to get the required dependancy profiles set up as advised on the Redhat Documentation Website
2nd Version POM based on recommendations as of 28.12.16 1500 hours CET.
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>com.mycompany</groupId>
<artifactId>camel-blueprint</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>bundle</packaging>
<name>Camel Blueprint Quickstart</name>
<description>Empty Camel Blueprint Example</description>
<licenses>
<license>
<name>Apache License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.html</url>
<distribution>repo</distribution>
</license>
</licenses>
<properties>
<camel.version>2.17.3</camel.version>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<version.maven-bundle-plugin>2.3.7</version.maven-bundle-plugin>
**<jboss.fuse.bom.version>6.3.0.redhat-189</jboss.fuse.bom.version>**
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.jboss.fuse.bom</groupId>
<artifactId>jboss-fuse-parent</artifactId>
<version>${jboss.fuse.bom.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-core</artifactId>
<version>2.17.3</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-blueprint</artifactId>
<version>2.17.3</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.5.4</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.7.5</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>2.7</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-test-blueprint</artifactId>
<version>2.17.3</version>
<scope>test</scope>
</dependency>
</dependencies>
<repositories>
<repository>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>fuse-public-repository</id>
<name>FuseSource Community Release Repository</name>
**<url>https://repository.jboss.org/nexus/content/groups/ea/org/jboss/fuse/bom/jboss-fuse-parent/</url>**
</repository>
<!--<repository>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>6.3.0 jboss parent</id>
<name>jbp</name>
<url>https://repository.jboss.org/nexus/content/groups/ea/org/jboss/fuse/bom/jboss-fuse-parent/ /</url>
</repository> -->
<repository>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>Jboss Fuse snapshots repo</id>
<name>JFSR</name>
<url>https://repo.fusesource.com/nexus/content/groups/public-snapshots/</url>
</repository>
<repository>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>red-hat-ga-repository</id>
<name>Red Hat GA Repository</name>
<url>https://maven.repository.redhat.com/ga</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>fuse-public-repository</id>
<name>FuseSource Community Release Repository</name>
<url>https://repo.fusesource.com/nexus/content/groups/public</url>
</pluginRepository>
<pluginRepository>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>red-hat-ga-repository</id>
<name>Red Hat GA Repository</name>
<url>https://maven.repository.redhat.com/ga</url>
</pluginRepository>
</pluginRepositories>
<build>
<defaultGoal>install</defaultGoal>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>${version.maven-bundle-plugin}</version>
<extensions>true</extensions>
<configuration>
<instructions>
<Bundle-SymbolicName>cameltry</Bundle-SymbolicName>
<Bundle-Name>Empty Camel Blueprint Example [cameltry]</Bundle-Name></instructions></configuration>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.0.1</version>
<configuration>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.camel</groupId>
<artifactId>camel-maven-plugin</artifactId>
<version>${camel.version}</version>
<configuration>
<useBlueprint>true</useBlueprint>
</configuration>
</plugin>
</plugins>
</build>
</project>
The issue was resolved. The problem was that maven was being directed by my settings.xml to look for the files in our repo instead of the jboss repos. This was because the configuration for settings.xml which told maven that these repos were not mirrored in our nexus was missing. Hence adding '!jbossRepo(X)' in the mirrorOf section of my settings.xml told maven that these were not mirrored in our nexus and the following profiles should be searched for these files.
The said profiles can be configuered in your settings.xml by following the instructions on this link.
So if you're trying to run jBoss Red hat developer Studio from behind a plethora of proxies like me, simply,
Configure maven for the studio with the above link.
Add the '!jbossRepos(x)' in the mirrors block, in front of 'mirrorsOf' in the settings.xml file.
Done!
Thanks to RobE, for pointing me in the right direction. I'm indebted.
Check with your browser if the dependency org.jboss.fuse.bom:jboss-fuse-parent:pom:6.3.0.redhat-187 exists in any of the repositories you are using.
Does your nexus repo contain (exactly!) this artifact?
If yes:
The reason can be failed authentication or connectivity. Ensure your credentials for this repo are configured correctly and the repo grants your account permission to the artifact. (also consider potential proxy issues)
Running the build with parameter -X may help to get more info.
If no:
(The repo in your pom does not contain version 187: https://repo.fusesource.com/nexus/content/groups/public/org/jboss/fuse/bom/jboss-fuse-parent/ )
Add a repo which contains the missing artefact or (if acceptable) change the artefact to a version which exists in your repo.
https://repository.jboss.org/nexus/content/groups/ea/org/jboss/fuse/bom/jboss-fuse-parent/
is a candidate but it does not contain the exact version 187.
Is a change to version 6.3.0.redhat-187-05 acceptable?

Downloading dependencies from additional repository maven

I want to use new version of Spring Boot in my webapp (1.4.0 RC1), so I added additional repository to my pom.xml file:
<project>
<groupId>com.exampleRestApp</groupId>
<artifactId>test</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>test</name>
<description>Demo project for Spring Boot</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.4.0.RC1</version>
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>9.3-1102-jdbc41</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.6.3</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>5.2.1.Final</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
</dependencies>
<repositories>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/libs-milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
And it works well with Idea, but when I'm trying to build the project with maven I'm getting this error:
Plugin org.springframework.boot:spring-boot-maven-plugin:1.4.0.RC1 or one of its dependencies could not be resolved: Could not find artifact org.springframework.boot:spring-boot-maven-plugin:jar:1.4.0.RC1 in central (https://repo.maven.apache.org/maven2) -> [Help 1]
Maven uses separate repository configuration for plugins and for "normal" dependencies. This means that you also need to add a <pluginRepository> to access the 1.4.0.RC1 version of Boot's Maven plugin:
<pluginRepositories>
<pluginRepository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/libs-milestone</url>
</pluginRepository>
</pluginRepositories>
Make the repository definition like:
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/libs-milestone</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
use this repo
<repository>
<id>spring-milestone</id>
<name>Spring Milestone Repository</name>
<url>https://repo.spring.io/milestone</url>
</repository>

Maven deployment location vs download location

I have a problem setting up things correctly; my end goal is to pull artifacts from one nexus (I'm going to refer to it as Nexus1) and deploy to another nexus (Nexus2), two are hosted in different locations with different domains.
Here's my settings.xml:
<?xml version="1.0" encoding="UTF-8"?>
<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">
<distributionManagement>
<repository>
<id>deployment</id>
<name>Internal Releases</name>
<url>http://Nexus2/content/repositories/releases/</url>
</repository>
<snapshotRepository>
<id>deployment</id>
<name>Internal Releases</name>
<url>http://Nexus2/content/repositories/snapshots/</url>
</snapshotRepository>
</distributionManagement>
<mirrors>
<mirror>
<id>company-central</id>
<name>CompanyCentral</name>
<url>http://Nexus1/content/groups/public/</url>
<mirrorOf>central</mirrorOf>
</mirror>
</mirrors>
<profiles>
<profile>
<id>default-repositories</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<repositories>
<repository>
<id>core-releases</id>
<url>http://Nexus1/content/repositories/core-release</url>
<releases>
<enabled>true</enabled>
<checksumPolicy>fail</checksumPolicy>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>core-snapshots</id>
<url>http://Nexus1/content/repositories/core-snapshot</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
<checksumPolicy>fail</checksumPolicy>
</snapshots>
</repository>
<repository>
<id>releases</id>
<url>http://Nexus1/content/repositories/releases</url>
<releases>
<enabled>true</enabled>
<checksumPolicy>fail</checksumPolicy>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>snapshots</id>
<url>http://Nexus1/content/repositories/snapshots</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
<checksumPolicy>fail</checksumPolicy>
</snapshots>
</repository>
</repositories>
</profile>
<profile>
<id>inject-liferay-properties</id>
<properties>
<liferay.auto.deploy.dir.val>/Users/dmadathil/Documents/Portal/workspace/X-Portal-11.0.0/bundles/deploy</liferay.auto.deploy.dir.val>
<liferay.app.server.deploy.dir.val>/Users/dmadathil/Documents/Portal/workspace/X-Portal-11.0.0/bundles</liferay.app.server.deploy.dir.val>
<liferay.app.server.lib.global.dir.val>/Users/dmadathil/Documents/Portal/workspace/X-Portal-11.0.0/bundles/tomcat-7.0.42/lib</liferay.app.server.lib.global.dir.val>
<liferay.app.server.portal.dir.val>/Users/dmadathil/Documents/Portal/workspace/X-Portal-11.0.0/bundles/tomcat-7.0.42/webapps/ROOT</liferay.app.server.portal.dir.val>
</properties>
</profile>
</profiles>
<activeProfiles>
<activeProfile>inject-liferay-properties</activeProfile>
</activeProfiles>
</settings>
And here's 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>
<parent>
<groupId>com.company</groupId>
<artifactId>super-pom</artifactId>
<version>1.1.0</version>
</parent>
<artifactId>covlogs</artifactId>
<version>0.0.2-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>log4j-over-slf4j</artifactId>
</exclusion>
<exclusion>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</dependency>
<dependency>
<groupId>com.company.platform.group.client</groupId>
<artifactId>group-client</artifactId>
</dependency>
<dependency>
<groupId>com.company.platform.user.client</groupId>
<artifactId>user-client</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
</dependency>
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>1.2.5.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<version>1.2.5.RELEASE</version>
</dependency>
<dependency>
<groupId>com.company.core</groupId>
<artifactId>slf4j-bom</artifactId>
<version>1.7.12</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>com.company.platform.group.client</groupId>
<artifactId>group-client</artifactId>
<version>1.1.0.RELEASE</version>
</dependency>
<dependency>
<groupId>com.company.platform.user.client</groupId>
<artifactId>user-client</artifactId>
<version>1.0.0.RELEASE</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.9</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20141113</version>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.7.4.201502262128</version>
<executions>
<execution>
<id>pre-unit-test</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>post-unit-test</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spring-releases</id>
<url>https://repo.spring.io/libs-release</url>
</repository>
<!--<repository>
<id>core-releases</id>
<url>http://Nexus1/content/repositories/core-release</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>core-snapshots</id>
<url>http://Nexus1/content/repositories/core-snapshot</url>
<releases>
<enabled>false</enabled>
</releases>
</repository>
<repository>
<id>releases</id>
<url>http://Nexus1/content/repositories/releases</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>snapshots</id>
<url>http://Nexus1/content/repositories/snapshots</url>
<releases>
<enabled>false</enabled>
</releases>
</repository>-->
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-releases</id>
<url>https://repo.spring.io/libs-release</url>
</pluginRepository>
</pluginRepositories>
</project>
The problem that I'm facing is that every time I build the project it still tries to upload to Nexus1 instead of Nexus2!!
EDIT: Here's a sample error message from Jenkins' output console:
ERROR: Failed to deploy artifacts: Could not transfer artifact com.company:covlogs:jar:0.0.2-20150928.201829-1 from/to snapshots (http://Nexus1/content/repositories/core-snapshot/): Failed to transfer file: http://Nexus1/content/repositories/core-snapshot/com/company/covlogs/0.0.2-SNAPSHOT/covlogs-0.0.2-20150928.201829-1.jar. Return code is: 401, ReasonPhrase: Unauthorized.
I'm still new to maven, and I'm not sure what's going wrong. I've been banging my head for a couple of days now on this.
Any help would be greatly appreciated!
EDIT2: Steps I've taken, I've added the <distributionManagement> block hoping it would fix the issue, but that didn't work.
I've also added maven-deploy-plugin to pom.xml, but that didn't do anything either.
EDIT3: For Jenkins I'm using Maven Release plug-in to setup where I want the artifacts to be deployed to:

Why can't I resolve the dependencies for GeoTools maven quickstart?

POM is
<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.geotools</groupId>
<artifactId>tutorial</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>tutorial</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<geotools.version>10-SNAPSHOT</geotools.version>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.geotools</groupId>
<artifactId>gt-shapefile</artifactId>
<version>${geotools.version}</version>
</dependency>
<dependency>
<groupId>org.geotools</groupId>
<artifactId>gt-swing</artifactId>
<version>${geotools.version}</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>maven2-repository.dev.java.net</id>
<name>Java.net repository</name>
<url>http://download.java.net/maven/2</url>
</repository>
<repository>
<id>osgeo</id>
<name>Open Source Geospatial Foundation Repository</name>
<url>http://download.osgeo.org/webdav/geotools/</url>
</repository>
</repositories>
</project>
I get the error:
[ERROR] Failed to execute goal on project tutorial: Could not resolve dependencies for project org.geotools:tutorial:jar:1.0-SNAPSHOT: The following artifacts could not be resolved: org.geotools:gt-shapefile:jar:10-SNAPSHOT, org.geotools:gt-swing:jar:10-SNAPSHOT: Could not find artifact org.geotools:gt-shapefile:jar:10-SNAPSHOT in maven2- repository.dev.java.net (http://download.java.net/maven/2) -> [Help 1]
Why can't it resolve the artifacts. GeoTools has other instructions (which I can't get to work) but I'd like to know whats wrong with this.
Thanks
The issue occurs because the org.geotools:gt-shapefile:jar:10-SNAPSHOT does not exist at either http://download.java.net/maven/2 or http://download.osgeo.org/webdav/geotools. All you have to do is define the snapshot repository for the GeoTools as it is mentioned at the GeoTools:Maven Quick Start as the following: -
<repositories>
<repository>
<id>maven2-repository.dev.java.net</id>
<name>Java.net repository</name>
<url>http://download.java.net/maven/2</url>
</repository>
<repository>
<id>osgeo</id>
<name>Open Source Geospatial Foundation Repository</name>
<url>http://download.osgeo.org/webdav/geotools/</url>
</repository>
<repository> <!--Add the snapshot repository here-->
<snapshots>
<enabled>true</enabled>
</snapshots>
<id>opengeo</id>
<name>OpenGeo Maven Repository</name>
<url>http://repo.opengeo.org</url>
</repository>
</repositories>
I hope this may help.
Some of the repositories in above answers have been moved to alternative addresses. Adding the following repositories solved the issue for me.
<repository>
<id>osgeo-alt</id>
<url>https://repo.osgeo.org/repository/release/</url>
</repository>
<repository>
<id>geomajas</id>
<name>Geomajas Maven Repository</name>
<url>http://maven.geomajas.org/(http://maven.geomajas.org/)</url>
</repository>
Current available osgeo repo:
<repository>
<id>geotools</id>
<name>Geotools repository</name>
<!--<url>http://download.osgeo.org/webdav/geotools/</url>-->
<url>https://repo.osgeo.org/repository/geotools-releases/</url>
</repository>
http://download.java.net/maven/2 repository is gone
New updates, New way to add geotools dependency in your project, copy below xml file in your build.xml
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<geotools.version>19-SNAPSHOT</geotools.version>
</properties>
<dependencies>
<dependency>
<groupId>com.opencsv</groupId>
<artifactId>opencsv</artifactId>
<version>3.3</version>
</dependency>
<dependency>
<groupId>org.geotools</groupId>
<artifactId>gt-shapefile</artifactId>
<version>${geotools.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.geotools</groupId>
<artifactId>gt-swing</artifactId>
<version>${geotools.version}</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>osgeo</id>
<name>Open Source Geospatial Foundation Repository</name>
<url>http://download.osgeo.org/webdav/geotools/</url>
</repository>
<repository>
<snapshots>
<enabled>true</enabled>
</snapshots>
<id>boundless</id>
<name>Boundless Maven Repository</name>
<url>http://repo.boundlessgeo.com/main</url>
</repository>
</repositories>
It works
You should add Boundless repository and write https indtead of http:
<repositories>
<repository>
<id>maven2-repository.dev.java.net</id>
<name>Java.net repository</name>
<url>http://download.java.net/maven/2</url>
</repository>
<repository>
<id>osgeo</id>
<name>Open Source Geospatial Foundation Repository</name>
<url>https://download.osgeo.org/webdav/geotools/</url>
</repository>
<repository>
<snapshots>
<enabled>true</enabled>
</snapshots>
<id>boundless</id>
<name>Boundless Maven Repository</name>
<url>https://repo.boundlessgeo.com/main/</url>
</repository>
</repositories>
It will make the things work.

Resources