mirror of
https://github.com/Alfresco/alfresco-sdk.git
synced 2025-10-01 14:41:57 +00:00
git-svn-id: http://maven-alfresco-archetypes.googlecode.com/svn/trunk@124 04253f4f-3451-0410-a141-5562f1e59037
This commit is contained in:
54
plugins/maven-nosnapshot-plugin/pom.xml
Normal file
54
plugins/maven-nosnapshot-plugin/pom.xml
Normal file
@@ -0,0 +1,54 @@
|
||||
<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.sourcesense.maven</groupId>
|
||||
<artifactId>maven-nosnapshot-plugin</artifactId>
|
||||
<packaging>maven-plugin</packaging>
|
||||
<version>0.0.3-SNAPSHOT</version>
|
||||
<name>maven-nosnapshot-plugin Maven Mojo</name>
|
||||
<url>http://maven.apache.org</url>
|
||||
<scm>
|
||||
<developerConnection>scm:svn:https://dev.sourcesense.com/repos/dev/maven-nosnapshot-plugin/tags/maven-nosnapshot-plugin-0.0.1</developerConnection>
|
||||
<url>https://dev.sourcesense.com/repos/dev/maven-nosnapshot-plugin/tags/maven-nosnapshot-plugin-0.0.1</url>
|
||||
</scm>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-plugin-api</artifactId>
|
||||
<version>2.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>3.8.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-project</artifactId>
|
||||
<version>2.0.9</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-release-plugin</artifactId>
|
||||
<configuration>
|
||||
<!-- useEditMode>true</useEditMode>-->
|
||||
<preparationGoals>clean</preparationGoals>
|
||||
<goals>deploy</goals>
|
||||
<tagBase>https://dev.sourcesense.com/repos/dev/maven-nosnapshot-plugin/tags</tagBase>
|
||||
<useEditMode>true</useEditMode>
|
||||
<username>g.columbro</username>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
</plugins>
|
||||
</build>
|
||||
<distributionManagement>
|
||||
<repository>
|
||||
<id>ss-public</id>
|
||||
<url>scpexe://repository.sourcesense.com/var/www/repository.sourcesense.com/maven2</url>
|
||||
</repository>
|
||||
</distributionManagement>
|
||||
</project>
|
@@ -0,0 +1,63 @@
|
||||
package com.sourcesense.maven;
|
||||
|
||||
/*
|
||||
* Copyright 2001-2005 The Apache Software Foundation.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import java.text.MessageFormat;
|
||||
|
||||
import org.apache.maven.plugin.AbstractMojo;
|
||||
import org.apache.maven.plugin.MojoExecutionException;
|
||||
import org.apache.maven.project.MavenProject;
|
||||
|
||||
/**
|
||||
* Goal which pushes a stripped version number in the maven project properties (any -SNAPSHOT suffix is removed)
|
||||
*
|
||||
* @goal strip
|
||||
* @phase initialize
|
||||
*
|
||||
*/
|
||||
public class NoSnapshotVersionMojo
|
||||
extends AbstractMojo
|
||||
{
|
||||
/**
|
||||
* Current version of the project
|
||||
* @parameter expression="${project.version}"
|
||||
* @required
|
||||
*/
|
||||
private String version;
|
||||
|
||||
/**
|
||||
* The Maven project
|
||||
* @parameter expression="${project}"
|
||||
* @required
|
||||
*/
|
||||
private MavenProject project;
|
||||
|
||||
public void execute()
|
||||
throws MojoExecutionException
|
||||
{
|
||||
int indexOfDash = -1;
|
||||
String noSnapshotVersion = version;
|
||||
if((indexOfDash = version.indexOf("-SNAPSHOT")) != -1)
|
||||
{
|
||||
noSnapshotVersion = version.substring(0, indexOfDash);
|
||||
}
|
||||
getLog().info(
|
||||
MessageFormat.format( "Storing noSnapshotVersion: {0} ", new Object[] {
|
||||
noSnapshotVersion} ) );
|
||||
project.getProperties().put("noSnapshotVersion", noSnapshotVersion);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user