Maven Build Error - Cannot determine host information - maven

I'm new to maven.
When i try to run "mvn compile" i'm getting the following error
Failed to execute goal
de.smartics.maven.plugin:buildmetadata-maven-plugin:1.4.0:provide-buildmetadata (default)
on project xxxxx:
Cannot determine host information. SJP2S5-113053048D: SJP2S5-113053048D:
nodename nor servname provided, or not known -> [Help 1]
[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/MojoExecutionException
Here is my settings.xml
<?xml version="1.0"?>
<settings 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/settings-1.0.0.xsd">
<localRepository/>
<interactiveMode/>
<usePluginRegistry/>
<offline/>
<mirrors>
<mirror>
<!--This sends everything else to /public -->
<id>nexus</id>
<mirrorOf>*</mirrorOf>
<url>http://xxxx-xxxx.xxxxx.com/xxxx/content/xxxx/public</url>
</mirror>
</mirrors>
<profiles>
<profile>
<id>nexus</id>
<properties>
<repo-releases-url>http://xxx-xxxxxx.xxxx.com/xxxxx/content/repositories/releases/</repo-releases-url>
<repo-snapshots-url>http://xxx-xxxxx.xxxx.com/xxxxx/content/repositories/snapshots/</repo-snapshots-url>
</properties>
<!-- Enable snapshots for the built in central repo to direct -->
<!-- all requests to nexus via the mirror -->
<repositories>
<repository>
<id>central</id>
<url>http://central</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<url>http://central</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<activeProfiles>
<!-- make the profile active all the time -->
<activeProfile>nexus</activeProfile>
</activeProfiles>
<pluginGroups>
<pluginGroup>com.webobjects.maven.plugins</pluginGroup>
<pluginGroup>org.mortbay.jetty</pluginGroup>
</pluginGroups>
<servers>
<server>
<id>snapshots</id>
<username>xxxx_engineer</username>
<password>xxxxx</password>
</server>
<server>
<id>thirdparty</id>
<username>xxxxx</username>
<password>xxxx</password>
</server>
</servers>
</settings>
I've tried mvn clean and mvn compile, mvn clean is successful, but mvn compile produces the error above, which I do not understand.
I've checked the link mentioned in the error, and it talks about proxy settings in the settings.xml.
I'm using
Maven 3.0.4
Jdk 1.7
MAC OS X
Below is the result for above command mvn --version
$ mvn --version
Apache Maven 3.0.4 (r1232337; 2012-01-17 14:14:56+0530)
Maven home: /Users/raghuramankumarasamy/Documents/raghu/maven/apache-maven-3.0.4
Java version: 1.7.0_75, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.7.0_75.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.10", arch: "x86_64", family: "mac"
I'm using mac os X
the below command hostname, gives the following result....
SJP2S5-113053048D:xxxxx raghuramankumarasamy$ hostname
SJP2S5-113053048D
Added part of pom.xml as per request
<pluginManagement>
<plugins>
<!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>de.smartics.maven.plugin</groupId>
<artifactId>buildmetadata-maven-plugin</artifactId>
<versionRange>[0.0.0,)</versionRange>
<goals>
<goal>provide-buildmetadata</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore />
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>

Related

Maven not using configured repositories to resolve all dependencies

Hello I am trying to build a jar using maven behind a corporate proxy with our own artifactory server.
We are building using docker gitlab runners and I am using the maven:3-jdk-8 image which is running Apache Maven 3.5.4.
The build starts fine by downloading the dependencies from our artifactory but when the maven-assembly-plugin tries to package our output into a jar I get the following error in debug mode:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-assembly-plugin:2.2.1:single (package-jar-with-dependencies) on project <my-project>: Failed to create assembly: Unable to resolve dependencies for assembly 'jar-with-dependencies': Failed to resolve dependencies for assembly: Unable to get dependency information for org.hibernate.validator:hibernate-validator:jar:6.0.13.Final: Failed to process POM for org.hibernate.validator:hibernate-validator:jar:6.0.13.Final: Non-resolvable import POM: Could not transfer artifact org.jboss.shrinkwrap:shrinkwrap-bom:pom:1.2.3 from/to central (https://repo.maven.apache.org/maven2): repo.maven.apache.org: Name or service not known
[ERROR] org.hibernate.validator:hibernate-validator:jar:6.0.13.Final
[ERROR]
[ERROR] from the specified remote repositories:
[ERROR] central (https://artifactory.corp.net/, releases=true, snapshots=false)
[ERROR] Path to dependency:
[ERROR] 1) <my-project>
[ERROR] 2) org.springframework.boot:spring-boot-starter-web:jar:2.1.0.RELEASE: Unknown host repo.maven.apache.org: Name or service not known
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-assembly-plugin:2.2.1:single (package-jar-with-dependencies) on project <my-project>: Failed to create assembly: Unable to resolve dependencies for assembly 'jar-with-dependencies'
The glaring issue would seem to be that maven is trying to retrieve hibernate-validator from repo.maven.apache.org rather than my local corporate artifactory.
I have verified that the jar in question does indeed exist in my artifactory. I have built the project locally (outside of docker maven version 3.6.1 bundled with Intellij) with identical settings and didn't have any problems.
Any ideas what I'm doing wrong?
Some possibly useful files
The effective settings generated by help:effective-settings
<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">
<localRepository>path-to-my-repo</localRepository>
<servers>
<server>
<username>username</username>
<password>***</password>
<id>central</id>
</server>
<server>
<username>username</username>
<password>***</password>
<id>snapshots</id>
</server>
</servers>
<profiles>
<profile>
<repositories>
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>Artifactory</name>
<url>https://artifactory.corp.net/</url>
</repository>
<repository>
<snapshots />
<id>snapshots</id>
<name>Artifactory</name>
<url>https://artifactory.corp.net/</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>Artifactory</name>
<url>https://artifactory.corp.net/</url>
</pluginRepository>
<pluginRepository>
<snapshots />
<id>snapshots</id>
<name>Artifactory</name>
<url>https://artifactory.corp.net/</url>
</pluginRepository>
</pluginRepositories>
<id>artifactory</id>
</profile>
</profiles>
<activeProfiles>
<activeProfile>artifactory</activeProfile>
</activeProfiles>
<pluginGroups>
<pluginGroup>org.apache.maven.plugins</pluginGroup>
<pluginGroup>org.codehaus.mojo</pluginGroup>
</pluginGroups>
</settings>
The plugin configuration from the pom file
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2.1</version>
<executions>
<execution>
<id>package-jar-with-dependencies</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<appendAssemblyId>false</appendAssemblyId>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<archive>
<manifest>
<mainClass>the.main.class</mainClass>
</manifest>
</archive>
</configuration>
</execution>
</executions>
</plugin>
It is very likely that this is the result of a missing mirror configuration in the settings.xml.
If you want to send every request to your artifactory, you need to specify it as a mirror. Otherwise, repository definitions from POMs may be used as well.

How to fix "Not authorized" error on using "dependency:get" plugin in maven

The maven throws out a "Not authorized" error when I using "dependency:get" plugin on the command line. How can I fix it?
I have tried to add my server repository in the .m2/settings.xml.My user name and password are correct. I tried using the same artifact and repository can be downloaded by pom.xml in the IntelliJ.
This is my maven command line, It faild:
mvn org.apache.maven.plugins:maven-dependency-plugin:3.1.1:get \
-Dartifact=mygroup:myartifact:myversion:aar \
-DremoteRepositories=public::default::my.repository
.m2/setting.xml
<servers>
<server>
<id>public</id>
<username>myuser</username>
<password>mypassword</password>
</server>
</servers>
.m2/plugin-registry.xml
<?xml version="1.0" encoding="UTF-8"?>
<pluginRegistry xsi:schemaLocation="http://maven.apache.org/PLUGIN_REGISTRY/1.0.0 http://maven.apache.org/xsd/plugin-registry-1.0.0.xsd"
xmlns="http://maven.apache.org/PLUGIN_REGISTRY/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<useVersion>3.1.1</useVersion>
<rejectedVersions/>
</plugin>
</plugins>
</pluginRegistry>
My pom.xml, It succeeds:
<dependency>
<groupId>mygroup</groupId>
<artifactId>myartifact</artifactId>
<version>myversion</version>
<type>aar</type>
</dependency>
<repositories>
<repository>
<id>public</id>
<name>Public Repositories</name>
<layout>default</layout>
<url>my.repository</url>
</repository>
</repositories>

Deploy Artefact at nexus Server - error dependencies could not be resolved

I have setup a nexus server and afterwards I had the opinion to simple deploy an artefact to this nexus server. Therefore I created a simple Java project with this pom:
<project xmlns="...">
<modelVersion>4.0.0</modelVersion>
<groupId>MyProject</groupId>
<artifactId>MyProject</artifactId>
<version>0.0.1-SNAPSHOT</version>
<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
</project>
My settings file looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<settings ...>
<pluginGroups>
</pluginGroups>
<proxies>
</proxies>
<servers>
</servers>
<mirrors>
<mirror>
<id>nexus</id>
<name>Nexus Public Mirror</name>
<mirrorOf>central</mirrorOf>
<url>http://it-nexus.domain:8081/nexus/content/groups/public</url>
</mirror>
</mirrors>
<profiles>
<profile>
<id>nexus</id>
<repositories>
<repository>
<id>central</id>
<url>http://central</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<url>http://central</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>nexus</activeProfile>
</activeProfiles>
</settings>
Then I have tried to deploy my artefact with:
mvn deploy
and I got this Error:
[ERROR] Plugin org.apache.maven.plugins:maven-resources-plugin:2.6 or one of its dependencies could not be resolved: Failure to find org.apache.maven.plugins:maven-resources-plugin
:jar:2.6 in http://it-nexus.domain:8081/nexus/content/groups/public was cached in the local repository, resolution will not be reattempted until the update interval of
nexus has elapsed or updates are forced -> [Help 1]
Actually I don't know what I am doing wrong!?
You've got a few things wrong (well, everything really).
First, you can remove profiles and everything under it, along with activeProfiles, from your server.xml file. Next, you need to add a servers entry, containing a server with the id, 'nexus' (assuming you're uploading to the same nexus instance you're using to mirror central), along with a username and password of some sort.
Then you have to have a distributionManagement section in your pom, referencing the same server you've specified in the settings.xml file, and configure the maven-deploy plugin. Documentation for that can be found here. You will also need an scm section.
The actual error you talk about is probably because your nexus server isn't actually configured to proxy/mirror central. Oh, and you should use * as the argument to mirrorOf.

Trying to access Oracle's Maven repository

I'm attempting to access Oracle's repository. Oracle doesn't make it easy. However, I'm attempting to follow the documentation that Oracle provided.
I've:
Approved the licensing agreement on my system (in case there's some sort of cookie that needs to be set).
Set both M2_HOME and MAVEN_HOME to /usr/share/apache-maven.
Created an Oracle account.
Added the Oracle Repository to my settings.xml file.
Downloaded wagon-http 2.8 and put it in my $M2_HOME/libs/ext directory.
Generated a master password and put it in $HOME/.m2/settings-security.xml
Generated an encrypted password.
Added the Oracle Maven Repository to my $HOME/.m2/settings.xml file as specified.
Configured HTTP Wagon and added that to my $HOME/.m2/settings.xml file.
My project POM looks like this:
<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>com.vegicorp</groupId>
<artifactId>testMe</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<name>testMe</name>
<url>http://maven.apache.org</url>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.10</version>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>process-resources</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.4</version>
</dependency>
<dependency>
<groupId>com.oracle</groupId>
<artifactId>wls-api</artifactId>
<version>12.1.2</version>
</dependency>
</dependencies>
</project>
My settings.xml looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<settings xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd" xmlns="http://maven.apache.org/SETTINGS/1.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<servers>
<server>
<username>qazwart</username>
<password>swordfish</password>
<id>central</id>
</server>
<server>
<username>qazwart</username>
<password>swordfish</password>
<id>snapshots</id>
</server>
<server>
<id>maven.oracle.com</id>
<username>qazwart#foo.com</username>
<password>{swordfish=}</password>
<configuration>
<basicAuthScope>
<host>ANY</host>
<port>ANY</port>
<realm>OAM 11g</realm>
</basicAuthScope>
<httpConfiguration>
<all>
<params>
<property>
<name>http.protocol.allow-circular-redirects</name>
<value>%b,true</value>
</property>
</params>
</all>
</httpConfiguration>
</configuration>
</server>
</servers>
<profiles>
<profile>
<repositories>
<repository>
<id>maven.oracle.com</id>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
<url>https://maven.oracle.com</url>
<layout>default</layout>
</repository>
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>libs-release</name>
<url>http://repo.vegicorp.net/artifactory/libs-release</url>
</repository>
<repository>
<snapshots />
<id>snapshots</id>
<name>libs-snapshot</name>
<url>http://repo.vegicorp.net/artifactory/libs-snapshot</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>maven.oracle.com</id>
<url>https://maven.oracle.com</url>
</pluginRepository>
<pluginRepository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>plugins-release</name>
<url>http://repo.vegicorp.net/artifactory/plugins-release</url>
</pluginRepository>
<pluginRepository>
<snapshots />
<id>snapshots</id>
<name>plugins-snapshot</name>
<url>http://repo.vegicorp.net/artifactory/plugins-snapshot</url>
</pluginRepository>
</pluginRepositories>
<id>artifactory</id>
</profile>
</profiles>
<activeProfiles>
<activeProfile>artifactory</activeProfile>
</activeProfiles>
</settings>
When I run Maven, I get this:
$ mvn clean package
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building testMe 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
Downloading: https://maven.oracle.com/commons-io/commons-io/2.4/commons-io-2.4.pom
Downloading: http://repo.vegicorp.net/artifactory/libs-release/commons-io/commons-io/2.4/commons-io-2.4.pom
Downloaded: http://repo.vegicorp.net/artifactory/libs-release/commons-io/commons-io/2.4/commons-io-2.4.pom (10 KB at 69.4 KB/sec)
Downloading: https://maven.oracle.com/com/oracle/wls-api/12.1.2/wls-api-12.1.2.pom
Downloading: http://repo.vegicorp.net/artifactory/libs-release/com/oracle/wls-api/12.1.2/wls-api-12.1.2.pom
Downloading: http://repo.vegicorp.net/artifactory/libs-snapshot/com/oracle/wls-api/12.1.2/wls-api-12.1.2.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.787 s
[INFO] Finished at: 2015-06-15T16:37:56-04:00
[INFO] Final Memory: 9M/156M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project testMe: Could not resolve dependencies for project com.vegicorp:testMe:jar:1.0-SNAPSHOT: Failed to collect dependencies at com.oracle:wls-api:jar:12.1.2: Failed to read artifact descriptor for com.oracle:wls-api:jar:12.1.2: Could not transfer artifact com.oracle:wls-api:pom:12.1.2 from/to maven.oracle.com (https://maven.oracle.com): Not authorized , ReasonPhrase:Unauthorized. -> [Help 1]
[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/DependencyResolutionException
It appears that I don't have access to the Oracle repository although I accepted the licensing agreement and am using the account I've created. Is there something I'm missing? If I remove the reference to wls-api.jar in my pom.xml, it works.
From your settings.xml I can see that you use Artifactory. Why won't you define Oracle's repository as a remote in Artifactory? That will make the access much easier. Here's a simple guide on how to do so.
And, of course, here's the official user guide on it.
I am with JFrog, the company behind Bintray and [artifactory], see my profile for details and links.
For anybody that has spent any time fighting with this ... make sure that the ID of the oracle repository in your POM is the same as the ID of the server defined in your Settings.xml.
This is not documented anywhere but it appears that maven just does not request authorization if these IDs do not match. It does not attempt it based upon the URL as other solutions appear to suggest.
I think you missed accepting the Oracle Maven repository terms and conditions. https://www.oracle.com/webapps/maven/register/license.html

Maven: repository element was not specified in the POM inside distributionManagement?

I am trying to run the command, mvn release:perform, but I get this error:
Failed to execute goal
org.apache.maven.plugins:maven-deploy-plugin:2.5:deploy
(default-deploy) on project git-demo:
Deployment failed: repository element
was not specified in the POM inside
distributionManagement element or in
-DaltDeploymentRepository=id::layout::url
parameter
Here's my pom.xml file:
<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>com.sonatype.blog</groupId>
<artifactId>git-demo</artifactId>
<packaging>jar</packaging>
<version>1.1-SNAPSHOT</version>
<name>git-demo</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>
<scm>
<connection>scm:git:git#github.com:Christian-Achilli-KP/git-demo.git</connection>
<url>scm:git:git#github.com:Christian-Achilli-KP/git-demo.git</url>
<developerConnection>scm:git:git#github.com:Christian-Achilli-KP/git-demo.git</developerConnection>
</scm>
<distributionManagement>
<!-- use the following if you're not using a snapshot version. -->
<repository>
<id>localSnap</id>
<name>RepositoryProxyRel</name>
<url>http://127.0.0.1:8080/nexus/content/repositories/releases/</url>
</repository>
<!-- use the following if you ARE using a snapshot version. -->
<snapshotRepository>
<id>MylocalSnap</id>
<name>RepositoryProxySnap</name>
<url>http://127.0.0.1:8080/nexus/content/repositories/snapshots/</url>
</snapshotRepository>
</distributionManagement>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.1</version>
</plugin>
</plugins>
</build>
</project>
Actually I can see the
repository
declaration inside the
distributionManagent
tag.
Here's my settings.xml:
<settings>
<servers>
<server>
<id>localSnap</id>
<username>deployment</username>
<password>****</password>
</server>
<server>
<id>MylocalSnap</id>
<username>deployment</username>
<password>****</password>
</server>
<server>
<id>myserver</id>
<username>tomcat</username>
<password>tomcat</password>
</server>
</servers>
<mirrors>
<mirror>
<!--This sends everything else to /public -->
<id>nexus</id>
<mirrorOf>*</mirrorOf>
<url>http://127.0.0.1:8080/nexus/content/groups/public/</url>
</mirror>
</mirrors>
<profiles>
<profile>
<id>nexus</id>
<properties>
<project.build.sourceEncoding>MacRoman</project.build.sourceEncoding>
<project.reporting.outputEncoding>MacRoman</project.reporting.outputEncoding>
</properties>
<!--Enable snapshots for the built in central repo to direct -->
<!--all requests to nexus via the mirror -->
<repositories>
<repository>
<id>central</id>
<url>http://central</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<url>http://central</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>nexus</activeProfile>
</activeProfiles>
</settings>
Any advice why it complains?
Review the pom.xml file inside of target/checkout/. Chances are, the pom.xml in your trunk or master branch does not have the distributionManagement tag.
I got the same message ("repository element was not specified in the POM inside distributionManagement element"). I checked /target/checkout/pom.xml and as per another answer and it really lacked <distributionManagement>.
It turned out that the problem was that <distributionManagement> was missing in pom.xml in my master branch (using git).
After cleaning up (mvn release:rollback, mvn clean, mvn release:clean, git tag -d v1.0.0) I run mvn release again and it worked.
You can also override the deployment repository on the command line:
-Darguments=-DaltDeploymentRepository=myreposid::default::http://my/url/releases
The ID of the two repos are both localSnap; that's probably not what you want and it might confuse Maven.
If that's not it: There might be more repository elements in your POM. Search the output of mvn help:effective-pom for repository to make sure the number and place of them is what you expect.
For me, this was something as simple as a missing version for my artifact - "1.1-SNAPSHOT"

Resources