You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by eyal edri <ey...@gmail.com> on 2010/01/17 11:18:10 UTC

using rpm plugin as a deploy tool instead of maven

Hi,

Our IT guys are giving me hard times on installing a second deployment arch
in the production system.
we're using RPM for now.

i want to know if (and how) i can config a project to build an rpm, deploy
it to yum.
then when installing the rpm with yum, it will install all it's dependencies
(from maven repository).

i don't want to manage 2 duplicate dependencies systems (yum + maven).

anyone has experience with the RPM plugin and knows the best way to use it?

thanks.

-- 
Eyal Edri

Re: using rpm plugin as a deploy tool instead of maven

Posted by eyal edri <ey...@gmail.com>.
yea.. i figured it out :)

what i mean is, if i need all the dependencies, i have no other way, no?
what about using the "advanced features" like:


   - provides defines a *virtual package* which is provided by the package
   being built
   - requires identifies a package that is required to be installed for the
   package being built to operate correctly
   - conflicts identifies a package which must not be installed if the
   package being built is installed

do you use those?

another small issue:

i'm using wagon plugin to upload the rpm to the yum repo, but i still need
to run 2 commands via ssh onj the remote server:

1. CREATE REMOTE DIR WITH PKG NAME \
2. RUN make -C /ctcfgroot/ctstable ON REMOTE SERVER

you have an idea how?


