From PmWiki

V2: BuildWithMaven

CONGO + Maven quick start

If you're setting up a virgin command line environment and want to just check CONGO out of SVN, and build a war file, do these steps:

Procedure:

Troubleshooting

Alternate procedure to generate a snapshot war:

Alternate webrunner-invoked instance:

CONGO2? under eclipse (work in progress)

Releases:


Anything below this is from previous work on the build / dev process. Use with caution.


Quick start: run mvn package and pull the resulting WAR file from target/congo-VERSION.war.

Running CONGO 2 under Tomcat, from Maven

If you have a running Tomcat installation on your local machine, you can use maven to immediately deploy the created WAR to it. Add the following to ~/.m2/settings.xml:

<settings>
  <!-- ... -->

  <servers>
    <!-- ... -->

    <server>
      <id>congo.tomcat</id>
      <username>manager</username>
      <password>manager</password>
    </server>
  </servers>

  <!-- ... -->

  <profiles>
    <!-- ... -->

    <profile>
      <id>congo</id>
      <properties>
        <!-- Use the 'congo.tomcat' credentials for maven-tomcat-plugin -->
        <maven.tomcat.server>congo.tomcat</maven.tomcat.server>
        <!-- Redeploy if tomcat:deploy runs when the app is already deployed. -->
        <maven.tomcat.update>true</maven.tomcat.update>
      </properties>
    </profile>
  </profiles>

  <activeProfiles>
    <!-- ... -->
    <activeProfile>congo</activeProfile>
  </activeProfiles>

  <!-- ... -->
</settings>

(Replace the username and password with credentials that have access to Tomcat's /manager application, as appropriate.)

Then run mvn tomcat:deploy to deploy CONGO, or mvn tomcat:undeploy to remove CONGO from Tomcat.

For more information, see the plugin documentation for maven-tomcat-plugin.

Running CONGO under Jetty

Run mvn jetty:run. When you're done testing, interrupt the build with Ctrl-C to shut down Jetty.

I want to understand what I'm doing!

Maven describes projects in terms of the artifacts they produce, not the steps involved in getting there. The build behaviour is specified in an XML configuration file at the root of the project named pom.xml, which contains the human-readable and maven-readable names of the project, its version number, the type of artifact being built, any dependencies for the project, and any special plugin configurations needed for the build.

The CONGO POM specifies that the result of the build is a WAR file, with the source, resources, and web content laid out in Maven's standard build structure:

Maven defines a set of standard phases (build steps), any of which will automatically trigger all the preceeding phases. Internally, phases are associated with goals provided by various plugins. There are two important lifecycles (lists of phases):

Each of these phases triggers the preceeding phases: mvn deploy will compile, test, package, and install the project as well.

Lifecycle phases are run using the mvn phase [phase phase ...] command. You can also run specific plugin goals directly, using mvn pluginname:goalname.

TODOs for the build

Retrieved from http://congo.wiki.stonekeep.com/V2/BuildWithMaven
Page last modified on January 16, 2017, at 07:05 PM