Maven SCM Plugin: Git SSH provider not found - maven

I'm having a problem using the Maven SCM plugin with Git. I cannot get the plugin to work at all because it says the provider is not found. It gives me the following error when I run mvn scm:tag:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-scm-plugin:1.9:tag
(default-cli) on project hello-world-service-minimal: Cannot run tag command :
Can't load the scm provider. No such provider: 'git:ssh://git#git-eng.REDACTED.com'
. -> [Help 1]
My pom.xml looks like the following:
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>net.REDACTED</groupId>
<artifactId>hello-world-service-minimal</artifactId>
<version>1.0.13</version>
<packaging>pom</packaging>
<name>hello-world-service</name>
<properties>
<lang.java.source>1.7</lang.java.source>
<lang.java.target>1.7</lang.java.target>
<dep.junit>4.11</dep.junit>
</properties>
<scm>
<developerConnection>scm:git:ssh://git#git-eng.REDACTED.com|PROJECT_NAME/hello-world-service-minimal.git</developerConnection>
<url>scm:git:http://git-eng.REDACTED.com/PROJECT_NAME/hello-world-service-minimal/tree/master</url>
</scm>
<distributionManagement>
<repository>
<id>dev.release</id>
<url>file:${project.build.directory}/repository/</url>
</repository>
</distributionManagement>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
<version>2.1</version>
</plugin>
<plugin>
<artifactId>maven-scm-plugin</artifactId>
<version>1.9</version>
<configuration>
<tag>${project.artifactId}-${project.version}</tag>
</configuration>
</plugin>
</plugins>
</build>
</project>
Anyone have any idea how to fix this? This is driving me crazy. I can't figure out what I am doing wrong at all.

The <url> tag is for a regular browsable URL. You need a <connection> tag (<connection> is for read access, <developerConnection> is for write access):
<scm>
<connection>scm:git:ssh://git#git-eng.REDACTED.com|PROJECT_NAME/hello-world-service-minimal.git</connection>
<developerConnection>scm:git:ssh://git#git-eng.REDACTED.com|PROJECT_NAME/hello-world-service-minimal.git</developerConnection>
<url>http://git-eng.REDACTED.com/PROJECT_NAME/hello-world-service-minimal/tree/master</url>
</scm>
See the Maven POM Reference for more information.

Related

Generate and update changelog.md after mvn release:perform

I would like to generate, update changelog.md and commit to Bitbucket repository after mvn release:perform is done.
In angular, it has #semantic-release/git, #semantic-release/commit-analyzer, #semantic-release/release-notes-generator, #semantic-release/npm, #semantic-release/changelog, #semantic-release/exec. Is there anything similar in maven release?
pom.xml
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>3.0.0-M1</version>
<configuration>
<tagNameFormat>v#{project.version}</tagNameFormat>
<checkModificationExcludes>
<checkModificationExclude>pom.xml</checkModificationExclude>
</checkModificationExcludes>
</configuration>
</plugin>
</plugins>
</build>
<distributionManagement>
<repository>
<id>release</id>
<url>https://nexus.../.../release/</url>
</repository>
</distributionManagement>
<properties>
<project.scm.id>my-scm-server</project.scm.id>
</properties>
<scm>
<connection>scm:git:https://user#bitbucket.org/user/comutils.git</connection>
<developerConnection>scm:git:https://user#bitbucket.org/user/comutils.git</developerConnection>
<tag>HEAD</tag>
</scm>
You can use maven-semantic-release which will generate release notes using Angular style commit messages for Maven projects in the same way as you would do with npm projects.
The documentation suggests how to publish to Maven Central, but you can save some hassle by publishing to Github packages.

No SCM URL was provided to perform the release from

I am trying to use maven release plugin and after that automate this using nexus.
Here 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.ozge.net</groupId>
<artifactId>com.ozge.net</artifactId>
<version>1.1- snapshot</version>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<tagBase>svn://local/exekuce/com.ozge.net</tagBase>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
<scm>
<tag>HEAD</tag>
<connection>scm:svn:svn://[svnusername]:[svn password]#local/exekuce/com.ozge.net</connection>
<developerConnection>scm:svn:svn://[svnusername]:[svn password]#local/exekuce/com.ozge.net</developerConnection>
<url>scm:svn:svn://[svnusername]:[svn password]#local/exekuce/com.ozge.net</url>
</scm>
<distributionManagement>
<repository>
<id>OzgeRelease</id>
<url>http://localhost:8081/nexus/content/repositories/OzgeRelease</url>
</repository>
</distributionManagement>
</project>
after I ran the command mvn release:perform on command prompt
it says
No SCM URL was provided to perform the release from
I believe I provided.
Anybody here tried to maven-subversion-nexus-hudson for automating builds?
Try to perform release:clean first.
mvn release:clean
Then try again.

