You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Karan Malhi <ka...@gmail.com> on 2007/06/08 12:34:17 UTC

filtering issues in assembly plugin

I have a module named assembly. I am using the assembly plugin 2.1 .
if i run maven from the parent project, then resources are not
filtered. if i run maven from the assembly module itself, resources
are filtered properly.
Any ideas why this would be happening?

-- 
Karan Malhi

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


Re: filtering issues in assembly plugin

Posted by Karan Malhi <ka...@gmail.com>.
John,

I forgot to mention that for the
/openejb3/assembly/openejb-standalone/src/main/assembly/bin.xml file,
I have also tried by adding the filter element (and set it to true)
for the fileSet element, (sample given below)

   <fileSet>
     <directory>src/main/resources/</directory>
     <outputDirectory>bin/</outputDirectory>
     <includes>
       <include>*.bat</include>
     </includes>
     <lineEnding>dos</lineEnding>
     <fileMode>0755</fileMode>
<filtered>true</filtered>
   </fileSet>
   <fileSet>


On 6/17/07, Karan Malhi <ka...@gmail.com> wrote:
> John,
>
> I am not sure about how much of information you need, but will try my
> best to explain the problem and provide the neccessary sections of the
> pom.xml files
>
> The project structure is as follows:
> d:\openejb3
>           |--------pom.xml
>           |-------assembly
>                      |--------pom.xml
>                      |--------openejb-standalone
>                                         |--------------pom.xml
>                                         |--------------src
>                                                         |---------main
>
> |--------resources
>
> |--------assembly
>
>             |-----------bin.xml
>
>
> => Here is a section of /openejb3/pom.xml
>
>   <modules>
>     <module>itests</module>
>     <module>container</module>
>     <module>server</module>
>     <module>examples</module>
>   </modules>
>
>   <profiles>
>     <profile>
>       <id>assemble</id>
>       <activation>
>         <property>
>           <name>assemble</name>
>         </property>
>       </activation>
>       <modules>
>         <module>assembly</module>
>       </modules>
>     </profile>
>   </profiles>
>
> => below is /openejb3/assembly/pom.xml
>
> <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">
>   <parent>
>     <artifactId>openejb</artifactId>
>     <groupId>org.apache.openejb</groupId>
>     <version>3.0.0-SNAPSHOT</version>
>   </parent>
>   <modelVersion>4.0.0</modelVersion>
>   <artifactId>assembly</artifactId>
>   <packaging>pom</packaging>
>   <name>OpenEJB :: Assembly</name>
>
>   <modules>
>     <module>openejb-itests-webapp</module>
>     <module>openejb-standalone</module>
>     <module>openejb-tomcat</module>
>   </modules>
> </project>
>
> => below is openejb3/assembly/openejb-standalone/pom.xml
>
> <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">
>   <parent>
>     <artifactId>assembly</artifactId>
>     <groupId>org.apache.openejb</groupId>
>     <version>3.0.0-SNAPSHOT</version>
>   </parent>
>   <modelVersion>4.0.0</modelVersion>
>   <artifactId>openejb-standalone</artifactId>
>   <packaging>pom</packaging>
>   <name>OpenEJB :: Assembly :: Standalone</name>
>   <build>
>     <resources>
>       <resource>
>         <directory>src/main/resources</directory>
>         <filtering>true</filtering>
>       </resource>
>     </resources>
>     <plugins>
>       <plugin>
>         <artifactId>maven-assembly-plugin</artifactId>
>         <version>2.1</version>
>         <executions>
>           <execution>
>             <id>assembly-bin-distributions</id>
>             <phase>package</phase>
>             <goals>
>                     <goal>attached</goal>
>
>             </goals>
>           </execution>
>         </executions>
>         <configuration>
>           <descriptors>
>             <descriptor>src/main/assembly/bin.xml</descriptor>
>           </descriptors>
>           <archive>
>             <manifest>
>               <mainClass>org.apache.openejb.test.Main</mainClass>
>             </manifest>
>           </archive>
>           <finalName>openejb-${pom.version}</finalName>
>         </configuration>
>       </plugin>
>     </plugins>
>   </build>
>
> => below is /openejb3/assembly/openejb-standalone/src/main/assembly/bin.xml
>
> <assembly>
>   <id>bin</id>
>   <formats>
>     <format>tar.gz</format>
>     <!--<format>tar.bz2</format>-->
>     <format>zip</format>
>   </formats>
>   <fileSets>
>     <fileSet>
>       <includes>
>         <include>README*</include>
>         <include>LICENSE.txt</include>
>         <include>NOTICE.txt</include>
>       </includes>
>     </fileSet>
>     <fileSet>
>       <directory>src/main/resources/</directory>
>       <outputDirectory>bin/</outputDirectory>
>       <includes>
>         <include>*.bat</include>
>       </includes>
>       <lineEnding>dos</lineEnding>
>       <fileMode>0755</fileMode>
>     </fileSet>
>     <fileSet>
>       <directory>src/main/resources/</directory>
>       <outputDirectory>bin/</outputDirectory>
>       <includes>
>         <include>openejb</include>
>       </includes>
>       <lineEnding>unix</lineEnding>
>       <fileMode>0755</fileMode>
>     </fileSet>
>     <fileSet>
>       <directory>src/main/conf</directory>
>       <outputDirectory>conf/</outputDirectory>
>     </fileSet>
>     <fileSet>
>       <directory>target/classes/empty</directory>
>       <outputDirectory>logs/</outputDirectory>
>     </fileSet>
>     <fileSet>
>       <directory>target/classes/empty</directory>
>       <outputDirectory>beans/</outputDirectory>
>     </fileSet>
>   </fileSets>
>   <dependencySets>
>     <dependencySet>
>       <outputFileNameMapping>${artifactId}-${version}.${extension}</outputFileNameMapping>
>       <outputDirectory>lib</outputDirectory>
>       <scope>runtime</scope>
>       <excludes>
>           <exclude>junit:junit</exclude>
>       </excludes>
>     </dependencySet>
>   </dependencySets>
> </assembly>
> On 6/16/07, John Casey <jd...@commonjava.org> wrote:
> > Are you guys using the filtering configuration for the normal
> > resources-plugin part of the build, or something else?
> >
> > Can you provide a couple of example project to demonstrate?
> >
> > Thanks,
> >
> > -john
> >
> >
> > On Jun 14, 2007, at 9:15 AM, Jim Crossley wrote:
> >
> > > I see this, too, though I don't know why.  The previous version used
> > > to work.
> > >
> > > I guess I second the nudge.  :-)
> > >
> > > Jim
> > >
> > > "Karan Malhi" <ka...@gmail.com> writes:
> > >
> > >> **--nudge--**
> > >>
> > >> On 6/8/07, Karan Malhi <ka...@gmail.com> wrote:
> > >>> I have a module named assembly. I am using the assembly plugin 2.1 .
> > >>> if i run maven from the parent project, then resources are not
> > >>> filtered. if i run maven from the assembly module itself, resources
> > >>> are filtered properly.
> > >>> Any ideas why this would be happening?
> > >>>
> > >>> --
> > >>> Karan Malhi
> > >>>
> > >>
> > >>
> > >> --
> > >> Karan Malhi
> > >>
> > >> ---------------------------------------------------------------------
> > >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > >> For additional commands, e-mail: users-help@maven.apache.org
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > > For additional commands, e-mail: users-help@maven.apache.org
> > >
> >
> > ---
> > John Casey
> > Committer and PMC Member, Apache Maven
> > mail: jdcasey at commonjava dot org
> > blog: http://www.ejlife.net/blogs/john
> >
> >
> >
>
>
> --
> Karan Malhi
>


