You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by amit kumar <am...@gmail.com> on 2008/01/10 13:10:35 UTC

Excluding files from JAR

HI,
Just like WAR can I as well exclude some files from JAR builds as well?

I have used this, but not working.

  </plugin>
    <plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-jar-plugin</artifactId>
  <version>2.1</version>
  <executions>
       <execution>
          <goals>
             <goal>jar</goal>
        </goals>
       </execution>
    </executions>
    <configuration>
        <excludes>**/*.xsd</excludes>
           <schemaDirectory>src/schema/xsd</schemaDirectory>
    </configuration>
  </plugin>

Am I missing something?

Amit

Re: Excluding files from JAR

Posted by amit kumar <am...@gmail.com>.
Hi,
Sorry for incomplete information about the problem. I used <delete> task ,
and it is working now.
Did not try the snapshot jar plugin yet.

Thanks and regards,
Amit Kumar

On Jan 11, 2008 5:46 AM, Wayne Fay <wa...@gmail.com> wrote:

> I don't think Simon is telling you to use Ant's jar command -- instead
> he is suggesting that you use Ant's <delete> task to physically remove
> the unwanted files out of /target/ before allowing Maven to do its own
> packaging step. (Right, Simon?) You would probably want to bind this
> to prepare-package as you have done below.
>
> Here's the Ant Delete task page:
> http://ant.apache.org/manual/CoreTasks/delete.html
>
> Also, you should be using -X to get full debugging information. And if
> it "doesn't work" this time, please reply back with a lot more details
> about what exactly happened when you tried this eg what errors were
> reported, what seemed to happen, etc. Simply saying "it didn't work"
> tells us absolutely nothing about what actually happened vs what you
> were expecting etc.
>
> Wayne
>
> On 1/10/08, amit kumar <am...@gmail.com> wrote:
> > Hi Simon,
> > Being totally unaware of ANT although I tried but of no use.
> > I used this with google's help
> >
> >  <plugin>
> >        <artifactId>maven-antrun-plugin</artifactId>
> >            <executions>
> >                  <execution>
> >                        <phase>prepare-package</phase>
> >                        <configuration>
> >                         <tasks>
> > <target name="jar-file" depends="compile-src,copy">
> > <jar destfile="${root}/target/file.jar" basedir="${build}"
> > excludes="*.xsd,*.xsb" />
> >                         </target>
> >                         </tasks>
> >                        </configuration>
> >                        <goals>
> >                          <goal>run</goal>
> >                        </goals>
> >                      </execution>
> >            </executions>
> >      </plugin>
> >
> >
> > Where am I lacking?
> >
> >
> > Regards,
> > Amit
> >
> > On Jan 10, 2008 9:45 PM, amit kumar <am...@gmail.com> wrote:
> >
> > > Hi,
> > > I have downloaded the patches from the link mentioned by you. But I
> don't
> > > know how to apply them.
> > >
> > > regards,
> > > Amit
> > >
> > >
> > > On Jan 10, 2008 6:29 PM, Olivier Lamy < olamy@apache.org> wrote:
> > >
> > > > Hi,
> > > > No you don't miss something here.
> > > > It's a know issue [1] and it's fixed in trunk.
> > > > You can try last snapshot to test the fix.
> > > >
> > > > --
> > > > Olivier
> > > > [1] http://jira.codehaus.org/browse/MJAR-30
> > > >
> > > > 2008/1/10, amit kumar < amit.kumar97400@gmail.com>:
> > > > > HI,
> > > > > Just like WAR can I as well exclude some files from JAR builds as
> > > > well?
> > > > >
> > > > > I have used this, but not working.
> > > > >
> > > > >   </plugin>
> > > > >     <plugin>
> > > > >   <groupId>org.apache.maven.plugins</groupId>
> > > > >   <artifactId>maven-jar-plugin</artifactId>
> > > > >   <version>2.1</version>
> > > > >   <executions>
> > > > >        <execution>
> > > > >           <goals>
> > > > >              <goal>jar</goal>
> > > > >         </goals>
> > > > >        </execution>
> > > > >     </executions>
> > > > >     <configuration>
> > > > >         <excludes>**/*.xsd</excludes>
> > > > >            <schemaDirectory>src/schema/xsd</schemaDirectory>
> > > > >     </configuration>
> > > > >   </plugin>
> > > > >
> > > > > Am I missing something?
> > > > >
> > > > > Amit
> > > > >
> > > >
> > > >
> ---------------------------------------------------------------------
> > > > 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: Excluding files from JAR