multi module maven release

i have a multi module maven project
the structure of the poms is workspace/parent , workspace/child1 ,workspace/child2
and in the svn repository i have one repository for all of them
when release:prepare executes , does not any problem, but when release:perform executes this error occurs
[ERROR] Failed to execute goal
org.apache.maven.plugins:maven-release-plugin:2.3.2:perform
(default-cli) on project veterans: Error executing Maven. Working
directory
"D:\java\myeclipse-workspace\veterans\target\checkout\veterans" does
not exist! -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to
execute goal
org.apache.maven.plugins:maven-release-plugin:2.3.2:perform
(default-cli) on project veterans: Error executing Maven.
i think the problem is the checkout from repository, because after checkout in the target folder we have trunk,tags,branches, but i think we must have parent,child1,child2
and other problem is, why when maven-release tags the snapshot, it tags the repository structure into svn repository tags?
after release:prepare we have trunk,branches,tags in svnrepository/tags/parent-1.0.0
this is my parent pom :
<?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.dpj</groupId>
<artifactId>veterans</artifactId>
<version>1.0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<scm>
<connection>scm:svn:http://192.168.1.10:7075/svn/veterans/trunk</connection>
<developerConnection>scm:svn:http://192.168.1.10:7075/svn/veterans/trunk</developerConnection>
<url>http://192.168.1.10:7075/svn/veterans</url>
</scm>
<properties>
<jdk.version>1.7</jdk.version>
<maven.build.timestamp.format>yyyy-MM-dd</maven.build.timestamp.format>
<packname>-${project.version}-FL-${maven.build.timestamp}</packname>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<modules>
<module>../veterans-presentation</module>
<module>../veterans-service</module>
</modules>
<distributionManagement>
<repository>
<id>dpj-artifactory-releases</id>
<name>dpj-artifactory-releases</name>
<url>http://192.168.1.10:8082/artifactory/ext-release-local</url>
</repository>
<snapshotRepository>
<id>dpj-artifactory-snapshots</id>
<name>dpj-artifactory-snapshots</name>
<url>http://192.168.1.10:8082/artifactory/ext-snapshot-local</url>
</snapshotRepository>
</distributionManagement>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-scm-plugin</artifactId>
<version>1.9.2</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<tagBase>http://192.168.1.10:7075/svn/veterans/tags/</tagBase>
<tagNameFormat>#{project.artifactId}-#{project.version}</tagNameFormat>
</configuration>
</plugin>
</plugins>
</build>
</project>
i solved my issue by adding the project name in end of connection and developerConnection. as though
when the plugin wants to add to tag, it sets the checkout to parent folder. So i added the address of repository of projects with the name of folder after trunk.
<connection>scm:svn:http://reposotpry:7075/svn/veterans/trunk/veterans/</connection>
<developerConnection>scm:svn:http://reposotpry:7075/svn/veterans/trunk/veterans/</developerConnection>
and its fixed.

Connector for maven deployment?