-- 
Karan Malhi

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


Re: filtering issues in assembly plugin

Posted by Karan Malhi <ka...@gmail.com>.
John,

I am not sure about how much of information you need, but will try my
best to explain the problem and provide the neccessary sections of the
pom.xml files

The project structure is as follows:
d:\openejb3
          |--------pom.xml
          |-------assembly
                     |--------pom.xml
                     |--------openejb-standalone
                                        |--------------pom.xml
                                        |--------------src
                                                        |---------main

|--------resources

|--------assembly

            |-----------bin.xml


=> Here is a section of /openejb3/pom.xml

  <modules>
    <module>itests</module>
    <module>container</module>
    <module>server</module>
    <module>examples</module>
  </modules>

  <profiles>
    <profile>
      <id>assemble</id>
      <activation>
        <property>
          <name>assemble</name>
        </property>
      </activation>
      <modules>
        <module>assembly</module>
      </modules>
    </profile>
  </profiles>

=> below is /openejb3/assembly/pom.xml

<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">
  <parent>
    <artifactId>openejb</artifactId>
    <groupId>org.apache.openejb</groupId>
    <version>3.0.0-SNAPSHOT</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>
  <artifactId>assembly</artifactId>
  <packaging>pom</packaging>
  <name>OpenEJB :: Assembly</name>

  <modules>
    <module>openejb-itests-webapp</module>
    <module>openejb-standalone</module>
    <module>openejb-tomcat</module>
  </modules>
