+1 to remove this "feature". A module is expected to build either with it's parent POM in parent directory or by donwloading it from repo, so relying on such * search-in-parent-folder* feature is a bad practice.
Nicolas 2010/6/3 Olivier Lamy <[email protected]> > Hi, > We are two who don't like this hack :-) > So what's about don't support this ? > Others ? > > 2010/6/3 <[email protected]>: > > Author: dkulp > > Date: Thu Jun 3 13:28:57 2010 > > New Revision: 950989 > > > > URL: http://svn.apache.org/viewvc?rev=950989&view=rev > > Log: > > Fix the checkstyle it tests. > > This is really a complete hack to support MCHECKSTYLE-131 which, IMO, > should not be supported. Just because it worked at one point despite not > falling into the documented and supported use cases does not, to me, mean we > should really support it. > > > > Modified: > > > > maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/DefaultCheckstyleExecutor.java > > > > Modified: > maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/DefaultCheckstyleExecutor.java > > URL: > http://svn.apache.org/viewvc/maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/DefaultCheckstyleExecutor.java?rev=950989&r1=950988&r2=950989&view=diff > > > ============================================================================== > > --- > maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/DefaultCheckstyleExecutor.java > (original) > > +++ > maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/DefaultCheckstyleExecutor.java > Thu Jun 3 13:28:57 2010 > > @@ -31,6 +31,7 @@ import java.util.List; > > import java.util.Properties; > > > > import org.apache.maven.artifact.DependencyResolutionRequiredException; > > +import org.apache.maven.project.MavenProject; > > import org.codehaus.plexus.logging.AbstractLogEnabled; > > import org.codehaus.plexus.resource.ResourceManager; > > import > org.codehaus.plexus.resource.loader.FileResourceCreationException; > > @@ -454,12 +455,16 @@ public class DefaultCheckstyleExecutor > > { > > getLogger().debug( "request.getConfigLocation() " + > request.getConfigLocation() ); > > } > > - File parent = > request.getProject().getFile().getParentFile(); > > - if (parent != null) > > - { > > - // MCHECKSTYLE-131 ( olamy ) I don't like this hack. > what's happened if this is defined in parent/parent pom > > - // it will breaks > > - locator.addSearchPath( FileResourceLoader.ID, > request.getProject().getFile().getParentFile().getAbsolutePath() ); > > + > > + MavenProject parent = request.getProject(); > > + while ( parent != null && parent.getFile() != null ) > > + { > > + // MCHECKSTYLE-131 ( olamy ) I don't like this hack. > > + // (dkulp) Me either. It really pollutes the location > stuff > > + // by allowing searches of stuff outside the current > module. > > + File dir = parent.getFile().getParentFile(); > > + locator.addSearchPath( FileResourceLoader.ID, > dir.getAbsolutePath() ); > > + parent = parent.getParent(); > > } > > locator.addSearchPath( "url", "" ); > > > > > > > > > > > > -- > Olivier > http://twitter.com/olamy > http://fr.linkedin.com/in/olamy > http://www.viadeo.com/fr/profile/olivier.lamy7 > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > >
