You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by WriteJava <an...@plus.net> on 2010/03/04 17:06:53 UTC

Unable to exclude .class files

Hi,

I am trying to generate a sar file using 'jboss-packaging-maven-plugin'
plugin and I can't exclude .class files from my sar. It is including all
classes to sar. Can you please help? Here is my code snippet:

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>jboss-packaging-maven-plugin</artifactId>
                <version>2.1.1</version>
                <extensions>true</extensions>
                <configuration>
                        <excludes>
                                <exclude>**/*.class</exclude>
                        </excludes>
                </configuration>
                <executions>
                    <execution>
                        <id>sar123</id>
                        <goals>
                            <goal>sar</goal>
                        </goals>
                        <phase>package</phase>
                        <configuration>
                            <archiveName>my-service</archiveName>
                           
<deploymentDescriptorFile>${basedir}/conf/mysarMETA-INF/jboss-service.xml</deploymentDescriptorFile>
                            <primaryArtifact>false</primaryArtifact>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

Thanks
-- 
View this message in context: http://old.nabble.com/Unable-to-exclude-.class-files-tp27782829p27782829.html
Sent from the Maven - Users mailing list archive at Nabble.com.


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


Re: Unable to exclude .class files

Posted by Wayne Fay <wa...@gmail.com>.
> The case I'm currently looking at would take many months of work
> to refactor to split the modules up, whereas a build system is a build

Many months for a complete refactor, but couldn't you make a pretty
good effort in just a few weeks, at least hit some of the low-hanging
fruit etc? Making more Maven modules should be pretty low-cost if
you're really converting everything over to Maven anyway.

Or is *any* refactoring beyond the bare minimum required for the new
build system out of the question? Arguably, moving files to new
modules rather than using includes/excludes *is* part of that minimum
effort IMO.

Fowler's refactoring book and Feather's legacy code book are great
resources for this kind of work, if you don't already have them.

Wayne

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


RE: Unable to exclude .class files

Posted by Thomas Harris <th...@axispoint.com>.
The case I'm currently looking at would take many months of work to refactor to split the modules up, whereas a build system is a build system. Our new standard is Maven with Husdon and a bunch of code reporting tools, etc. We really don't have a choice, except to use Maven or a different new build system, like custom Ant scripts, as the old build system is all proprietary and no longer supported by the vendor.

Tom

-----Original Message-----
From: anders.g.hammar@gmail.com [mailto:anders.g.hammar@gmail.com] On Behalf Of Anders Hammar
Sent: Friday, March 05, 2010 4:14 PM
To: Maven Users List
Subject: Re: Unable to exclude .class files

Well, I believe that in most cases it's going to be more expensive fighting
Maven to force an nonstandard behavior instead of refactoring and going the
standard Maven path.
It's like doing C code style in Java. What's the benefit of switching to
Java?

/Anders

On Fri, Mar 5, 2010 at 21:22, Thomas Harris <th...@axispoint.com> wrote:

>
> When Mavenizing an existing project, especially one that is as old as Java,
> you might find that the prying apart of the ball of mud via major
> refactoring is a task that a client will not pay for. You still want to
> Mavenize the project and integrate it into you blah/blah CI process, etc.
> So, in that case...?
>
> Tom
>
> -----Original Message-----
> From: thomas.k.sundberg@gmail.com [mailto:thomas.k.sundberg@gmail.com] On
> Behalf Of Thomas Sundberg
> Sent: Friday, March 05, 2010 4:40 AM
> To: Maven Users List
> Subject: Re: Unable to exclude .class files
>
> Hi!
>
> You should perhaps even have three projects. One for the common stuff,
> one for the specific jar project that depends on the common stuff and
> one for the sar project that also depends on the common stuff.
>
> /Thomas
>
> On Fri, Mar 5, 2010 at 10:35, Anders Hammar <an...@hammar.net> wrote:
> > No, you should have two separate projects. That's the Maven way - do
> > yourself a favor and don't fight it!
> >
> > /Anders
> >
> > On Fri, Mar 5, 2010 at 10:11, WriteJava <an...@plus.net> wrote:
> >
> >>
> >> Thanks for your reply Anders, yes I am trying to build both jar and sar
> >> within same maven project and I've some java classes which i need to add
> to
> >> sar and exclude others and add them to jar. Is this possible?
> >>
> >> Thanks
> >>
> >> Anders Hammar wrote:
> >> >
> >> > The exclude tag is for specifying artifactId:groupId as stated in the
> >> > docs.
> >> >
> >> > I don't understand why you don't want to include the classes? If you
> have
> >> > a
> >> > sar project but don't want to include some classes, why do you have
> them
> >> > in
> >> > that project? Or could it be that you're trying to do a jar AND a sar
> in
> >> > the
> >> > same Maven project?
> >> >
> >> > /Anders
> >> >
> >> > On Thu, Mar 4, 2010 at 17:06, WriteJava <an...@plus.net> wrote:
> >> >
> >> >>
> >> >> Hi,
> >> >>
> >> >> I am trying to generate a sar file using
> 'jboss-packaging-maven-plugin'
> >> >> plugin and I can't exclude .class files from my sar. It is including
> all
> >> >> classes to sar. Can you please help? Here is my code snippet:
> >> >>
> >> >>            <plugin>
> >> >>                <groupId>org.codehaus.mojo</groupId>
> >> >>                <artifactId>jboss-packaging-maven-plugin</artifactId>
> >> >>                <version>2.1.1</version>
> >> >>                <extensions>true</extensions>
> >> >>                <configuration>
> >> >>                        <excludes>
> >> >>                                <exclude>**/*.class</exclude>
> >> >>                        </excludes>
> >> >>                </configuration>
> >> >>                <executions>
> >> >>                    <execution>
> >> >>                        <id>sar123</id>
> >> >>                        <goals>
> >> >>                            <goal>sar</goal>
> >> >>                        </goals>
> >> >>                        <phase>package</phase>
> >> >>                        <configuration>
> >> >>                            <archiveName>my-service</archiveName>
> >> >>
> >> >>
> >> >>
> >>
> <deploymentDescriptorFile>${basedir}/conf/mysarMETA-INF/jboss-service.xml</deploymentDescriptorFile>
> >> >>                            <primaryArtifact>false</primaryArtifact>
> >> >>                        </configuration>
> >> >>                    </execution>
> >> >>                </executions>
> >> >>            </plugin>
> >> >>
> >> >> Thanks
> >> >> --
> >> >> View this message in context:
> >> >>
> >>
> http://old.nabble.com/Unable-to-exclude-.class-files-tp27782829p27782829.html
> >> >> Sent from the Maven - Users mailing list archive at Nabble.com.
> >> >>
> >> >>
> >> >> ---------------------------------------------------------------------
> >> >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >> >> For additional commands, e-mail: users-help@maven.apache.org
> >> >>
> >> >>
> >> >
> >> >
> >>
> >> --
> >> View this message in context:
> >>
> http://old.nabble.com/Unable-to-exclude-.class-files-tp27782829p27791501.html
> >> Sent from the Maven - Users mailing list archive at Nabble.com.
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >> For additional commands, e-mail: users-help@maven.apache.org
> >>
> >>
> >
>
>
>
> --
> Thomas Sundberg
> M. Sc. in Computer Science
>
> Mobile: +46 70 767 33 15
> Blog: http://thomassundberg.wordpress.com/
>
> ---------------------------------------------------------------------
> 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: Unable to exclude .class files