</project>

=> below is openejb3/assembly/openejb-standalone/pom.xml

<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">
  <parent>
    <artifactId>assembly</artifactId>
    <groupId>org.apache.openejb</groupId>
    <version>3.0.0-SNAPSHOT</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>
  <artifactId>openejb-standalone</artifactId>
  <packaging>pom</packaging>
  <name>OpenEJB :: Assembly :: Standalone</name>
  <build>
    <resources>
      <resource>
        <directory>src/main/resources</directory>
        <filtering>true</filtering>
      </resource>
    </resources>
    <plugins>
      <plugin>
        <artifactId>maven-assembly-plugin</artifactId>
        <version>2.1</version>
        <executions>
          <execution>
            <id>assembly-bin-distributions</id>
	    <phase>package</phase>
	    <goals>
		    <goal>attached</goal>
		
            </goals>
          </execution>
        </executions>
        <configuration>
          <descriptors>
            <descriptor>src/main/assembly/bin.xml</descriptor>
          </descriptors>
          <archive>
            <manifest>
              <mainClass>org.apache.openejb.test.Main</mainClass>
            </manifest>
          </archive>
          <finalName>openejb-${pom.version}</finalName>
        </configuration>
      </plugin>
    </plugins>
  </build>

=> below is /openejb3/assembly/openejb-standalone/src/main/assembly/bin.xml

<assembly>
  <id>bin</id>
  <formats>
    <format>tar.gz</format>
    <!--<format>tar.bz2</format>-->
    <format>zip</format>
  </formats>
  <fileSets>
    <fileSet>
      <includes>
        <include>README*</include>
        <include>LICENSE.txt</include>
        <include>NOTICE.txt</include>
      </includes>
    </fileSet>
    <fileSet>
      <directory>src/main/resources/</directory>
      <outputDirectory>bin/</outputDirectory>
      <includes>
        <include>*.bat</include>
      </includes>
      <lineEnding>dos</lineEnding>
      <fileMode>0755</fileMode>
    </fileSet>
    <fileSet>
      <directory>src/main/resources/</directory>
      <outputDirectory>bin/</outputDirectory>
      <includes>
        <include>openejb</include>
      </includes>
      <lineEnding>unix</lineEnding>
      <fileMode>0755</fileMode>
    </fileSet>
    <fileSet>
      <directory>src/main/conf</directory>
      <outputDirectory>conf/</outputDirectory>
    </fileSet>
    <fileSet>
      <directory>target/classes/empty</directory>
      <outputDirectory>logs/</outputDirectory>
    </fileSet>
    <fileSet>
      <directory>target/classes/empty</directory>
      <outputDirectory>beans/</outputDirectory>
    </fileSet>
  </fileSets>
  <dependencySets>
    <dependencySet>
      <outputFileNameMapping>${artifactId}-${version}.${extension}</outputFileNameMapping>
      <outputDirectory>lib</outputDirectory>
      <scope>runtime</scope>
      <excludes>
          <exclude>junit:junit</exclude>
      </excludes>
    </dependencySet>
  </dependencySets>
