No SCM URL was provided to perform the release from - maven

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.

Related

NoFileAssignedException exception when generating karaf feature with maven

I have an error in my karaf feature project wher I run my mvn install. Here is the 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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.dmasoft.karaf.example</groupId>
<artifactId>assemblies-parent</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<groupId>com.dmasoft.karaf.example.feature</groupId>
<artifactId>dmasoft-feature</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>feature</packaging>
<name>${project.groupId}/${project.artifactId}:${project.packaging}:${project.version}</name>
<build>
<plugins>
<plugin>
<groupId>org.apache.karaf.tooling</groupId>
<artifactId>karaf-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
When I run my mvn clean install I get this error:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-install-plugin:3.0.0-M1:install (default-install) on project dmasoft-feature: NoFileAssignedException: The packaging plugin for this project did not assign a main file to the project but it has attachments. Change packaging to 'pom'. -> [Help 1]
The maven-install-plugin:3.0.0-M1 was released as of 01/10/2018
Since, I got the same error with flexmojos projects where packaging was set to .
Solution is to set the version for the maven-install-plugin to the previous version (2.5.2) explicitly so it won't resolve the version automatically.
Note: I had to do this for the maven-deploy-plugin too. There may be others.
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<version>2.5.2</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
</plugin>
</plugins>
</build>
Now you can change mule.tools.version to 1.7 1.7 instead of setting maven plugins version if you are using it.

Plugin.xml file is not found /generated for eclipse plugin project

I am developing one maven plugin which will be used to override default maven lifecycle.To resolve dependencies (eclipse and other) , I want to use tycho. So I cofigured maven project to convert it into eclipse-plugin-project.
Heres my POM
<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.test.maven.plugin</groupId>
<artifactId>test-maven-plugin</artifactId>
<version>0.0.1</version>
<packaging>eclipse-plugin</packaging>
<name>test-maven-plugin</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<repositories>
<!-- add Mars repository to resolve dependencies -->
<repository>
<id>Mars</id>
<layout>p2</layout>
<url>http://download.eclipse.org/releases/mars/</url>
</repository>
</repositories>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<!-- enable tycho build extension -->
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-maven-plugin</artifactId>
<version>0.23.0</version>
<extensions>true</extensions>
</plugin>
</plugins>
</build>
</project>
Now , as my packaging type is 'eclipse-plugin' , it is not generating plugin.xml file while installing project (mvn install). If I do the packaging type as 'maven-plugin' , it generates plugin.xml , but it does resolve dependencies using tycho.
Any thoughts for combining both?

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.

Maven SCM Plugin: Git SSH provider not found

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.

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