you mean that the pom packaging will be set to rpm?

but then, the development env (not deploy) won't work i think..
cause the maven dependencies will look for the jar in the repository.

that way i create a jar which is deployed to the repository (for normal dev
env)  and also an rpm which is used for deployment on production.

i didn't understood your last sentence...

> deps which are type>rpm</type would be the ones which are required


 do you mean to say there is a way for the rpm plugin to auto know it's
dependencies, if they are rpm type?

On Wed, Mar 24, 2010 at 3:39 PM, Stephen Connolly <
stephen.alan.conno...@gmail.com> wrote:

> I think you really want an rpm packaging type then the listed deps which
> are
> type>rpm</type would be the ones which are required
>
> not sure if the plugin supports the above
>
> On 24 March 2010 13:20, eyal edri <eyal.e...@gmail.com> wrote:
>
> > Hi,
> >
> > i'm looking for the best way to auto fill the <require> field in the rpm
> > plugin.
> > since we're using rpm/yum as the deployer of our java apps,
> > i don't want to mange a duplicate set of dependencies in the pom file,
> > in order to do so,  i want to fill the <requires> tag auto from the maven
> > dependencies list in the pom file.
> >
> > for example, the following pom will create an rpm with rpm dependencies
> > similar to the maven ones.
> > (marked in yellow)
> >
> > a few 'rules' needs to be followed:
> > 1. each rpm will always have the same name of the artifactId.
> > 2. each maven dependency will be packed in its own rpm
> >
> > any ideas? (gmaven maybe..)
> >
> > *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.url.miscats</groupId>
> >  <artifactId>Application</artifactId>
> >  <packaging>jar</packaging>
> >  <version>2.0.0-3</version>
> >  <name>Application</name>
> >  <parent>
> >   <artifactId>Parent</artifactId>
> >   <groupId>com.company.maven.pom</groupId>
> >   <version>2.0.0-5</version>
> >  </parent>
> >  <description>the app</description>
> >  <build>
> >    <plugins>
> >      <plugin>
> >        <groupId>org.codehaus.mojo</groupId>
> >        <artifactId>rpm-maven-plugin</artifactId>
> >        <extensions>false</extensions>
> >     <executions>
> >          <execution>
> >            <goals>
> >              <goal>rpm</goal>
> >            </goals>
> >          </execution>
> >     </executions>
> >     <configuration>
> >    <copyright>${project.organization.name}</copyright>
> >            <distribution>XXX</distribution>
> >            <group>Sample/Apps</group>
> >            <packager>${user.name}</packager>
> >             <name>${project.name}</name>
> >             <summary>${project.description}</summary>
> >             <needarch>true</needarch>
> >             <autoRequires>true</autoRequires>
> >             <dependency/>
> >             <requires>
> >             <require>Dep1</require>
> >             <require>Dep2</require>
> >             </requires>
> >             <mappings>
> >             <mapping>
> >               <artifact/>
> >
> > <directory>/usr/lib/java/${project.artifactId}</directory>
> >                       <filemode>750</filemode>
> >                       <username>root</username>
> >                       <groupname>root</groupname>
> >                    </mapping>
> >                    <mapping>
> >                       <directory>/etc/${project.artifactId}</directory>
> >                       <filemode>750</filemode>
> >                       <username>root</username>
> >                       <groupname>root</groupname>
> >                       <sources>
> >                       <source>
> >
> > <location>src/main/resources/App.properties</location>
> >
> > <location>src/main/resources/log4j.properties</location>
> >                       </source>
> >                       </sources>
> >                    </mapping>
> >                    <mapping>
> >                       <directory>/etc/cron.d/</directory>
> >                       <filemode>750</filemode>
> >                       <username>root</username>
> >                       <groupname>root</groupname>
> >                       <sources>
> >                       <source>
> >                       <location>src/main/resources/App.cron</location>
> >                       </source>
> >                       </sources>
> >                    </mapping>
> >                </mappings>
> >                <preinstallScriptlet>
> >                     <script>echo "installing ${artifactId} on arch
> > ${os.arch}"</script>
> >                </preinstallScriptlet>
> >     </configuration>
> >   </plugin>
> >    </plugins>
> >  </build>
> >  <dependencies>
> >   <dependency>
> >   <groupId>com.company.sql</groupId>
> >   <artifactId>Dep1</artifactId>
> >   <version>2.0.0-4</version>
> >   </dependency>
> >   <dependency>
> >   <groupId>com.company.stub</groupId>
> >   <artifactId>Dep2</artifactId>
> >   <version>2.0.0-2</version>
> >   </dependency>
> >  </dependencies>
> > </project>
> >
> > --
> > Eyal Edri
> >
>



-- 
Eyal Edri

Reply via email to