</assembly>
On 6/16/07, John Casey <jd...@commonjava.org> wrote:
> Are you guys using the filtering configuration for the normal
> resources-plugin part of the build, or something else?
>
> Can you provide a couple of example project to demonstrate?
>
> Thanks,
>
> -john
>
>
> On Jun 14, 2007, at 9:15 AM, Jim Crossley wrote:
>
> > I see this, too, though I don't know why.  The previous version used
> > to work.
> >
> > I guess I second the nudge.  :-)
> >
> > Jim
> >
> > "Karan Malhi" <ka...@gmail.com> writes:
> >
> >> **--nudge--**
> >>
> >> On 6/8/07, Karan Malhi <ka...@gmail.com> wrote:
> >>> I have a module named assembly. I am using the assembly plugin 2.1 .
> >>> if i run maven from the parent project, then resources are not
> >>> filtered. if i run maven from the assembly module itself, resources
> >>> are filtered properly.
> >>> Any ideas why this would be happening?
> >>>
> >>> --
> >>> Karan Malhi
> >>>
> >>
> >>
> >> --
> >> Karan Malhi
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >> For additional commands, e-mail: users-help@maven.apache.org
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
>
> ---
> John Casey
> Committer and PMC Member, Apache Maven
> mail: jdcasey at commonjava dot org
> blog: http://www.ejlife.net/blogs/john
>
>
>


-- 
Karan Malhi

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


Re: filtering issues in assembly plugin

Posted by Karan Malhi <ka...@gmail.com>.
John,

Found a workaround for it.
I added the maven-resources-plugin to the build as below:

      <plugin>
        <artifactId>maven-resources-plugin</artifactId>
        <executions>
          <execution>
            <id>filter-resources</id>
            <phase>package</phase>
            <goals>
              <goal>resources</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-assembly-plugin</artifactId>
        <version>2.1</version>
        <executions>
          <execution>
            <id>assembly-bin-distributions</id>
            <phase>package</phase>
            <goals>
              <goal>attached</goal>
            </goals>
          </execution>
        </executions>

This way in the package phase , i was able to filter resources first
and then execute the assembly plugin. I didnt even had to specify
filtered element in the fileset element in the assembly descriptor.
minor changes in assembly descriptor allowed me to package the
assembly with filtered resources :)

On 18 Jun 2007 11:58:55 -0400, Jim Crossley <ji...@crossleys.org> wrote:
> Hi John...
>
> John Casey <jd...@commonjava.org> writes:
>
> > Can you provide a couple of example project to demonstrate?
>
> Yes.  I opened a new bug and attached a simple example project
> demonstrating the problem:
> http://jira.codehaus.org/browse/MASSEMBLY-221
>
> The problem stems from when a subset of files in a <fileSet> require
> filtering.  Because the <fileSet> element doesn't yet support
> filtering, additional <file> elements are required.  In 2.1, this was
> a valid workaround.  The workaround is broken in 2.2.
>
> Thanks,
> Jim
>
> >
> > Thanks,
> >
> > -john
> >
> >
> > On Jun 14, 2007, at 9:15 AM, Jim Crossley wrote:
> >
> > > I see this, too, though I don't know why.  The previous version used
> > > to work.
> > >
> > > I guess I second the nudge.  :-)
> > >
> > > Jim
> > >
> > > "Karan Malhi" <ka...@gmail.com> writes:
> > >
> > >> **--nudge--**
> > >>
> > >> On 6/8/07, Karan Malhi <ka...@gmail.com> wrote:
> > >>> I have a module named assembly. I am using the assembly plugin 2.1 .
> > >>> if i run maven from the parent project, then resources are not
> > >>> filtered. if i run maven from the assembly module itself, resources
> > >>> are filtered properly.
> > >>> Any ideas why this would be happening?
> > >>>
> > >>> --
> > >>> Karan Malhi
> > >>>
> > >>
> > >>
> > >> --
> > >> Karan Malhi
> > >>
> > >> ---------------------------------------------------------------------
> > >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > >> For additional commands, e-mail: users-help@maven.apache.org
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > > For additional commands, e-mail: users-help@maven.apache.org
> > >
> >
> > ---
> > John Casey
> > Committer and PMC Member, Apache Maven
> > mail: jdcasey at commonjava dot org
> > blog: http://www.ejlife.net/blogs/john
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


-- 
Karan Malhi

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