Posted by Anders Hammar <an...@hammar.net>.
Well, I believe that in most cases it's going to be more expensive fighting
Maven to force an nonstandard behavior instead of refactoring and going the
standard Maven path.
It's like doing C code style in Java. What's the benefit of switching to
Java?

/Anders

On Fri, Mar 5, 2010 at 21:22, Thomas Harris <th...@axispoint.com> wrote:

>
> When Mavenizing an existing project, especially one that is as old as Java,
> you might find that the prying apart of the ball of mud via major
> refactoring is a task that a client will not pay for. You still want to
> Mavenize the project and integrate it into you blah/blah CI process, etc.
> So, in that case...?
>
> Tom
>
> -----Original Message-----
> From: thomas.k.sundberg@gmail.com [mailto:thomas.k.sundberg@gmail.com] On
> Behalf Of Thomas Sundberg
> Sent: Friday, March 05, 2010 4:40 AM
> To: Maven Users List
> Subject: Re: Unable to exclude .class files
>
> Hi!
>
> You should perhaps even have three projects. One for the common stuff,
> one for the specific jar project that depends on the common stuff and
> one for the sar project that also depends on the common stuff.
>
> /Thomas
>
> On Fri, Mar 5, 2010 at 10:35, Anders Hammar <an...@hammar.net> wrote:
> > No, you should have two separate projects. That's the Maven way - do
> > yourself a favor and don't fight it!
> >
> > /Anders
> >
> > On Fri, Mar 5, 2010 at 10:11, WriteJava <an...@plus.net> wrote:
> >
> >>
> >> Thanks for your reply Anders, yes I am trying to build both jar and sar
> >> within same maven project and I've some java classes which i need to add
> to
> >> sar and exclude others and add them to jar. Is this possible?
> >>
> >> Thanks
> >>
> >> Anders Hammar wrote:
> >> >
> >> > The exclude tag is for specifying artifactId:groupId as stated in the
> >> > docs.
> >> >
> >> > I don't understand why you don't want to include the classes? If you
> have
> >> > a
> >> > sar project but don't want to include some classes, why do you have
> them
> >> > in
> >> > that project? Or could it be that you're trying to do a jar AND a sar
> in
> >> > the
> >> > same Maven project?
> >> >
> >> > /Anders
> >> >
> >> > On Thu, Mar 4, 2010 at 17:06, WriteJava <an...@plus.net> wrote:
> >> >
> >> >>
> >> >> Hi,
> >> >>
> >> >> I am trying to generate a sar file using
> 'jboss-packaging-maven-plugin'
> >> >> plugin and I can't exclude .class files from my sar. It is including
> all
> >> >> classes to sar. Can you please help? Here is my code snippet:
> >> >>
> >> >>            <plugin>
> >> >>                <groupId>org.codehaus.mojo</groupId>
> >> >>                <artifactId>jboss-packaging-maven-plugin</artifactId>
> >> >>                <version>2.1.1</version>
> >> >>                <extensions>true</extensions>
> >> >>                <configuration>
> >> >>                        <excludes>
> >> >>                                <exclude>**/*.class</exclude>
> >> >>                        </excludes>
> >> >>                </configuration>
> >> >>                <executions>
> >> >>                    <execution>
> >> >>                        <id>sar123</id>
> >> >>                        <goals>
> >> >>                            <goal>sar</goal>
> >> >>                        </goals>
> >> >>                        <phase>package</phase>
> >> >>                        <configuration>
> >> >>                            <archiveName>my-service</archiveName>
> >> >>
> >> >>
> >> >>
> >>
> <deploymentDescriptorFile>${basedir}/conf/mysarMETA-INF/jboss-service.xml</deploymentDescriptorFile>
> >> >>                            <primaryArtifact>false</primaryArtifact>
> >> >>                        </configuration>
> >> >>                    </execution>
> >> >>                </executions>
> >> >>            </plugin>
> >> >>
> >> >> Thanks
> >> >> --
> >> >> View this message in context:
> >> >>
> >>
> http://old.nabble.com/Unable-to-exclude-.class-files-tp27782829p27782829.html
> >> >> Sent from the Maven - Users mailing list archive at Nabble.com.
> >> >>
> >> >>
> >> >> ---------------------------------------------------------------------
> >> >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >> >> For additional commands, e-mail: users-help@maven.apache.org
> >> >>
> >> >>
> >> >
> >> >
> >>
> >> --
> >> View this message in context:
> >>
> http://old.nabble.com/Unable-to-exclude-.class-files-tp27782829p27791501.html
> >> Sent from the Maven - Users mailing list archive at Nabble.com.
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >> For additional commands, e-mail: users-help@maven.apache.org
> >>
> >>
> >
>
>
>
> --
> Thomas Sundberg
> M. Sc. in Computer Science
>
> Mobile: +46 70 767 33 15
> Blog: http://thomassundberg.wordpress.com/
>
> ---------------------------------------------------------------------
> 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: Unable to exclude .class files

Posted by Thomas Harris <th...@axispoint.com>.
Nope, not gonna do it... ball of mud stays. I can focus my efforts on newer projects with a life ahead of them. This one can't change, too many years of barnacles collecting.

Tom

-----Original Message-----
From: Ron Wheeler [mailto:rwheeler@artifact-software.com] 
Sent: Friday, March 05, 2010 6:52 PM
To: Maven Users List
Subject: Re: Unable to exclude .class files

Thomas Harris wrote:
> When Mavenizing an existing project, especially one that is as old as Java, you might find that the prying apart of the ball of mud via major refactoring is a task that a client will not pay for. You still want to Mavenize the project and integrate it into you blah/blah CI process, etc. So, in that case...?
>
> Tom
>
>   
Someone will pay for and someone will reap the cost savings. In an ideal 
world your customer pays for it and you get to reap the rewards. In 
reality, you often pay for it and the customer gets the rewards when 
your bills are less.

You are probably going to have to unravel good chunks of the ball of mud 
anyway.

Ron

> -----Original Message-----
> From: thomas.k.sundberg@gmail.com [mailto:thomas.k.sundberg@gmail.com] On Behalf Of Thomas Sundberg
> Sent: Friday, March 05, 2010 4:40 AM
> To: Maven Users List
> Subject: Re: Unable to exclude .class files
>
> Hi!
>
> You should perhaps even have three projects. One for the common stuff,
> one for the specific jar project that depends on the common stuff and
> one for the sar project that also depends on the common stuff.
>
> /Thomas
>
> On Fri, Mar 5, 2010 at 10:35, Anders Hammar <an...@hammar.net> wrote:
>   
>> No, you should have two separate projects. That's the Maven way - do
>> yourself a favor and don't fight it!
>>
>> /Anders
>>
>> On Fri, Mar 5, 2010 at 10:11, WriteJava <an...@plus.net> wrote:
>>
>>     
>>> Thanks for your reply Anders, yes I am trying to build both jar and sar
>>> within same maven project and I've some java classes which i need to add to
>>> sar and exclude others and add them to jar. Is this possible?
>>>
>>> Thanks
>>>
>>> Anders Hammar wrote:
>>>       
>>>> The exclude tag is for specifying artifactId:groupId as stated in the
>>>> docs.
>>>>
>>>> I don't understand why you don't want to include the classes? If you have
>>>> a
>>>> sar project but don't want to include some classes, why do you have them
>>>> in
>>>> that project? Or could it be that you're trying to do a jar AND a sar in
>>>> the
>>>> same Maven project?
>>>>
>>>> /Anders
>>>>
>>>> On Thu, Mar 4, 2010 at 17:06, WriteJava <an...@plus.net> wrote:
>>>>
>>>>         
>>>>> Hi,
>>>>>
>>>>> I am trying to generate a sar file using 'jboss-packaging-maven-plugin'
>>>>> plugin and I can't exclude .class files from my sar. It is including all
>>>>> classes to sar. Can you please help? Here is my code snippet:
>>>>>
>>>>>            <plugin>
>>>>>                <groupId>org.codehaus.mojo</groupId>
>>>>>                <artifactId>jboss-packaging-maven-plugin</artifactId>
>>>>>                <version>2.1.1</version>
>>>>>                <extensions>true</extensions>
>>>>>                <configuration>
>>>>>                        <excludes>
>>>>>                                <exclude>**/*.class</exclude>
>>>>>                        </excludes>
>>>>>                </configuration>
>>>>>                <executions>
>>>>>                    <execution>
>>>>>                        <id>sar123</id>
>>>>>                        <goals>
>>>>>                            <goal>sar</goal>
>>>>>                        </goals>
>>>>>                        <phase>package</phase>
>>>>>                        <configuration>
>>>>>                            <archiveName>my-service</archiveName>
>>>>>
>>>>>
>>>>>
>>>>>           
>>> <deploymentDescriptorFile>${basedir}/conf/mysarMETA-INF/jboss-service.xml</deploymentDescriptorFile>
>>>       
>>>>>                            <primaryArtifact>false</primaryArtifact>
>>>>>                        </configuration>
>>>>>                    </execution>
>>>>>                </executions>
>>>>>            </plugin>
>>>>>
>>>>> Thanks
>>>>> --
>>>>> View this message in context:
>>>>>
>>>>>           
>>> http://old.nabble.com/Unable-to-exclude-.class-files-tp27782829p27782829.html
>>>       
>>>>> Sent from the Maven - Users mailing list archive at Nabble.com.
>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>>>
>>>>>
>>>>>           
>>>>         
>>> --
>>> View this message in context:
>>> http://old.nabble.com/Unable-to-exclude-.class-files-tp27782829p27791501.html
>>> Sent from the Maven - Users mailing list archive at Nabble.com.
>>>
>>>
>>> ---------------------------------------------------------------------
>>> 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: Unable to exclude .class files

