Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Initial checkin

  • Loading branch information...
commit bb5c8a9621d97c32afd7154c7aca8f323149ca11 0 parents
Andrey Paramonov authored
10 .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 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 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 gitmaven-jar/src/main/java/com/ndpar/demo/User.java
@@ -0,0 +1,5 @@
+package com.ndpar.demo;
+
+public class User {
+
+}
41 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 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 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>
Please sign in to comment.
Something went wrong with that request. Please try again.