Posted by Wayne Fay <wa...@gmail.com>.
I don't think Simon is telling you to use Ant's jar command -- instead
he is suggesting that you use Ant's <delete> task to physically remove
the unwanted files out of /target/ before allowing Maven to do its own
packaging step. (Right, Simon?) You would probably want to bind this
to prepare-package as you have done below.

Here's the Ant Delete task page:
http://ant.apache.org/manual/CoreTasks/delete.html

Also, you should be using -X to get full debugging information. And if
it "doesn't work" this time, please reply back with a lot more details
about what exactly happened when you tried this eg what errors were
reported, what seemed to happen, etc. Simply saying "it didn't work"
tells us absolutely nothing about what actually happened vs what you
were expecting etc.

Wayne

On 1/10/08, amit kumar <am...@gmail.com> wrote:
> Hi Simon,
> Being totally unaware of ANT although I tried but of no use.
> I used this with google's help
>
>  <plugin>
>        <artifactId>maven-antrun-plugin</artifactId>
>            <executions>
>                  <execution>
>                        <phase>prepare-package</phase>
>                        <configuration>
>                         <tasks>
> <target name="jar-file" depends="compile-src,copy">
> <jar destfile="${root}/target/file.jar" basedir="${build}"
> excludes="*.xsd,*.xsb" />
>                         </target>
>                         </tasks>
>                        </configuration>
>                        <goals>
>                          <goal>run</goal>
>                        </goals>
>                      </execution>
>            </executions>
>      </plugin>
>
>
> Where am I lacking?
>
>
> Regards,
> Amit
>
> On Jan 10, 2008 9:45 PM, amit kumar <am...@gmail.com> wrote:
>
> > Hi,
> > I have downloaded the patches from the link mentioned by you. But I don't
> > know how to apply them.
> >
> > regards,
> > Amit
> >
> >
> > On Jan 10, 2008 6:29 PM, Olivier Lamy < olamy@apache.org> wrote:
> >
> > > Hi,
> > > No you don't miss something here.
> > > It's a know issue [1] and it's fixed in trunk.
> > > You can try last snapshot to test the fix.
> > >
> > > --
> > > Olivier
> > > [1] http://jira.codehaus.org/browse/MJAR-30
> > >
> > > 2008/1/10, amit kumar < amit.kumar97400@gmail.com>:
> > > > HI,
> > > > Just like WAR can I as well exclude some files from JAR builds as
> > > well?
> > > >
> > > > I have used this, but not working.
> > > >
> > > >   </plugin>
> > > >     <plugin>
> > > >   <groupId>org.apache.maven.plugins</groupId>
> > > >   <artifactId>maven-jar-plugin</artifactId>
> > > >   <version>2.1</version>
> > > >   <executions>
> > > >        <execution>
> > > >           <goals>
> > > >              <goal>jar</goal>
> > > >         </goals>
> > > >        </execution>
> > > >     </executions>
> > > >     <configuration>
> > > >         <excludes>**/*.xsd</excludes>
> > > >            <schemaDirectory>src/schema/xsd</schemaDirectory>
> > > >     </configuration>
> > > >   </plugin>
> > > >
> > > > Am I missing something?
> > > >
> > > > Amit
> > > >
> > >
> > > ---------------------------------------------------------------------
> > > 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: Excluding files from JAR

Posted by amit kumar <am...@gmail.com>.
Hi Simon,
Being totally unaware of ANT although I tried but of no use.
I used this with google's help

  <plugin>
        <artifactId>maven-antrun-plugin</artifactId>
            <executions>
                  <execution>
                        <phase>prepare-package</phase>
                        <configuration>
                         <tasks>
<target name="jar-file" depends="compile-src,copy">
<jar destfile="${root}/target/file.jar" basedir="${build}"
excludes="*.xsd,*.xsb" />
                         </target>
                         </tasks>
                        </configuration>
                        <goals>
                          <goal>run</goal>
                        </goals>
                      </execution>
            </executions>
      </plugin>


Where am I lacking?


Regards,
Amit

On Jan 10, 2008 9:45 PM, amit kumar <am...@gmail.com> wrote:

> Hi,
> I have downloaded the patches from the link mentioned by you. But I don't
> know how to apply them.
>
> regards,
> Amit
>
>
> On Jan 10, 2008 6:29 PM, Olivier Lamy < olamy@apache.org> wrote:
>
> > Hi,
> > No you don't miss something here.
> > It's a know issue [1] and it's fixed in trunk.
> > You can try last snapshot to test the fix.
> >
> > --
> > Olivier
> > [1] http://jira.codehaus.org/browse/MJAR-30
> >
> > 2008/1/10, amit kumar < amit.kumar97400@gmail.com>:
> > > HI,
> > > Just like WAR can I as well exclude some files from JAR builds as
> > well?
> > >
> > > I have used this, but not working.
> > >
> > >   </plugin>
> > >     <plugin>
> > >   <groupId>org.apache.maven.plugins</groupId>
> > >   <artifactId>maven-jar-plugin</artifactId>
> > >   <version>2.1</version>
> > >   <executions>
> > >        <execution>
> > >           <goals>
> > >              <goal>jar</goal>
> > >         </goals>
> > >        </execution>
> > >     </executions>
> > >     <configuration>
> > >         <excludes>**/*.xsd</excludes>
> > >            <schemaDirectory>src/schema/xsd</schemaDirectory>
> > >     </configuration>
> > >   </plugin>
> > >
> > > Am I missing something?
> > >
> > > Amit
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
>