Posted by Ron Wheeler <rw...@artifact-software.com>.
Thomas Harris wrote:
> When Mavenizing an existing project, especially one that is as old as Java, you might find that the prying apart of the ball of mud via major refactoring is a task that a client will not pay for. You still want to Mavenize the project and integrate it into you blah/blah CI process, etc. So, in that case...?
>
> Tom
>
>   
Someone will pay for and someone will reap the cost savings. In an ideal 
world your customer pays for it and you get to reap the rewards. In 
reality, you often pay for it and the customer gets the rewards when 
your bills are less.

You are probably going to have to unravel good chunks of the ball of mud 
anyway.

Ron

> -----Original Message-----
> From: thomas.k.sundberg@gmail.com [mailto:thomas.k.sundberg@gmail.com] On Behalf Of Thomas Sundberg
> Sent: Friday, March 05, 2010 4:40 AM
> To: Maven Users List
> Subject: Re: Unable to exclude .class files
>
> Hi!
>
> You should perhaps even have three projects. One for the common stuff,
> one for the specific jar project that depends on the common stuff and
> one for the sar project that also depends on the common stuff.
>
> /Thomas
>
> On Fri, Mar 5, 2010 at 10:35, Anders Hammar <an...@hammar.net> wrote:
>   
>> No, you should have two separate projects. That's the Maven way - do
>> yourself a favor and don't fight it!
>>
>> /Anders
>>
>> On Fri, Mar 5, 2010 at 10:11, WriteJava <an...@plus.net> wrote:
>>
>>     
>>> Thanks for your reply Anders, yes I am trying to build both jar and sar
>>> within same maven project and I've some java classes which i need to add to
>>> sar and exclude others and add them to jar. Is this possible?
>>>
>>> Thanks
>>>
>>> Anders Hammar wrote:
>>>       
>>>> The exclude tag is for specifying artifactId:groupId as stated in the
>>>> docs.
>>>>
>>>> I don't understand why you don't want to include the classes? If you have
>>>> a
>>>> sar project but don't want to include some classes, why do you have them
>>>> in
>>>> that project? Or could it be that you're trying to do a jar AND a sar in
>>>> the
>>>> same Maven project?
>>>>
>>>> /Anders
>>>>
>>>> On Thu, Mar 4, 2010 at 17:06, WriteJava <an...@plus.net> wrote:
>>>>
>>>>         
>>>>> Hi,
>>>>>
>>>>> I am trying to generate a sar file using 'jboss-packaging-maven-plugin'
>>>>> plugin and I can't exclude .class files from my sar. It is including all
>>>>> classes to sar. Can you please help? Here is my code snippet:
>>>>>
>>>>>            <plugin>
>>>>>                <groupId>org.codehaus.mojo</groupId>
>>>>>                <artifactId>jboss-packaging-maven-plugin</artifactId>
>>>>>                <version>2.1.1</version>
>>>>>                <extensions>true</extensions>
>>>>>                <configuration>
>>>>>                        <excludes>
>>>>>                                <exclude>**/*.class</exclude>
>>>>>                        </excludes>
>>>>>                </configuration>
>>>>>                <executions>
>>>>>                    <execution>
>>>>>                        <id>sar123</id>
>>>>>                        <goals>
>>>>>                            <goal>sar</goal>
>>>>>                        </goals>
>>>>>                        <phase>package</phase>
>>>>>                        <configuration>
>>>>>                            <archiveName>my-service</archiveName>
>>>>>
>>>>>
>>>>>
>>>>>           
>>> <deploymentDescriptorFile>${basedir}/conf/mysarMETA-INF/jboss-service.xml</deploymentDescriptorFile>
>>>       
>>>>>                            <primaryArtifact>false</primaryArtifact>
>>>>>                        </configuration>
>>>>>                    </execution>
>>>>>                </executions>
>>>>>            </plugin>
>>>>>
>>>>> Thanks
>>>>> --
>>>>> View this message in context:
>>>>>
>>>>>           
>>> http://old.nabble.com/Unable-to-exclude-.class-files-tp27782829p27782829.html
>>>       
>>>>> Sent from the Maven - Users mailing list archive at Nabble.com.
>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>>>
>>>>>
>>>>>           
>>>>         
>>> --
>>> View this message in context:
>>> http://old.nabble.com/Unable-to-exclude-.class-files-tp27782829p27791501.html
>>> Sent from the Maven - Users mailing list archive at Nabble.com.
>>>
>>>
>>> ---------------------------------------------------------------------
>>> 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: Unable to exclude .class files

Posted by Thomas Harris <th...@axispoint.com>.
When Mavenizing an existing project, especially one that is as old as Java, you might find that the prying apart of the ball of mud via major refactoring is a task that a client will not pay for. You still want to Mavenize the project and integrate it into you blah/blah CI process, etc. So, in that case...?

Tom

-----Original Message-----
From: thomas.k.sundberg@gmail.com [mailto:thomas.k.sundberg@gmail.com] On Behalf Of Thomas Sundberg
Sent: Friday, March 05, 2010 4:40 AM
To: Maven Users List
Subject: Re: Unable to exclude .class files

Hi!

You should perhaps even have three projects. One for the common stuff,
one for the specific jar project that depends on the common stuff and
one for the sar project that also depends on the common stuff.

/Thomas

On Fri, Mar 5, 2010 at 10:35, Anders Hammar <an...@hammar.net> wrote:
> No, you should have two separate projects. That's the Maven way - do
> yourself a favor and don't fight it!
>
> /Anders
>
> On Fri, Mar 5, 2010 at 10:11, WriteJava <an...@plus.net> wrote:
>
>>
>> Thanks for your reply Anders, yes I am trying to build both jar and sar
>> within same maven project and I've some java classes which i need to add to
>> sar and exclude others and add them to jar. Is this possible?
>>
>> Thanks
>>
>> Anders Hammar wrote:
>> >
>> > The exclude tag is for specifying artifactId:groupId as stated in the
>> > docs.
>> >
>> > I don't understand why you don't want to include the classes? If you have
>> > a
>> > sar project but don't want to include some classes, why do you have them
>> > in
>> > that project? Or could it be that you're trying to do a jar AND a sar in
>> > the
>> > same Maven project?
>> >
>> > /Anders
>> >
>> > On Thu, Mar 4, 2010 at 17:06, WriteJava <an...@plus.net> wrote:
>> >
>> >>
>> >> Hi,
>> >>
>> >> I am trying to generate a sar file using 'jboss-packaging-maven-plugin'
>> >> plugin and I can't exclude .class files from my sar. It is including all
>> >> classes to sar. Can you please help? Here is my code snippet:
>> >>
>> >>            <plugin>
>> >>                <groupId>org.codehaus.mojo</groupId>
>> >>                <artifactId>jboss-packaging-maven-plugin</artifactId>
>> >>                <version>2.1.1</version>
>> >>                <extensions>true</extensions>
>> >>                <configuration>
>> >>                        <excludes>
>> >>                                <exclude>**/*.class</exclude>
>> >>                        </excludes>
>> >>                </configuration>
>> >>                <executions>
>> >>                    <execution>
>> >>                        <id>sar123</id>
>> >>                        <goals>
>> >>                            <goal>sar</goal>
>> >>                        </goals>
>> >>                        <phase>package</phase>
>> >>                        <configuration>
>> >>                            <archiveName>my-service</archiveName>
>> >>
>> >>
>> >>
>> <deploymentDescriptorFile>${basedir}/conf/mysarMETA-INF/jboss-service.xml</deploymentDescriptorFile>
>> >>                            <primaryArtifact>false</primaryArtifact>
>> >>                        </configuration>
>> >>                    </execution>
>> >>                </executions>
>> >>            </plugin>
>> >>
>> >> Thanks
>> >> --
>> >> View this message in context:
>> >>
>> http://old.nabble.com/Unable-to-exclude-.class-files-tp27782829p27782829.html
>> >> Sent from the Maven - Users mailing list archive at Nabble.com.
>> >>
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> >> For additional commands, e-mail: users-help@maven.apache.org
>> >>
>> >>
>> >
>> >
>>
>> --
>> View this message in context:
>> http://old.nabble.com/Unable-to-exclude-.class-files-tp27782829p27791501.html
>> Sent from the Maven - Users mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>