*<?xml version="1.0" encoding="utf-8"?>
<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.company.sql</groupId>
  <artifactId>DbUtil</artifactId>
  <packaging>jar</packaging>
  <version>0.0.5</version>
  <name>DbUtil</name>
  <description>DB Utils to Connect to ctch db</description>
  <parent>
    <groupId>com.company.maven.pom</groupId>
    <artifactId>WebSecParent</artifactId>
    <version>0.0.4</version>
  </parent>
  <dependencies>
    <dependency>
      <groupId>com.microsoft.sqlserver.jdbc</groupId>
      <artifactId>sqljdbc</artifactId>
      <version>2.0</version>
    </dependency>
  </dependencies>
  <build>
    <plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>rpm-maven-plugin</artifactId>
        <version>2.0-beta-4</version>
        <executions>
          <execution>
            <goals>
              <goal>rpm</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <copyright>2010, Company</copyright>
          <distribution>Fedora 8</distribution>
          <group>Database/Utils</group>
          <packager>Company Inc</packager>
          <mappings>
            <mapping>
              <directory>/usr/lib/ctch/java</directory>
              <filemode>775</filemode>
              <username>eyale</username>
              <groupname>eyale</groupname>
              <directoryIncluded>true</directoryIncluded>
              <artifact />
              <sources>
                <source>
                  <location>target/*.jar</location>
                  <targetArchitecture>x86</targetArchitecture>
                </source>
              </sources>
              <!-- pack all the dependencies -->
              <dependency />
            </mapping>
          </mappings>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>wagon-maven-plugin</artifactId>
        <version>1.0-beta-3</version>
        <!-- TODO: CREATE REMOTE DIR WITH PKG NAME + RUN make -C
/ctcfgroot/ctstable ON REMOTE SERVER" -->
        <executions>
          <execution>
            <id>upload-rpm</id>
            <phase>deploy</phase>
            <goals>
              <goal>upload</goal>
            </goals>
            <configuration>
              <fromDir>target/rpm/${artifactId}/RPMS/noarch</fromDir>
              <includes>*.rpm</includes>
              <url>scp://yum-server.company.com</url>
              <toDir>/ctcfgroot/ctstable/src/all</toDir>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
    <extensions>
      <extension>
        <groupId>org.apache.maven.wagon</groupId>
        <artifactId>wagon-ssh</artifactId>
        <version>1.0-beta-6</version>
      </extension>
    </extensions>
  </build>
</project>
*
Eyal.

On Sun, Jan 17, 2010 at 4:34 PM, Karl Heinz Marbaise <kh...@gmx.de>wrote:

> Hi,
>
>
>
>>
>> so it means i need a maven repository on development env so it will fetch
>> all the jars to the rpm.
>>
> Yes you need an MVN Repository (may be using an Repository Manager like
> nexus, artifactory, archiva etc.)...
>
>
>  it that the only way to go? (an rpm that includes all the jars in it?)
>>
> No...
>
> You can define the dependencies you include or exclude parts of it, cause
> you used <dependency/> means in other words all dependencies...
> Take a look into the docs of it:
>
> http://mojo.codehaus.org/rpm-maven-plugin/map-params.html#dependency
>
>
>               <!-- pack all the dependencies -->
>>              <dependency />
>>
> As mentioned above, but your comment gives me the impression that you know
> how it works...(or is it just copy&paste)...
>
>
>
> Kind regards
> Karl Heinz Marbaise
> --
> SoftwareEntwicklung Beratung Schulung    Tel.: +49 (0) 2405 / 415 893
> Dipl.Ing.(FH) Karl Heinz Marbaise        ICQ#: 135949029
> Hauptstrasse 177                         USt.IdNr: DE191347579
> 52146 Würselen                           http://www.soebes.de
>



-- 
Eyal Edri

Re: using rpm plugin as a deploy tool instead of maven

Posted by Karl Heinz Marbaise <kh...@gmx.de>.
Hi,

> 
> 
> so it means i need a maven repository on development env so it will 
> fetch all the jars to the rpm.
Yes you need an MVN Repository (may be using an Repository Manager like 
nexus, artifactory, archiva etc.)...

> it that the only way to go? (an rpm that includes all the jars in it?)
No...

You can define the dependencies you include or exclude parts of it, 
cause you used <dependency/> means in other words all dependencies...
Take a look into the docs of it:

http://mojo.codehaus.org/rpm-maven-plugin/map-params.html#dependency

>               <!-- pack all the dependencies -->
>               <dependency />
As mentioned above, but your comment gives me the impression that you 
know how it works...(or is it just copy&paste)...


Kind regards
Karl Heinz Marbaise
-- 
SoftwareEntwicklung Beratung Schulung    Tel.: +49 (0) 2405 / 415 893
Dipl.Ing.(FH) Karl Heinz Marbaise        ICQ#: 135949029
Hauptstrasse 177                         USt.IdNr: DE191347579
52146 Würselen                           http://www.soebes.de

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: using rpm plugin as a deploy tool instead of maven

Posted by eyal edri <ey...@gmail.com>.
i made a little progress.

here's what i done so far:


   1. created a pom configuration with rpm for a DbUtil.jar project (which
   depends on log4j(via parentPom) and sqljdbc).
   2. the rpm created is a FAT rpm, which includes all the jars inside it.

$ rpm -qlp DbUtil-0.0.4-1.noarch.rpm
/usr/lib/ctch/java
/usr/lib/ctch/java/DbUtil.jar
/usr/lib/ctch/java/log4j-1.2.14.jar
/usr/lib/ctch/java/sqljdbc-2.0.jar


so it means i need a maven repository on development env so it will fetch
all the jars to the rpm.

it that the only way to go? (an rpm that includes all the jars in it?)





here's the pom:

<?xml version="1.0" encoding="utf-8"?>
<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.company.sql</groupId>
  <artifactId>DbUtil</artifactId>
  <packaging>jar</packaging>
  <version>0.0.4</version>
  <name>DbUtil</name>
  <description>DB Utils to Connect to ctch db</description>
  <parent>
    <groupId>com.company.maven.pom</groupId>
    <artifactId>WebSecParent</artifactId>
    <version>0.0.4</version>
  </parent>
  <dependencies>
    <dependency>
      <groupId>com.microsoft.sqlserver.jdbc</groupId>
      <artifactId>sqljdbc</artifactId>
      <version>2.0</version>
    </dependency>
  </dependencies>
  <build>
    <plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>rpm-maven-plugin</artifactId>
        <version>2.0-beta-4</version>
        <configuration>
          <copyright>2010, Company</copyright>
          <distribution>Fedora 8</distribution>
          <group>Database/Utils</group>
          <packager>Company Inc</packager>
          <mappings>
            <mapping>
              <directory>/usr/lib/ctch/java</directory>
              <filemode>775</filemode>
              <username>eyale</username>
              <groupname>eyale</groupname>
              <directoryIncluded>true</directoryIncluded>
              <sources>
                <source>
                  <location>target/DbUtil.jar</location>
                </source>
              </sources>
              <!-- pack all the dependencies -->
              <dependency />
            </mapping>
          </mappings>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>


On Sun, Jan 17, 2010 at 2:43 PM, Karl Heinz Marbaise <kh...@gmx.de>wrote:

> Hi,
>
> I'm working currently with RPM plugin (
> http://mojo.codehaus.org/rpm-maven-plugin/) and working in relationship
> with RPM's and creating dependencies between the RPM's and deploying
> RPM's...
>
>
>  Hi,
>>
>> Our IT guys are giving me hard times on installing a second deployment
>> arch
>> in the production system.
>> we're using RPM for now.
>>
>> i want to know if (and how) i can config a project to build an rpm, deploy
>> it to yum.
>> then when installing the rpm with yum, it will install all it's
>> dependencies
>> (from maven repository).
>>
>> i don't want to manage 2 duplicate dependencies systems (yum + maven).
>>
>> anyone has experience with the RPM plugin and knows the best way to use
>> it?
>>
>>  May be you can explain your needs a litte bit more specific and i can see
> if i can help...
>
> Kind regards
> Karl Heinz Marbaise
> --
> SoftwareEntwicklung Beratung Schulung    Tel.: +49 (0) 2405 / 415 893
> Dipl.Ing.(FH) Karl Heinz Marbaise        ICQ#: 135949029
> Hauptstrasse 177                         USt.IdNr: DE191347579
> 52146 Würselen                           http://www.soebes.de
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


-- 
Eyal Edri

Re: using rpm plugin as a deploy tool instead of maven

Posted by Karl Heinz Marbaise <kh...@gmx.de>.
Hi,

I'm working currently with RPM plugin 
(http://mojo.codehaus.org/rpm-maven-plugin/) and working in relationship 
with RPM's and creating dependencies between the RPM's and deploying 
RPM's...

> Hi,
> 
> Our IT guys are giving me hard times on installing a second deployment arch
> in the production system.
> we're using RPM for now.
> 
> i want to know if (and how) i can config a project to build an rpm, deploy
> it to yum.
> then when installing the rpm with yum, it will install all it's dependencies
> (from maven repository).
> 
> i don't want to manage 2 duplicate dependencies systems (yum + maven).
> 
> anyone has experience with the RPM plugin and knows the best way to use it?
> 
May be you can explain your needs a litte bit more specific and i can 
see if i can help...

Kind regards
Karl Heinz Marbaise
-- 
SoftwareEntwicklung Beratung Schulung    Tel.: +49 (0) 2405 / 415 893
Dipl.Ing.(FH) Karl Heinz Marbaise        ICQ#: 135949029
Hauptstrasse 177                         USt.IdNr: DE191347579
52146 Würselen                           http://www.soebes.de

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org