You are viewing a plain text version of this content. The canonical link for it is here.
Posted to m2-dev@maven.apache.org by ev...@apache.org on 2004/07/27 13:49:27 UTC
cvs commit: maven-components/maven-model maven.mdo
evenisse 2004/07/27 04:49:27
Modified: maven-model maven.mdo
Log:
Add **/*Test.java as default value of test includes.
Revision Changes Path
1.49 +15 -0 maven-components/maven-model/maven.mdo
Index: maven.mdo
===================================================================
RCS file: /home/cvs/maven-components/maven-model/maven.mdo,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -r1.48 -r1.49
--- maven.mdo 29 Jun 2004 15:08:22 -0000 1.48
+++ maven.mdo 27 Jul 2004 11:49:27 -0000 1.49
@@ -1128,6 +1128,21 @@
<defaultValue>new ArrayList()</defaultValue>
</field>
</fields>
+ <codeSegments>
+ <codeSegment>
+ <version>3.0.0+</version>
+ <code>
+ public java.util.List getIncludes()
+ {
+ if ( super.getIncludes().size() == 0 )
+ {
+ addInclude( "**/*Test.java" );
+ }
+ return super.getIncludes();
+ }
+ </code>
+ </codeSegment>
+ </codeSegments>
</class>
<class>
<name>Version</name>
Re: cvs commit: maven-components/maven-model maven.mdo
Posted by Jason van Zyl <jv...@maven.org>.
On Tue, 2004-07-27 at 11:00, Emmanuel Venisse wrote:
> > I think that defaults like this should be in [1]. Apparantly this value is
> > already in the super pom and I would guess that there is a problem with
> > the inheritance assembler. My guess would be that it doesn't go deep
> > enough into the pom to check for values.
> >
> > [1]:
> http://cvs.apache.org/viewcvs.cgi/maven-components/maven-core/src/main/resources/org/apache/maven/project/pom.xml
>
> Yes, it's already define in this pom, but if a user want to exclude a test
> like in the resources
> plugin(http://cvs.apache.org/viewcvs.cgi/maven-components/maven-plugins/mave
> n-resources-plugin/pom.xml), he must rewrite the includes part. With my
> modification, it isn't necessary, ant the includes part of default m2 pom
> can be removed.
>
> Do you have a better solution?
Change the inheritance assembler to deal with this appropriately. You
need to step further into the UnitTest object so that you can take the
includes from super model and excludes from the child. The inheritance
just isn't fleshed out completely for the UnitTest object in the
inheritance assembler.
So where you see:
if ( child.getBuild().getUnitTest() == null )
{
child.getBuild().setUnitTest( parent.getBuild().getUnitTest() );
}
add an else clause to deal with a partially populated UnitTest object.
Right now it's all or nothing.
else
{
if child has includes, use it, otherwise take from the parent
if child has excludes, use it, otherwise take from the parent
// you get the idea
}
The policies for inheritance should reside entirely in the inheritance
assembler.
> Emmanuel
>
> >
> > On Tue, Jul 27, 2004 at 11:49:27AM -0000, evenisse@apache.org wrote:
> > > evenisse 2004/07/27 04:49:27
> > >
> > > Modified: maven-model maven.mdo
> > > Log:
> > > Add **/*Test.java as default value of test includes.
> > >
> > > Revision Changes Path
> > > 1.49 +15 -0 maven-components/maven-model/maven.mdo
> > >
> > > Index: maven.mdo
> > > ===================================================================
> > > RCS file: /home/cvs/maven-components/maven-model/maven.mdo,v
> > > retrieving revision 1.48
> > > retrieving revision 1.49
> > > diff -u -r1.48 -r1.49
> > > --- maven.mdo 29 Jun 2004 15:08:22 -0000 1.48
> > > +++ maven.mdo 27 Jul 2004 11:49:27 -0000 1.49
> > > @@ -1128,6 +1128,21 @@
> > > <defaultValue>new ArrayList()</defaultValue>
> > > </field>
> > > </fields>
> > > + <codeSegments>
> > > + <codeSegment>
> > > + <version>3.0.0+</version>
> > > + <code>
> > > + public java.util.List getIncludes()
> > > + {
> > > + if ( super.getIncludes().size() == 0 )
> > > + {
> > > + addInclude( "**/*Test.java" );
> > > + }
> > > + return super.getIncludes();
> > > + }
> > > + </code>
> > > + </codeSegment>
> > > + </codeSegments>
> > > </class>
> > > <class>
> > > <name>Version</name>
> > >
--
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
Re: cvs commit: maven-components/maven-model maven.mdo
Posted by Emmanuel Venisse <em...@venisse.net>.
> I think that defaults like this should be in [1]. Apparantly this value is
> already in the super pom and I would guess that there is a problem with
> the inheritance assembler. My guess would be that it doesn't go deep
> enough into the pom to check for values.
>
> [1]:
http://cvs.apache.org/viewcvs.cgi/maven-components/maven-core/src/main/resources/org/apache/maven/project/pom.xml
Yes, it's already define in this pom, but if a user want to exclude a test
like in the resources
plugin(http://cvs.apache.org/viewcvs.cgi/maven-components/maven-plugins/mave
n-resources-plugin/pom.xml), he must rewrite the includes part. With my
modification, it isn't necessary, ant the includes part of default m2 pom
can be removed.
Do you have a better solution?
Emmanuel
>
> On Tue, Jul 27, 2004 at 11:49:27AM -0000, evenisse@apache.org wrote:
> > evenisse 2004/07/27 04:49:27
> >
> > Modified: maven-model maven.mdo
> > Log:
> > Add **/*Test.java as default value of test includes.
> >
> > Revision Changes Path
> > 1.49 +15 -0 maven-components/maven-model/maven.mdo
> >
> > Index: maven.mdo
> > ===================================================================
> > RCS file: /home/cvs/maven-components/maven-model/maven.mdo,v
> > retrieving revision 1.48
> > retrieving revision 1.49
> > diff -u -r1.48 -r1.49
> > --- maven.mdo 29 Jun 2004 15:08:22 -0000 1.48
> > +++ maven.mdo 27 Jul 2004 11:49:27 -0000 1.49
> > @@ -1128,6 +1128,21 @@
> > <defaultValue>new ArrayList()</defaultValue>
> > </field>
> > </fields>
> > + <codeSegments>
> > + <codeSegment>
> > + <version>3.0.0+</version>
> > + <code>
> > + public java.util.List getIncludes()
> > + {
> > + if ( super.getIncludes().size() == 0 )
> > + {
> > + addInclude( "**/*Test.java" );
> > + }
> > + return super.getIncludes();
> > + }
> > + </code>
> > + </codeSegment>
> > + </codeSegments>
> > </class>
> > <class>
> > <name>Version</name>
> >
Re: cvs commit: maven-components/maven-model maven.mdo
Posted by Trygve Laugstøl <tr...@apache.org>.
I think that defaults like this should be in [1]. Apparantly this value is
already in the super pom and I would guess that there is a problem with
the inheritance assembler. My guess would be that it doesn't go deep
enough into the pom to check for values.
[1]: http://cvs.apache.org/viewcvs.cgi/maven-components/maven-core/src/main/resources/org/apache/maven/project/pom.xml
On Tue, Jul 27, 2004 at 11:49:27AM -0000, evenisse@apache.org wrote:
> evenisse 2004/07/27 04:49:27
>
> Modified: maven-model maven.mdo
> Log:
> Add **/*Test.java as default value of test includes.
>
> Revision Changes Path
> 1.49 +15 -0 maven-components/maven-model/maven.mdo
>
> Index: maven.mdo
> ===================================================================
> RCS file: /home/cvs/maven-components/maven-model/maven.mdo,v
> retrieving revision 1.48
> retrieving revision 1.49
> diff -u -r1.48 -r1.49
> --- maven.mdo 29 Jun 2004 15:08:22 -0000 1.48
> +++ maven.mdo 27 Jul 2004 11:49:27 -0000 1.49
> @@ -1128,6 +1128,21 @@
> <defaultValue>new ArrayList()</defaultValue>
> </field>
> </fields>
> + <codeSegments>
> + <codeSegment>
> + <version>3.0.0+</version>
> + <code>
> + public java.util.List getIncludes()
> + {
> + if ( super.getIncludes().size() == 0 )
> + {
> + addInclude( "**/*Test.java" );
> + }
> + return super.getIncludes();
> + }
> + </code>
> + </codeSegment>
> + </codeSegments>
> </class>
> <class>
> <name>Version</name>
>
>
>