-- 
Thomas Sundberg
M. Sc. in Computer Science

Mobile: +46 70 767 33 15
Blog: http://thomassundberg.wordpress.com/

---------------------------------------------------------------------
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: Unable to exclude .class files

Posted by Thomas Sundberg <ts...@kth.se>.
Hi!

You should perhaps even have three projects. One for the common stuff,
one for the specific jar project that depends on the common stuff and
one for the sar project that also depends on the common stuff.

/Thomas

On Fri, Mar 5, 2010 at 10:35, Anders Hammar <an...@hammar.net> wrote:
> No, you should have two separate projects. That's the Maven way - do
> yourself a favor and don't fight it!
>
> /Anders
>
> On Fri, Mar 5, 2010 at 10:11, WriteJava <an...@plus.net> wrote:
>
>>
>> Thanks for your reply Anders, yes I am trying to build both jar and sar
>> within same maven project and I've some java classes which i need to add to
>> sar and exclude others and add them to jar. Is this possible?
>>
>> Thanks
>>
>> Anders Hammar wrote:
>> >
>> > The exclude tag is for specifying artifactId:groupId as stated in the
>> > docs.
>> >
>> > I don't understand why you don't want to include the classes? If you have
>> > a
>> > sar project but don't want to include some classes, why do you have them
>> > in
>> > that project? Or could it be that you're trying to do a jar AND a sar in
>> > the
>> > same Maven project?
>> >
>> > /Anders
>> >
>> > On Thu, Mar 4, 2010 at 17:06, WriteJava <an...@plus.net> wrote:
>> >
>> >>
>> >> Hi,
>> >>
>> >> I am trying to generate a sar file using 'jboss-packaging-maven-plugin'
>> >> plugin and I can't exclude .class files from my sar. It is including all
>> >> classes to sar. Can you please help? Here is my code snippet:
>> >>
>> >>            <plugin>
>> >>                <groupId>org.codehaus.mojo</groupId>
>> >>                <artifactId>jboss-packaging-maven-plugin</artifactId>
>> >>                <version>2.1.1</version>
>> >>                <extensions>true</extensions>
>> >>                <configuration>
>> >>                        <excludes>
>> >>                                <exclude>**/*.class</exclude>
>> >>                        </excludes>
>> >>                </configuration>
>> >>                <executions>
>> >>                    <execution>
>> >>                        <id>sar123</id>
>> >>                        <goals>
>> >>                            <goal>sar</goal>
>> >>                        </goals>
>> >>                        <phase>package</phase>
>> >>                        <configuration>
>> >>                            <archiveName>my-service</archiveName>
>> >>
>> >>
>> >>
>> <deploymentDescriptorFile>${basedir}/conf/mysarMETA-INF/jboss-service.xml</deploymentDescriptorFile>
>> >>                            <primaryArtifact>false</primaryArtifact>
>> >>                        </configuration>
>> >>                    </execution>
>> >>                </executions>
>> >>            </plugin>
>> >>
>> >> Thanks
>> >> --
>> >> View this message in context:
>> >>
>> http://old.nabble.com/Unable-to-exclude-.class-files-tp27782829p27782829.html
>> >> Sent from the Maven - Users mailing list archive at Nabble.com.
>> >>
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> >> For additional commands, e-mail: users-help@maven.apache.org
>> >>
>> >>
>> >
>> >
>>
>> --
>> View this message in context:
>> http://old.nabble.com/Unable-to-exclude-.class-files-tp27782829p27791501.html
>> Sent from the Maven - Users mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>



-- 
Thomas Sundberg
M. Sc. in Computer Science

Mobile: +46 70 767 33 15
Blog: http://thomassundberg.wordpress.com/

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


Re: Unable to exclude .class files

Posted by Anders Hammar <an...@hammar.net>.
No, you should have two separate projects. That's the Maven way - do
yourself a favor and don't fight it!

/Anders

On Fri, Mar 5, 2010 at 10:11, WriteJava <an...@plus.net> wrote:

>
> Thanks for your reply Anders, yes I am trying to build both jar and sar
> within same maven project and I've some java classes which i need to add to
> sar and exclude others and add them to jar. Is this possible?
>
> Thanks
>
> Anders Hammar wrote:
> >
> > The exclude tag is for specifying artifactId:groupId as stated in the
> > docs.
> >
> > I don't understand why you don't want to include the classes? If you have
> > a
> > sar project but don't want to include some classes, why do you have them
> > in
> > that project? Or could it be that you're trying to do a jar AND a sar in
> > the
> > same Maven project?
> >
> > /Anders
> >
> > On Thu, Mar 4, 2010 at 17:06, WriteJava <an...@plus.net> wrote:
> >
> >>
> >> Hi,
> >>
> >> I am trying to generate a sar file using 'jboss-packaging-maven-plugin'
> >> plugin and I can't exclude .class files from my sar. It is including all
> >> classes to sar. Can you please help? Here is my code snippet:
> >>
> >>            <plugin>
> >>                <groupId>org.codehaus.mojo</groupId>
> >>                <artifactId>jboss-packaging-maven-plugin</artifactId>
> >>                <version>2.1.1</version>
> >>                <extensions>true</extensions>
> >>                <configuration>
> >>                        <excludes>
> >>                                <exclude>**/*.class</exclude>
> >>                        </excludes>
> >>                </configuration>
> >>                <executions>
> >>                    <execution>
> >>                        <id>sar123</id>
> >>                        <goals>
> >>                            <goal>sar</goal>
> >>                        </goals>
> >>                        <phase>package</phase>
> >>                        <configuration>
> >>                            <archiveName>my-service</archiveName>
> >>
> >>
> >>
> <deploymentDescriptorFile>${basedir}/conf/mysarMETA-INF/jboss-service.xml</deploymentDescriptorFile>
> >>                            <primaryArtifact>false</primaryArtifact>
> >>                        </configuration>
> >>                    </execution>
> >>                </executions>
> >>            </plugin>
> >>
> >> Thanks
> >> --
> >> View this message in context:
> >>
> http://old.nabble.com/Unable-to-exclude-.class-files-tp27782829p27782829.html
> >> Sent from the Maven - Users mailing list archive at Nabble.com.
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >> For additional commands, e-mail: users-help@maven.apache.org
> >>
> >>
> >
> >
>
> --
> View this message in context:
> http://old.nabble.com/Unable-to-exclude-.class-files-tp27782829p27791501.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Unable to exclude .class files

