Skip to content

Maven plugin that checks whether classpath order may cause problems.

Notifications You must be signed in to change notification settings

ctalau/cporder-maven-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 

Repository files navigation

cporder-maven-plugin Built On CloudBees

This maven plugin checks whether two different maven dependencies with the artifact scope being either compile or runtime and artifact type being jar contain classes with the same (fully qualified) name.

Such a class contained in two jars may cause unexpected runtime behaviour to the application. For example, in the case of an web application, depending on the Servlet container, the classpath may be alphabetically sorted or not, leading to a different version of the class being loaded. Another example of bad behavior is in the case of a Java Applet, where classes from different jars are loaded using different classloader, so both of the classes are loaded at runtime.

Configuration

This plugin executes the verify goal by default in the verify phase of the Maven lifecycle. In order to configure it in the pom.xml file, you should include the following snippet:

<build>
  <plugins>
    <plugin>
      <groupId>com.github.ctalau</groupId>
      <artifactId>cporder-maven-plugin</artifactId>
      <version>1.0</version>
      <executions>
          <execution>
            <id>check-cporder</id>
            <goals>
              <goal>verify</goal>
            </goals>
          </execution>
        </executions>
    </plugin>
  </plugins>
</build>

License

This project is licensed under ASL 2.0.

About

Maven plugin that checks whether classpath order may cause problems.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages