I just discovered the hard way (on a plane) that maven plugin sites
can't be built offline at all because of the hard reference to the
config file:
 
      <plugin>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <configuration>
 
<configLocation>http://svn.apache.org/repos/asf/maven/plugins/trunk/ma
ven-checkstyle-plugin/src/main/resources/config/maven_checks.xml</config
Location
>
 
<headerLocation>http://svn.apache.org/repos/asf/maven/plugins/trunk/ma
ven-checkstyle-plugin/src/main/resources/config/maven-header.txt</header
Location
>
        </configuration>
      </plugin>
 
 
We have our own custom config file in my corp build, but we package the
file in a jar and then make that file available on the test classpath.
The configLocation to do this simply names the xml file to find and it
will be pulled from the classpath. Assuming you have already built
online, this jar will be available in your local repository, allowing
offline builds. This is just a side-effect of the real reason I opted to
put ours in a jar: versioning. This way a given build of code requires a
certain checkstyle and this allows us to migrate our checks but still
build old code successfully (or tighten checks on new releases over
time). Another side-benefit of this is the reduced build time because it
doesn't have to go hit the http server every time. (note, i do the same
thing for my pmd rulesets, actually they are in the same artifact)
 
Does anyone see a drawback to doing this for maven itself? I'd volunteer
to help make the changes but I don't think I have karma to touch maven
core where the pom seems to live.
 
 

Reply via email to