Re: Excluding files from JAR with maven-jar-plugin 2.2-SNAPSHOT failed

Posted by Dennis Lundberg <de...@apache.org>.
The excludes configuration is a set of things to exclude. It needs to be 
configured like this:

<excludes>
   <exclude>**/*.xsd</exclude>
</excludes>


supareno wrote:
> Hello guys
> 
> i read the previous threads about exclusion with interest
> because i am always confronted with the "excludes" problem
> 
> i followed all the steps:
> changed my settings.xml to enable snapshot plugin repositories...
> (http://maven.apache.org/guides/development/guide-plugin-snapshot-repositories.html) 
> 
> everything is working except the "excludes" tag
> 
> my pom.xml looks like this:
> 
> ...
>        <plugin>
>            <groupId>org.apache.maven.plugins</groupId>
>            <artifactId>maven-jar-plugin</artifactId>
>            <version>2.2-SNAPSHOT</version>
>            <executions>
>                <execution>
>                    <goals>
>                        <goal>jar</goal>
>                    </goals>
>                    <configuration>
>                           <excludes>**/*.xsd</excludes>
>                           
> <schemaDirectory>src/main/resources/xml</schemaDirectory>
>                       </configuration>
>                </execution>
>               </executions>
>         </plugin>       ...
> 
> and when i run maven with the following command:
> mvn -Papache package
> i've got this exception!
> 
> ...
> [INFO] 
> ------------------------------------------------------------------------
> [ERROR] BUILD ERROR
> [INFO] 
> ------------------------------------------------------------------------
> [INFO] Failed to configure plugin parameters for: 
> org.apache.maven.plugins:maven-jar-plugin:2.2-SNAPSHOT
> 
>    (found static expression: '**/*.xsd' which may act as a default value).
> 
> 
> Cause: Cannot assign configuration entry 'excludes' to 'class 
> [Ljava.lang.String;' from '**/*.xsd', which is of type class 
> java.lang.String
> [INFO] 
> ------------------------------------------------------------------------
> [INFO] For more information, run Maven with the -e switch
> ...
> 
> do i forget something during my builds??
> 
> regards
> supareno
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 


-- 
Dennis Lundberg

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


Re: Excluding files from JAR with maven-jar-plugin 2.2-SNAPSHOT failed

Posted by Jochen Wiedmann <jo...@gmail.com>.
On Jan 12, 2008 3:59 PM, supareno <re...@free.fr> wrote:

> [INFO] Failed to configure plugin parameters for:
> org.apache.maven.plugins:maven-jar-plugin:2.2-SNAPSHOT
>
>     (found static expression: '**/*.xsd' which may act as a default value).

Configuration problem on your side, use

    <excludes>
       <exclude>**/*.xsd</exclude>
    </excludes>

Jochen


-- 
Look, that's why there's rules, understand? So that you think before
you break 'em.

    -- (Terry Pratchett, Thief of Time)

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


Re: Excluding files from JAR with maven-jar-plugin 2.2-SNAPSHOT failed

Posted by supareno <re...@free.fr>.
thanks for your Olivier ,

it works now!
i forgot to make a clean in the target folder so that's why the files 
were always present !

regards
> The excludes field in the jar plugin is to exclude content from
> ${project.build.outputDirectory} not to exclude resources.
> In order to exclude resources have a look here [1].
>
> I don't really understand your jar plugin configuration.
> Can you try a more simple :
>
>       <plugin>
>         <groupId>org.apache.maven.plugins</groupId>
>         <artifactId>maven-jar-plugin</artifactId>
>         <configuration>
>           <excludes>
>             <exclude>**/*.xsd</exclude>
>           </excludes>
>         </configuration>
>       </plugin>
>
> --
> Olivier
> [1] http://maven.apache.org/plugins/maven-resources-plugin/examples/include-exclude.html
>
> 2008/1/12, supareno <re...@free.fr>:
>   
>> Thanks Olivier (and Jochen and Dennis),
>>
>> it is now building without any error but the xsd files is always here
>> i'm gonna try with Ant task to if it is working !
>>
>> regards
>>     
>>> Hi,
>>> Can you try with :
>>>           <excludes>
>>>             <exclude>**/*.xsd</exclude>
>>>           </excludes>
>>>
>>> --
>>> Olivier
>>>
>>> 2008/1/12, supareno <re...@free.fr>:
>>>
>>>       
>>>> Hello guys
>>>>
>>>> i read the previous threads about exclusion with interest
>>>> because i am always confronted with the "excludes" problem
>>>>
>>>> i followed all the steps:
>>>> changed my settings.xml to enable snapshot plugin repositories...
>>>> (http://maven.apache.org/guides/development/guide-plugin-snapshot-repositories.html)
>>>> everything is working except the "excludes" tag
>>>>
>>>> my pom.xml looks like this:
>>>>
>>>> ...
>>>>         <plugin>
>>>>             <groupId>org.apache.maven.plugins</groupId>
>>>>             <artifactId>maven-jar-plugin</artifactId>
>>>>             <version>2.2-SNAPSHOT</version>
>>>>             <executions>
>>>>                 <execution>
>>>>                     <goals>
>>>>                         <goal>jar</goal>
>>>>                     </goals>
>>>>                     <configuration>
>>>>                            <excludes>**/*.xsd</excludes>
>>>>
>>>> <schemaDirectory>src/main/resources/xml</schemaDirectory>
>>>>                        </configuration>
>>>>                 </execution>
>>>>                </executions>
>>>>          </plugin>
>>>> ...
>>>>
>>>> and when i run maven with the following command:
>>>> mvn -Papache package
>>>> i've got this exception!
>>>>
>>>> ...
>>>> [INFO]
>>>> ------------------------------------------------------------------------
>>>> [ERROR] BUILD ERROR
>>>> [INFO]
>>>> ------------------------------------------------------------------------
>>>> [INFO] Failed to configure plugin parameters for:
>>>> org.apache.maven.plugins:maven-jar-plugin:2.2-SNAPSHOT
>>>>
>>>>     (found static expression: '**/*.xsd' which may act as a default value).
>>>>
>>>>
>>>> Cause: Cannot assign configuration entry 'excludes' to 'class
>>>> [Ljava.lang.String;' from '**/*.xsd', which is of type class
>>>> java.lang.String
>>>> [INFO]
>>>> ------------------------------------------------------------------------
>>>> [INFO] For more information, run Maven with the -e switch
>>>> ...
>>>>
>>>> do i forget something during my builds??
>>>>
>>>> regards
>>>> supareno
>>>>
>>>> ---------------------------------------------------------------------
>>>> 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
>>>
>>>
>>>
>>>
>>>       
>> ---------------------------------------------------------------------
>> 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
>
>
>
>   


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


Re: Excluding files from JAR with maven-jar-plugin 2.2-SNAPSHOT failed

Posted by Olivier Lamy <ol...@apache.org>.
The excludes field in the jar plugin is to exclude content from
${project.build.outputDirectory} not to exclude resources.
In order to exclude resources have a look here [1].

I don't really understand your jar plugin configuration.
Can you try a more simple :

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <configuration>
          <excludes>
            <exclude>**/*.xsd</exclude>
          </excludes>
        </configuration>
      </plugin>

--
Olivier
[1] http://maven.apache.org/plugins/maven-resources-plugin/examples/include-exclude.html

2008/1/12, supareno <re...@free.fr>:
> Thanks Olivier (and Jochen and Dennis),
>
> it is now building without any error but the xsd files is always here
> i'm gonna try with Ant task to if it is working !
>
> regards
> > Hi,
> > Can you try with :
> >           <excludes>
> >             <exclude>**/*.xsd</exclude>
> >           </excludes>
> >
> > --
> > Olivier
> >
> > 2008/1/12, supareno <re...@free.fr>:
> >
> >> Hello guys
> >>
> >> i read the previous threads about exclusion with interest
> >> because i am always confronted with the "excludes" problem
> >>
> >> i followed all the steps:
> >> changed my settings.xml to enable snapshot plugin repositories...
> >> (http://maven.apache.org/guides/development/guide-plugin-snapshot-repositories.html)
> >> everything is working except the "excludes" tag
> >>
> >> my pom.xml looks like this:
> >>
> >> ...
> >>         <plugin>
> >>             <groupId>org.apache.maven.plugins</groupId>
> >>             <artifactId>maven-jar-plugin</artifactId>
> >>             <version>2.2-SNAPSHOT</version>
> >>             <executions>
> >>                 <execution>
> >>                     <goals>
> >>                         <goal>jar</goal>
> >>                     </goals>
> >>                     <configuration>
> >>                            <excludes>**/*.xsd</excludes>
> >>
> >> <schemaDirectory>src/main/resources/xml</schemaDirectory>
> >>                        </configuration>
> >>                 </execution>
> >>                </executions>
> >>          </plugin>
> >> ...
> >>
> >> and when i run maven with the following command:
> >> mvn -Papache package
> >> i've got this exception!
> >>
> >> ...
> >> [INFO]
> >> ------------------------------------------------------------------------
> >> [ERROR] BUILD ERROR
> >> [INFO]
> >> ------------------------------------------------------------------------
> >> [INFO] Failed to configure plugin parameters for:
> >> org.apache.maven.plugins:maven-jar-plugin:2.2-SNAPSHOT
> >>
> >>     (found static expression: '**/*.xsd' which may act as a default value).
> >>
> >>
> >> Cause: Cannot assign configuration entry 'excludes' to 'class
> >> [Ljava.lang.String;' from '**/*.xsd', which is of type class
> >> java.lang.String
> >> [INFO]
> >> ------------------------------------------------------------------------
> >> [INFO] For more information, run Maven with the -e switch
> >> ...
> >>
> >> do i forget something during my builds??
> >>
> >> regards
> >> supareno
> >>
> >> ---------------------------------------------------------------------
> >> 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
> >
> >
> >
> >
>
>
> ---------------------------------------------------------------------
> 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: Excluding files from JAR with maven-jar-plugin 2.2-SNAPSHOT failed

Posted by supareno <re...@free.fr>.
Thanks Olivier (and Jochen and Dennis),

it is now building without any error but the xsd files is always here
i'm gonna try with Ant task to if it is working !

regards
> Hi,
> Can you try with :
>           <excludes>
>             <exclude>**/*.xsd</exclude>
>           </excludes>
>
> --
> Olivier
>
> 2008/1/12, supareno <re...@free.fr>:
>   
>> Hello guys
>>
>> i read the previous threads about exclusion with interest
>> because i am always confronted with the "excludes" problem
>>
>> i followed all the steps:
>> changed my settings.xml to enable snapshot plugin repositories...
>> (http://maven.apache.org/guides/development/guide-plugin-snapshot-repositories.html)
>> everything is working except the "excludes" tag
>>
>> my pom.xml looks like this:
>>
>> ...
>>         <plugin>
>>             <groupId>org.apache.maven.plugins</groupId>
>>             <artifactId>maven-jar-plugin</artifactId>
>>             <version>2.2-SNAPSHOT</version>
>>             <executions>
>>                 <execution>
>>                     <goals>
>>                         <goal>jar</goal>
>>                     </goals>
>>                     <configuration>
>>                            <excludes>**/*.xsd</excludes>
>>
>> <schemaDirectory>src/main/resources/xml</schemaDirectory>
>>                        </configuration>
>>                 </execution>
>>                </executions>
>>          </plugin>
>> ...
>>
>> and when i run maven with the following command:
>> mvn -Papache package
>> i've got this exception!
>>
>> ...
>> [INFO]
>> ------------------------------------------------------------------------
>> [ERROR] BUILD ERROR
>> [INFO]
>> ------------------------------------------------------------------------
>> [INFO] Failed to configure plugin parameters for:
>> org.apache.maven.plugins:maven-jar-plugin:2.2-SNAPSHOT
>>
>>     (found static expression: '**/*.xsd' which may act as a default value).
>>
>>
>> Cause: Cannot assign configuration entry 'excludes' to 'class
>> [Ljava.lang.String;' from '**/*.xsd', which is of type class
>> java.lang.String
>> [INFO]
>> ------------------------------------------------------------------------
>> [INFO] For more information, run Maven with the -e switch
>> ...
>>
>> do i forget something during my builds??
>>
>> regards
>> supareno
>>
>> ---------------------------------------------------------------------
>> 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
>
>
>
>   


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


Re: Excluding files from JAR with maven-jar-plugin 2.2-SNAPSHOT failed

Posted by Olivier Lamy <ol...@apache.org>.
Hi,
Can you try with :
          <excludes>
            <exclude>**/*.xsd</exclude>
          </excludes>

--
Olivier

2008/1/12, supareno <re...@free.fr>:
> Hello guys
>
> i read the previous threads about exclusion with interest
> because i am always confronted with the "excludes" problem
>
> i followed all the steps:
> changed my settings.xml to enable snapshot plugin repositories...
> (http://maven.apache.org/guides/development/guide-plugin-snapshot-repositories.html)
> everything is working except the "excludes" tag
>
> my pom.xml looks like this:
>
> ...
>         <plugin>
>             <groupId>org.apache.maven.plugins</groupId>
>             <artifactId>maven-jar-plugin</artifactId>
>             <version>2.2-SNAPSHOT</version>
>             <executions>
>                 <execution>
>                     <goals>
>                         <goal>jar</goal>
>                     </goals>
>                     <configuration>
>                            <excludes>**/*.xsd</excludes>
>
> <schemaDirectory>src/main/resources/xml</schemaDirectory>
>                        </configuration>
>                 </execution>
>                </executions>
>          </plugin>
> ...
>
> and when i run maven with the following command:
> mvn -Papache package
> i've got this exception!
>
> ...
> [INFO]
> ------------------------------------------------------------------------
> [ERROR] BUILD ERROR
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Failed to configure plugin parameters for:
> org.apache.maven.plugins:maven-jar-plugin:2.2-SNAPSHOT
>
>     (found static expression: '**/*.xsd' which may act as a default value).
>
>
> Cause: Cannot assign configuration entry 'excludes' to 'class
> [Ljava.lang.String;' from '**/*.xsd', which is of type class
> java.lang.String
> [INFO]
> ------------------------------------------------------------------------
> [INFO] For more information, run Maven with the -e switch
> ...
>
> do i forget something during my builds??
>
> regards
> supareno
>
> ---------------------------------------------------------------------
> 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


Excluding files from JAR with maven-jar-plugin 2.2-SNAPSHOT failed

Posted by supareno <re...@free.fr>.
Hello guys

i read the previous threads about exclusion with interest
because i am always confronted with the "excludes" problem

i followed all the steps:
changed my settings.xml to enable snapshot plugin repositories...
(http://maven.apache.org/guides/development/guide-plugin-snapshot-repositories.html)
everything is working except the "excludes" tag

my pom.xml looks like this:

...
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-jar-plugin</artifactId>
            <version>2.2-SNAPSHOT</version>
            <executions>
                <execution>
                    <goals>
                        <goal>jar</goal>
                    </goals>
                    <configuration>
                           <excludes>**/*.xsd</excludes>
                           
<schemaDirectory>src/main/resources/xml</schemaDirectory>
                       </configuration>
                </execution>
               </executions>
         </plugin>       
...

and when i run maven with the following command:
mvn -Papache package
i've got this exception!

...
[INFO] 
------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] 
------------------------------------------------------------------------
[INFO] Failed to configure plugin parameters for: 
org.apache.maven.plugins:maven-jar-plugin:2.2-SNAPSHOT

    (found static expression: '**/*.xsd' which may act as a default value).


Cause: Cannot assign configuration entry 'excludes' to 'class 
[Ljava.lang.String;' from '**/*.xsd', which is of type class 
java.lang.String
[INFO] 
------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
...

do i forget something during my builds??

regards
supareno

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


Re: Excluding files from JAR

Posted by Olivier Lamy <ol...@apache.org>.
Nothing to patch locally.
The snapshot with this patch is available in snapshot plugin repositories.
In order to test this have a look here [1] (first section "How to
include the plugin snapshot repositories as part of your build").

If you have any issues let us know,

Thanks,
--
Olivier

[1] http://maven.apache.org/guides/development/guide-plugin-snapshot-repositories.html


2008/1/10, amit kumar <am...@gmail.com>:
> Hi,
> I have downloaded the patches from the link mentioned by you. But I don't
> know how to apply them.
>
> regards,
> Amit
>
> On Jan 10, 2008 6:29 PM, Olivier Lamy <ol...@apache.org> wrote:
>
> > Hi,
> > No you don't miss something here.
> > It's a know issue [1] and it's fixed in trunk.
> > You can try last snapshot to test the fix.
> >
> > --
> > Olivier
> > [1] http://jira.codehaus.org/browse/MJAR-30
> >
> > 2008/1/10, amit kumar <am...@gmail.com>:
> > > HI,
> > > Just like WAR can I as well exclude some files from JAR builds as well?
> > >
> > > I have used this, but not working.
> > >
> > >   </plugin>
> > >     <plugin>
> > >   <groupId>org.apache.maven.plugins</groupId>
> > >   <artifactId>maven-jar-plugin</artifactId>
> > >   <version>2.1</version>
> > >   <executions>
> > >        <execution>
> > >           <goals>
> > >              <goal>jar</goal>
> > >         </goals>
> > >        </execution>
> > >     </executions>
> > >     <configuration>
> > >         <excludes>**/*.xsd</excludes>
> > >            <schemaDirectory>src/schema/xsd</schemaDirectory>
> > >     </configuration>
> > >   </plugin>
> > >
> > > Am I missing something?
> > >
> > > Amit
> > >
> >
> > ---------------------------------------------------------------------
> > 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: Excluding files from JAR

Posted by amit kumar <am...@gmail.com>.
Hi,
I have downloaded the patches from the link mentioned by you. But I don't
know how to apply them.

regards,
Amit

On Jan 10, 2008 6:29 PM, Olivier Lamy <ol...@apache.org> wrote:

> Hi,
> No you don't miss something here.
> It's a know issue [1] and it's fixed in trunk.
> You can try last snapshot to test the fix.
>
> --
> Olivier
> [1] http://jira.codehaus.org/browse/MJAR-30
>
> 2008/1/10, amit kumar <am...@gmail.com>:
> > HI,
> > Just like WAR can I as well exclude some files from JAR builds as well?
> >
> > I have used this, but not working.
> >
> >   </plugin>
> >     <plugin>
> >   <groupId>org.apache.maven.plugins</groupId>
> >   <artifactId>maven-jar-plugin</artifactId>
> >   <version>2.1</version>
> >   <executions>
> >        <execution>
> >           <goals>
> >              <goal>jar</goal>
> >         </goals>
> >        </execution>
> >     </executions>
> >     <configuration>
> >         <excludes>**/*.xsd</excludes>
> >            <schemaDirectory>src/schema/xsd</schemaDirectory>
> >     </configuration>
> >   </plugin>
> >
> > Am I missing something?
> >
> > Amit
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Excluding files from JAR

Posted by Olivier Lamy <ol...@apache.org>.
Hi,
No you don't miss something here.
It's a know issue [1] and it's fixed in trunk.
You can try last snapshot to test the fix.

--
Olivier
[1] http://jira.codehaus.org/browse/MJAR-30

2008/1/10, amit kumar <am...@gmail.com>:
> HI,
> Just like WAR can I as well exclude some files from JAR builds as well?
>
> I have used this, but not working.
>
>   </plugin>
>     <plugin>
>   <groupId>org.apache.maven.plugins</groupId>
>   <artifactId>maven-jar-plugin</artifactId>
>   <version>2.1</version>
>   <executions>
>        <execution>
>           <goals>
>              <goal>jar</goal>
>         </goals>
>        </execution>
>     </executions>
>     <configuration>
>         <excludes>**/*.xsd</excludes>
>            <schemaDirectory>src/schema/xsd</schemaDirectory>
>     </configuration>
>   </plugin>
>
> Am I missing something?
>
> Amit
>

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