Code Monkey home page Code Monkey logo

hosts_maven_plugin's Introduction

Description:

A need arose to test mvn releases without actually tagging and pushing artifacts to any “official” repository. Due to a bug in the maven release plugin it’s not possible to use properties in the scm information. This plugin will allow you to keep the same hostnames in the scm and distributionManagement tags, but pull a switch-a-roo with some hosts file magic.

Usage:

Given the following in your pom…

<scm>
    <connection>scm:svn:http://svnhost/trunk</connection>
</scm>

<distributionManagement>
    <repository>
        <id>releases</id>
        <url>http://mvnhost:8081/nexus/content/repositories/releases</url>
    </repository>
</distributionManagement>

add the plugin repository…

<pluginRepositories>
    <pluginRepository>
        <id>darrinholst</id>
        <url>http://darrinholst-maven.googlecode.com/svn/repo/</url>
    </pluginRepository>
</pluginRepositories>

and then add the plugin (most likely to a profile) which is bound to some phase that will get executed before the release, i.e. clean

<profiles>
    <profile>
        <id>local-deploy</id>
        <build>
            <plugins>
                <plugin>
                    <groupId>com.darrinholst</groupId>
                    <artifactId>hosts-maven-plugin</artifactId>
                    <version>1.0.0</version>
                    <executions>
                        <execution>
                            <phase>clean</phase>
                            <goals>
                                <goal>switch</goal>
                            </goals>
                            <configuration>
                                <hosts>
                                    <svnhost>127.0.0.1</svnhost>
                                    <mvnhost>127.0.0.1</mvnhost>
                                </hosts>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </build>
    </profile>
</profiles>

then when you execute…

mvn clean release:prepare release:perform -P local-deploy

…any traffic going to svnhost or mvnhost will head on over to 127.0.0.1

hosts_maven_plugin's People

Contributors

darrinholst avatar

Watchers

 avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.