maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eyal edri <eyal.e...@gmail.com>
Subject install java app on production server
Date Sun, 15 Nov 2009 15:58:47 GMT
Hi,

i'm kind of new to maven and still trying to figure out the right way to do
things.
i've already set up a local repository accesibale via http/scp.

and configured some resources such as conf/cron files.

my question is, what is the best way to actually 'install' an application
after it's deployed to the repository.

i'm aiming at something similar to 'yum install' (i'm guessing we won't need
yum/rpm anymore after moving to maven).

i'll probably need to install maven on the production server, right?

and create my own archetype? since 'mvn install' installs the pkg to the
repository and not actually "installs" it to the fs.

how do i tell the mvn to put the jar file in it's bin dir? it doesnt seem
right to config it as a resource as well...

*here's my pom.xml so far:*

<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.test.url</groupId>
  <artifactId>IncreasePriority</artifactId>
  <packaging>jar</packaging>
  <version>1.00.0000</version>
  <name>IncreasePriority</name>
  <url>http://maven.apache.org</url>
  <organization>
      <name>Test</name>
      <url>http://www.test.com</url>
  </organization>
  <build>
      <plugins>
       <plugin>
        <artifactId>maven-resources-plugin</artifactId>
        <version>2.4.1</version>
      *  <executions>
          <execution>
            <id>copy-conf</id>
            <!-- here the phase you need -->
            <phase>install</phase>
            <goals>
              <goal>copy-resources</goal>
            </goals>
            <configuration>

<outputDirectory>/etc/ct-urlf-increase-priority/</outputDirectory>
              <resources>
                <resource>
                  <directory>src/main/resources/conf</directory>
                </resource>
              </resources>
            </configuration>
          </execution>
            <execution>
            <id>copy-cron</id>
            <!-- here the phase you need -->
            <phase>install</phase>
            <goals>
              <goal>copy-resources</goal>
            </goals>
            <configuration>
              <outputDirectory>/etc/cron.d/</outputDirectory>
              <resources>
                <resource>
                  <directory>src/main/resources/cron</directory>
                </resource>
              </resources>
            </configuration>
          </execution>
        </executions>*
      </plugin>
    </plugins>
  </build>
  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>log4j</groupId>
        <artifactId>log4j</artifactId>
        <version>1.2.14</version>
        <type>jar</type>
        <scope>compile</scope>
    </dependency>
  </dependencies>
  <properties>
      <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>
  <repositories>
    <repository>
      <id>ctch</id>
      <url>http://localhost:8081/nexus/content/repositories/ctch/</url>
    </repository>
  </repositories>
</project>


the 'cron' file has the the line:

* */1 * * * root  java -jar
/usr/local/ct-urlf-increase-priority/increase-priority.jar
/etc/ct-urlf-increase-priority/increase-priority.properties


-- 
Eyal Edri

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message