开发者

Creating Demo of App

I've developed a java/grails web application that has all it's components stored on a single development server and the source code is currently maintained by SVN. I want to port/prepare this application to an CentOS instance in virtualbox on my laptop for demonstration purposes. The problem is there are multiple configuration files that have the development server's ip address, now obivously, this will have to be changed to the ip address of the CentOS instance. What is the best way for me to port/prepare my app?

I was thinking, after I've created a git repo from the svn repo, I could create a git branch entitled "demo", wherein I could make the necessary changes to the config files and generate the needed jars as usual via maven2.

Note:

  1. I would l开发者_C百科ike to move from SVN to GIT
  2. I'm using maven2 as the 'build' tool (I'm thinking of moving to buildr or gradle)


You have a lot of goals, my advice is "don't try to do multiple things at once if they interfere with each other".

Moving SVN to GIT is not a bad idea, but it buys you nothing in terms of getting you IP address configuration issues worked out. In fact, an upset in how you submit code (meaning any change) will just slow you down as everyone learns the new submission process.

Moving maven2 to some other build tool will impact the build for the same reasons. Don't get me wrong, there are advantages to using one build tool over another, but it is far more reasonable to wait till a tool fails you prior to making the decision to pull the trigger.

Your app should have been built with the flexibility to move it to another machine "built in". That's the highest priority, and the issue you should fix first. Then you can afford to tinker with a different development process (which is what you will get with different source code control and build tools).


you have two solution

or make a branch with SVN (svn supports it)

or you can use maven to read the parameters from a properties file, and make two profiles to read a properties file for demo and local enviorment

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>properties-maven-plugin</artifactId>
    <version>1.0-alpha-2</version>
    <executions>
        <execution>
            <phase>initialize</phase>
            <goals>
                <goal>read-project-properties</goal>
            </goals>
            <configuration>
                <files>
                    <file>${env}.properties</file>
                </files>
            </configuration>
        </execution>
    </executions>
</plugin>

and the profiles:

<profiles>
    <profile>
        <id>local</id>
        <activation>
            <activeByDefault>true</activeByDefault>
        </activation>
        <properties>
            <env>local</env>
        </properties>
    </profile>
    <profile>
        <id>demo</id>
        <activation>
        </activation>
        <properties>
            <env>demo</env>
        </properties>
    </profile>
</profiles>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