Re: filtering issues in assembly plugin

Posted by Jim Crossley <ji...@crossleys.org>.
Hi John...

John Casey <jd...@commonjava.org> writes:

> Can you provide a couple of example project to demonstrate?

Yes.  I opened a new bug and attached a simple example project
demonstrating the problem:
http://jira.codehaus.org/browse/MASSEMBLY-221

The problem stems from when a subset of files in a <fileSet> require
filtering.  Because the <fileSet> element doesn't yet support
filtering, additional <file> elements are required.  In 2.1, this was
a valid workaround.  The workaround is broken in 2.2.

Thanks,
Jim

> 
> Thanks,
> 
> -john
> 
> 
> On Jun 14, 2007, at 9:15 AM, Jim Crossley wrote:
> 
> > I see this, too, though I don't know why.  The previous version used
> > to work.
> >
> > I guess I second the nudge.  :-)
> >
> > Jim
> >
> > "Karan Malhi" <ka...@gmail.com> writes:
> >
> >> **--nudge--**
> >>
> >> On 6/8/07, Karan Malhi <ka...@gmail.com> wrote:
> >>> I have a module named assembly. I am using the assembly plugin 2.1 .
> >>> if i run maven from the parent project, then resources are not
> >>> filtered. if i run maven from the assembly module itself, resources
> >>> are filtered properly.
> >>> Any ideas why this would be happening?
> >>>
> >>> --
> >>> Karan Malhi
> >>>
> >>
> >>
> >> -- 
> >> Karan Malhi
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >> For additional commands, e-mail: users-help@maven.apache.org
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> 
> ---
> John Casey
> Committer and PMC Member, Apache Maven
> mail: jdcasey at commonjava dot org
> blog: http://www.ejlife.net/blogs/john

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


Re: filtering issues in assembly plugin

Posted by John Casey <jd...@commonjava.org>.
Are you guys using the filtering configuration for the normal  
resources-plugin part of the build, or something else?

Can you provide a couple of example project to demonstrate?

Thanks,

-john


On Jun 14, 2007, at 9:15 AM, Jim Crossley wrote:

> I see this, too, though I don't know why.  The previous version used
> to work.
>
> I guess I second the nudge.  :-)
>
> Jim
>
> "Karan Malhi" <ka...@gmail.com> writes:
>
>> **--nudge--**
>>
>> On 6/8/07, Karan Malhi <ka...@gmail.com> wrote:
>>> I have a module named assembly. I am using the assembly plugin 2.1 .
>>> if i run maven from the parent project, then resources are not
>>> filtered. if i run maven from the assembly module itself, resources
>>> are filtered properly.
>>> Any ideas why this would be happening?
>>>
>>> --
>>> Karan Malhi
>>>
>>
>>
>> -- 
>> Karan Malhi
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>

---
John Casey
Committer and PMC Member, Apache Maven
mail: jdcasey at commonjava dot org
blog: http://www.ejlife.net/blogs/john



Re: filtering issues in assembly plugin

Posted by Jim Crossley <ji...@crossleys.org>.
I see this, too, though I don't know why.  The previous version used
to work.

I guess I second the nudge.  :-)

Jim

"Karan Malhi" <ka...@gmail.com> writes:

> **--nudge--**
> 
> On 6/8/07, Karan Malhi <ka...@gmail.com> wrote:
> > I have a module named assembly. I am using the assembly plugin 2.1 .
> > if i run maven from the parent project, then resources are not
> > filtered. if i run maven from the assembly module itself, resources
> > are filtered properly.
> > Any ideas why this would be happening?
> >
> > --
> > Karan Malhi
> >
> 
> 
> -- 
> Karan Malhi
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org

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


Re: filtering issues in assembly plugin

Posted by Karan Malhi <ka...@gmail.com>.
**--nudge--**

On 6/8/07, Karan Malhi <ka...@gmail.com> wrote:
> I have a module named assembly. I am using the assembly plugin 2.1 .
> if i run maven from the parent project, then resources are not
> filtered. if i run maven from the assembly module itself, resources
> are filtered properly.
> Any ideas why this would be happening?
>
> --
> Karan Malhi
>


-- 
Karan Malhi

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