Posted by WriteJava <an...@plus.net>.
Thanks for your reply Anders, yes I am trying to build both jar and sar
within same maven project and I've some java classes which i need to add to
sar and exclude others and add them to jar. Is this possible?

Thanks

Anders Hammar wrote:
> 
> The exclude tag is for specifying artifactId:groupId as stated in the
> docs.
> 
> I don't understand why you don't want to include the classes? If you have
> a
> sar project but don't want to include some classes, why do you have them
> in
> that project? Or could it be that you're trying to do a jar AND a sar in
> the
> same Maven project?
> 
> /Anders
> 
> On Thu, Mar 4, 2010 at 17:06, WriteJava <an...@plus.net> wrote:
> 
>>
>> Hi,
>>
>> I am trying to generate a sar file using 'jboss-packaging-maven-plugin'
>> plugin and I can't exclude .class files from my sar. It is including all
>> classes to sar. Can you please help? Here is my code snippet:
>>
>>            <plugin>
>>                <groupId>org.codehaus.mojo</groupId>
>>                <artifactId>jboss-packaging-maven-plugin</artifactId>
>>                <version>2.1.1</version>
>>                <extensions>true</extensions>
>>                <configuration>
>>                        <excludes>
>>                                <exclude>**/*.class</exclude>
>>                        </excludes>
>>                </configuration>
>>                <executions>
>>                    <execution>
>>                        <id>sar123</id>
>>                        <goals>
>>                            <goal>sar</goal>
>>                        </goals>
>>                        <phase>package</phase>
>>                        <configuration>
>>                            <archiveName>my-service</archiveName>
>>
>>
>> <deploymentDescriptorFile>${basedir}/conf/mysarMETA-INF/jboss-service.xml</deploymentDescriptorFile>
>>                            <primaryArtifact>false</primaryArtifact>
>>                        </configuration>
>>                    </execution>
>>                </executions>
>>            </plugin>
>>
>> Thanks
>> --
>> View this message in context:
>> http://old.nabble.com/Unable-to-exclude-.class-files-tp27782829p27782829.html
>> Sent from the Maven - Users mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
> 
> 

-- 
View this message in context: http://old.nabble.com/Unable-to-exclude-.class-files-tp27782829p27791501.html
Sent from the Maven - Users mailing list archive at Nabble.com.


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


Re: Unable to exclude .class files

Posted by Anders Hammar <an...@hammar.net>.
The exclude tag is for specifying artifactId:groupId as stated in the docs.

I don't understand why you don't want to include the classes? If you have a
sar project but don't want to include some classes, why do you have them in
that project? Or could it be that you're trying to do a jar AND a sar in the
same Maven project?

/Anders

On Thu, Mar 4, 2010 at 17:06, WriteJava <an...@plus.net> wrote:

>
> Hi,
>
> I am trying to generate a sar file using 'jboss-packaging-maven-plugin'
> plugin and I can't exclude .class files from my sar. It is including all
> classes to sar. Can you please help? Here is my code snippet:
>
>            <plugin>
>                <groupId>org.codehaus.mojo</groupId>
>                <artifactId>jboss-packaging-maven-plugin</artifactId>
>                <version>2.1.1</version>
>                <extensions>true</extensions>
>                <configuration>
>                        <excludes>
>                                <exclude>**/*.class</exclude>
>                        </excludes>
>                </configuration>
>                <executions>
>                    <execution>
>                        <id>sar123</id>
>                        <goals>
>                            <goal>sar</goal>
>                        </goals>
>                        <phase>package</phase>
>                        <configuration>
>                            <archiveName>my-service</archiveName>
>
>
> <deploymentDescriptorFile>${basedir}/conf/mysarMETA-INF/jboss-service.xml</deploymentDescriptorFile>
>                            <primaryArtifact>false</primaryArtifact>
>                        </configuration>
>                    </execution>
>                </executions>
>            </plugin>
>
> Thanks
> --
> View this message in context:
> http://old.nabble.com/Unable-to-exclude-.class-files-tp27782829p27782829.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>