Skip to content

Commit

Permalink
Initial checkin
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrey Paramonov committed Aug 22, 2010
0 parents commit bb5c8a9
Show file tree
Hide file tree
Showing 7 changed files with 204 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .gitignore
@@ -0,0 +1,10 @@
/target

/gitmaven-jar/.classpath
/gitmaven-jar/.project
/gitmaven-jar/target

/gitmaven-war/.classpath
/gitmaven-war/.project
/gitmaven-war/target

35 changes: 35 additions & 0 deletions README.md
@@ -0,0 +1,35 @@
# Releasing Maven projects hosted in local Git repository

## Setup Maven project

- Create Maven project.
- Configure `scm` section to use local Git repository.

<scm>
<connection>scm:git:file://.</connection>
<developerConnection>scm:git:file://.</developerConnection>
<url>scm:git:file://.</url>
</scm>

- Configure `distributionManagement` section to point to your remote Maven repository.
- Configure Maven release plugin to use local checkout

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<configuration>
<localCheckout>true</localCheckout>
</configuration>
</plugin>

## Setup local Git repository

$ git init
$ git add .
$ git ci -m 'Initial checkin'

## Release project

mvn release:prepare
mvn release:perform

21 changes: 21 additions & 0 deletions gitmaven-jar/pom.xml
@@ -0,0 +1,21 @@
<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.ndpar.demos</groupId>
<artifactId>gitmaven</artifactId>
<version>1.0.0-SNAPSHOT</version>
</parent>
<artifactId>gitmaven-jar</artifactId>

<dependencies>
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</dependency>
</dependencies>
</project>
5 changes: 5 additions & 0 deletions gitmaven-jar/src/main/java/com/ndpar/demo/User.java
@@ -0,0 +1,5 @@
package com.ndpar.demo;

public class User {

}
41 changes: 41 additions & 0 deletions gitmaven-war/pom.xml
@@ -0,0 +1,41 @@
<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.ndpar.demos</groupId>
<artifactId>gitmaven</artifactId>
<version>1.0.0-SNAPSHOT</version>
</parent>
<artifactId>gitmaven-war</artifactId>
<packaging>war</packaging>

<build>
<plugins>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>6.1.14</version>
<configuration>
<scanIntervalSeconds>10</scanIntervalSeconds>
<connectors>
<connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
<port>8080</port>
<maxIdleTime>60000</maxIdleTime>
</connector>
</connectors>
</configuration>
</plugin>
</plugins>
</build>

<dependencies>
<dependency>
<groupId>com.ndpar.demos</groupId>
<artifactId>gitmaven-jar</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</dependency>
</dependencies>
</project>
12 changes: 12 additions & 0 deletions gitmaven-war/src/main/webapp/WEB-INF/web.xml
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
version="2.5" metadata-complete="true">

<display-name>GIT Maven WAR</display-name>

<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>

</web-app>
80 changes: 80 additions & 0 deletions pom.xml
@@ -0,0 +1,80 @@
<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.ndpar.demos</groupId>
<artifactId>gitmaven</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>pom</packaging>

<modules>
<module>gitmaven-jar</module>
<module>gitmaven-war</module>
</modules>

<scm>
<connection>scm:git:file://.</connection>
<developerConnection>scm:git:file://.</developerConnection>
<url>scm:git:file://.</url>
</scm>

<distributionManagement>
<repository>
<id>releases</id>
<url>http://maven.ndpar.com:9191/nexus/content/repositories/releases</url>
</repository>
<snapshotRepository>
<id>snapshots</id>
<url>http://maven.ndpar.com:9191/nexus/content/repositories/snapshots</url>
</snapshotRepository>
</distributionManagement>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<configuration>
<allowTimestampedSnapshots>true</allowTimestampedSnapshots>
<autoVersionSubmodules>true</autoVersionSubmodules>
<localCheckout>true</localCheckout>
</configuration>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.1-SNAPSHOT</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-scm-plugin</artifactId>
<version>1.4</version>
</plugin>
</plugins>
</pluginManagement>
</build>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.ndpar.demos</groupId>
<artifactId>gitmaven-jar</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>2.4</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.5</version>
<scope>test</scope>
</dependency>
</dependencies>
</dependencyManagement>

</project>

0 comments on commit bb5c8a9

Please sign in to comment.