I have created a working maven archetype for a Vaadin/Hibernate/Spring project. I am able to install this archetype to my local repository and use it to generate new maven projects.
Now I want to deploy the archetype to my companies internal repository, so it might be used by other developers. However, when I run mvn deploy I recieve the following error message:
[ERROR] Failed to execute goal org.apache.maven.plugins:
maven-deploy-plugin:2.7:deploy (default-deploy) on project
vaadin-hibernate-archetype: Failed to deploy artifacts/metadata:
No connector available to access repository maven.planet-ic.de
(maven.planet-ic.de/planet-ic-releases) of type default using the
available factories WagonRepositoryConnectorFactory -> [Help 1]
What is the connector that I am missing?
EDIT: I am not asking for someone to solve my problem, just some insight as to what the 'connector' is.
Here is my pom.xml if it should be of interest:
<?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>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<groupId>de.planetic.maven.archetype.vaadin</groupId>
<artifactId>vaadin-hibernate-archetype</artifactId>
<version>1.1.0</version>
<packaging>jar</packaging>
<inceptionYear>2013</inceptionYear>
<description>
This archetype generates a Vaadin application for use with Hibernate, and to be deployed to a Tomcat 7 server. It may also work with other Tomcat versions and other servers.
</description>
<developers>
<developer>
<name>Maximilian Friedersdorff</name>
<email>max.friedersdorff#planet-ic.de</email>
</developer>
</developers>
<scm>
<connection>scm:svn:http://subversion.planet-ic.de/internal/maven/archetype/pinnwand-webapp/tags/pinnwand-webapp-archetype-1.1.0</connection>
<developerConnection>scm:svn:http://subversion.planet-ic.de/internal/maven/archetype/pinnwand-webapp/tags/pinnwand-webapp-archetype-1.1.0</developerConnection>
<url>http://subversion.planet-ic.de/internal/maven/archetype/pinnwand-webapp/tags/pinnwand-webapp-archetype-1.1.0</url>
</scm>
<distributionManagement>
<repository>
<id>maven.planet-ic.de</id>
<name>planet-ic-releases</name>
<url>maven.planet-ic.de/planet-ic-releases</url>
</repository>
<snapshotRepository>
<id>maven.planet-ic.de</id>
<name>planet-ic-snapshots</name>
<url>http://maven.planet-ic.de/planet-ic-snapshots</url>
</snapshotRepository>
</distributionManagement>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.7</version>
</plugin>
</plugins>
</pluginManagement>
<extensions>
<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ssh</artifactId>
<version>2.4</version>
</extension>
</extensions>
</build>
</project>
Depending on the maven repository you are trying to deploy to there are various methods available to upload your artifacts.
These methods are implemented using Maven Wagon connectors for different transport protocols (e.g. ssh,dav etc.), this is the term you are looking for.
Apache Maven Guide to using Extensions gives you an introduction on how to add connectors to your setup.
In the following line:
<url>maven.planet-ic.de/planet-ic-releases</url>
You need to add prefix of "file://", because you need to tell maven you are using file connector not ftp, http or something else.
And you'd better to use relative path there. For example:
<url>file://${project.basedir}/maven.planet-ic.de/planet-ic-releases/</url>
<build>
<extensions>
<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ssh</artifactId>
<version>2.4</version>
</extension>
</extensions>
</build>
<distributionManagement>
<repository>
<id>remoteserver</id>
<name>MyCompany Repository</name>
<url>scp://server/path/repo</url>
</repository>
In case it helps others, adding the following to the pom.xml got it working for me
<build>
<extensions>
<extension>
<groupId>org.springframework.build</groupId>
<artifactId>aws-maven</artifactId>
<version>5.0.0.RELEASE</version>
</extension>
</extensions>
</build>

How to get jenkins to deploy .war file to tomcat6 not localhost

I have a jenkins ci that builds our projects and make a .war file of it.
But i canĀ“t get it to deploy to jenkins, how do i do that?
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>
<groupId>MavenWeb</groupId>
<artifactId>MavenWeb</artifactId>
<packaging>war</packaging>
<version>0.0.1-SNAPSHOT</version>
<description></description>
<distributionManagement>
<repository>
<uniqueVersion>false</uniqueVersion>
<id>e-ject.se</id>
<name>e-ject.se</name>
<url>http://e-ject.se/MavenWeb</url>
<layout>default</layout>
</repository>
</distributionManagement>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.0.1</version>
</plugin>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat6-maven-plugin</artifactId>
<version>2.0-beta-1</version>
<configuration>
<url>http://e-ject.se:8080/manager</url>
<server>e-ject.se</server>
<path>/MavenWeb</path>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
</dependency>
</dependencies>
</project>
And i added all info in settings.xml i found on the web. I can login to e-ject.se:8080/manager/html with the username and password.
<server>
<id>e-ject.se</id>
<username>jonathan</username>
<password>*****</password>
<filePermissions>664</filePermissions>
<directoryPermissions>775</directoryPermissions>
<configuration></configuration>
</server>
I get this in the jenkins console:
mavenExecutionResult exceptions not empty
message : Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.5:deploy (default-deploy) on project MavenWeb:
Failed to deploy artifacts: Could not transfer artifact MavenWeb:MavenWeb:war:0.0.1-20120412.150346-1 from/to e-ject.se
(http://e-ject.se/MavenWeb): Failed to transfer file: http://e-ject.se/MavenWeb/MavenWeb/MavenWeb/0.0.1-SNAPSHOT/MavenWeb-0.0.1-20120412.150346-1.war.
Return code is: 405
If i just add tomcat:deploy in jenkins instead of deploy
i get:
mavenExecutionResult exceptions not empty
message : Failed to execute goal org.codehaus.mojo:tomcat-maven-plugin:1.1:deploy (default-cli) on project MavenWeb: Cannot invoke Tomcat manager
cause : Cannot invoke Tomcat manager
and later:
Caused by: java.io.IOException: Server returned HTTP response code: 401 for URL: http://localhost:8080/manager/deploy?path=%2FMavenWeb&war=
Can someone please help me get this to work, i have read a ton of guides but i cannot get it to work!
Regard
Jonathan
I realized i had more than one jenkins installed maven and i had previouse installations that misslead me! Sometimes its just better to just start over and do it right.

Resources