You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Randy Xu <r...@post.harvard.edu> on 2005/01/08 01:21:49 UTC

add an exclusion to ${pom.build.sourceDirectory}

I'd like to create a goal that excludes certain source files during compile.

How can I modify ${pom.build.sourceDirectory} to add an exclusion property?

-Randy

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


Re: add an exclusion to ${pom.build.sourceDirectory}

Posted by John Casey <jd...@commonjava.org>.
sounds like you're wanting a <sourceModifications> stanza...like this:

<sourceModifications>
   <sourceModification>
     <className>someClass (can be fake for always modify)</className>
     <excludes>
       <exclude>**/MyPattern*.java</exclude>
     </excludes>
   </sourceModification>
</sourceModifications>

See 
http://maven.apache.org/reference/project-descriptor.html#sourceModifications 
for more.

-john

Randy Xu wrote:
> I'd like to create a goal that excludes certain source files during 
> compile.
> 
> How can I modify ${pom.build.sourceDirectory} to add an exclusion property?
> 
> -Randy
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 
> 


Re: add an exclusion to ${pom.build.sourceDirectory}

Posted by John Casey <jd...@commonjava.org>.
Maybe it would be easier if you split your RMIC target classes into a 
separate project, to be built separately as needed, and include them in 
your tests/application as a separate classpath artifact? This would 
definitely fit the traditional maven approach more closely. The only 
downside I could immediately guess at might be a circular dependency 
between the two projects that might arise, but it might be an option.

Beyond this, you can try programmatically injecting a new 
SourceModification into the project's build (Off the top of my head, I 
think it would be something like addSourceModification() under 
${pom.build}). However, as I mentioned previously, you may have to 
re-establish some of the source-based properties which are initially set 
in the driver.jelly (I think).

Good luck.

-john

P.S. Is there some reason you can't just add rmic to your build process, 
and re-create the stub/skeletons with each build? I'm no RMI 
guru...would this cause too much of a performance penalty on the build? -J

Randy Xu wrote:
> Jason van Zyl wrote:
> 
>> On Sun, 2005-01-09 at 04:14, Randy Xu wrote:
>>
>>  
>>
>>> I just need a goal which will add an exclusion (**/*Bean.java) to 
>>> sourceModifications.  Any idea how to do this?
>>>   
>>
>>
>> First off what is the reason for excluding sources from the build?
>>
>> Strictly platform variances or something else?
>>
>>  
>>
> Some of our modules have classes that need to be post-processed and 
> rmic'ed.  We'd like to not recompile and process those if they didn't 
> change.  In ANT, we had a target of 'compile-minimal'.  They are named a 
> particularly way so it'd be easy enough to exclude them, as long as I 
> can add an exclusion to sourceModifications in a goal.
> 
> -Randy
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 
> 


Re: add an exclusion to ${pom.build.sourceDirectory}

Posted by Randy Xu <r...@post.harvard.edu>.
Jason van Zyl wrote:

>On Sun, 2005-01-09 at 04:14, Randy Xu wrote:
>
>  
>
>>I just need a goal which will add an exclusion (**/*Bean.java) to 
>>sourceModifications.  Any idea how to do this?
>>    
>>
>
>First off what is the reason for excluding sources from the build?
>
>Strictly platform variances or something else?
>
>  
>
Some of our modules have classes that need to be post-processed and 
rmic'ed.  We'd like to not recompile and process those if they didn't 
change.  In ANT, we had a target of 'compile-minimal'.  They are named a 
particularly way so it'd be easy enough to exclude them, as long as I 
can add an exclusion to sourceModifications in a goal.

-Randy

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


Re: add an exclusion to ${pom.build.sourceDirectory}

Posted by Jason van Zyl <jv...@maven.org>.
On Sun, 2005-01-09 at 04:14, Randy Xu wrote:

> I just need a goal which will add an exclusion (**/*Bean.java) to 
> sourceModifications.  Any idea how to do this?

First off what is the reason for excluding sources from the build?

Strictly platform variances or something else?

-- 
jvz.

Jason van Zyl
jason@maven.org
http://maven.apache.org

happiness is like a butterfly: the more you chase it, the more it will
elude you, but if you turn your attention to other things, it will come
and sit softly on your shoulder ...

 -- Thoreau 


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


Re: add an exclusion to ${pom.build.sourceDirectory}

Posted by Randy Xu <r...@post.harvard.edu>.
Yes, sourceModifications is exactly what I need. Actually, I don't need 
to do quite so much as sniff the env and adjust accordingly.

I just need a goal which will add an exclusion (**/*Bean.java) to 
sourceModifications.  Any idea how to do this?

-Randy

John Casey wrote:

> On the off chance you're trying to sniff the environment and adjust 
> accordingly, you can try injecting a new sourceModification 
> programmatically, but you may have to rebuild the 
> compile.src.set...dunno about that. I believe there is (there used to 
> be) a driver.jelly in the maven.jar that builds this stuff up...I once 
> had to duplicate part of this file in my maven.xml to account for 
> ${sourcesPresent}, I think...
>
> Anyway, sorry for the vague post, and good luck.
>
> -john
>
> Randy Xu wrote:
>
>> I'd like to create a goal that excludes certain source files during 
>> compile.
>>
>> How can I modify ${pom.build.sourceDirectory} to add an exclusion 
>> property?
>>
>> -Randy
>>
>> ---------------------------------------------------------------------
>> 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: add an exclusion to ${pom.build.sourceDirectory}

Posted by John Casey <jd...@commonjava.org>.
On the off chance you're trying to sniff the environment and adjust 
accordingly, you can try injecting a new sourceModification 
programmatically, but you may have to rebuild the 
compile.src.set...dunno about that. I believe there is (there used to 
be) a driver.jelly in the maven.jar that builds this stuff up...I once 
had to duplicate part of this file in my maven.xml to account for 
${sourcesPresent}, I think...

Anyway, sorry for the vague post, and good luck.

-john

Randy Xu wrote:
> I'd like to create a goal that excludes certain source files during 
> compile.
> 
> How can I modify ${pom.build.sourceDirectory} to add an exclusion property?
> 
> -Randy
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 
>