Giter VIP home page Giter VIP logo

contentcheck-maven-plugin's People

Contributors

dagi avatar dependabot[bot] avatar liry avatar martiner avatar pkozelka avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

contentcheck-maven-plugin's Issues

Detection of duplicit entris

It could be also useful to have an option to check that an archive contains duplicated files on different locations, i mean especially JARs on different locations.

NPE when contentListing is not specified

stacktrace:

java.lang.NullPointerException
    at net.kozelka.contentcheck.mojo.ContentCheckMojo.doExecute(ContentCheckMojo.java:58)
    at net.kozelka.contentcheck.mojo.AbstractArchiveContentMojo.execute(AbstractArchiveContentMojo.java:75)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:133)
    ... 20 more

add mojo to detect class, package and resource conflicts against module dependencies

useful for

  • preparing modules for package sealing
  • detect and eliminate classpath problems caused by carelessly added dependencies

expected features:

  • should fail after detecting (and logging) all problems
  • log output should make it clear in which order the conflicting resources appear on classpath
  • configurable behavior - some classes are intentionally duplicated on classpath
  • by default, seek conflicts only for "*/.class" resources (because other resources are often designed to appear multiple times)
  • by default, any conflict should fail the build - but this behavior must be configurable

implementation considerations:

  • when used on many modules, the content of many dependencies would be searched again and again even if unchanged
  • therefore it seems to make sense to cache the data in a (configurable) shared location, by default something like ${user.home}/.m2/something
  • an embedded database (hsqldb, h2database, derby, ...) might be a good mean for such storage
  • remember to support concurrent access to the storage

implement "skip" parameter to disable checking in certain builds

such a functionality can be generally useful.
Right now my use-case is to skip checking when used in clover-enabled build; that causes clover.jar to be included in the war.
The dirty workarround is to add clover.jar as approved, but the skip would allow keeping the approval list clean.

Another solution to my case could be to maintain a "devel-ignore" list; it would allow to ignore some files when building snapshot, but for release build, they will cause failure.

add support for hash checking of jars

Use either MD5 or SHA1 hash to check integrity of the included files.
This can discover differences caused by improper modifications in nexus caches (or others).

keep maven dependencies in 'mojo' subpackage

it is ok to work with maven model classes outside, but using log or other pieces of plugin api prevents good structuring of the code in minimalistic dependencies in mind.
Think about targeting ant, cli, and other hosting platforms.

WAR conflicts: include WAR classes in the conflict check

Currently, the conflict checker ignores the fact that the war file itself can contain classes that may potentially conflict with those in jar files.

On implementation side, this will require storing more information about a resource:

  • its location in the containing archive (which, for war files, is prepended by WEB-INF/classes/)
  • location to match against others, to see the conflict (simply without the prefix)

conflict check: add includes/excludes support

currently the only way how to tolerate some files with conflict is to specify number of allowed conflicts.

This is insufficient, and in teams with weaker code review habits it does not work in a way allowing step-by-step conflict reduction.

Adding a way to explicitly list which conflicts to allow might slightly help in such situation.

use content checking for contentcheck plugin itself, as one of junit tests

how it should work:

  • pom.xml will package all project dependencies into a zip, with antrun fragment attached to phase "process-test-classes" (to make testcompilation fail fast)
  • one of junit tests will use this zip with one or more content listing resources to perform checks

In result, this will:

  • allow us to use quite a big zip in unittests, without having to commit a big binary
  • keep control on dependency graph of the plugin itself - not exactly important but stylish ;)

NPE when ignoreVendorArchives=true and no vendorId specified

Stacktrace:

Caused by: java.lang.NullPointerException
    at net.kozelka.contentcheck.introspection.AbstractIntrospector.checkArchiveManifest(AbstractIntrospector.java:163)
    at net.kozelka.contentcheck.introspection.AbstractIntrospector.isVendorArchive(AbstractIntrospector.java:143)
    at net.kozelka.contentcheck.introspection.AbstractIntrospector.readEntries(AbstractIntrospector.java:72)
    at net.kozelka.contentcheck.mojo.ContentListingGeneratorMojo.doExecute(ContentListingGeneratorMojo.java:36)
    at net.kozelka.contentcheck.mojo.AbstractArchiveContentMojo.execute(AbstractArchiveContentMojo.java:75)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:133)
    ... 20 more

conflict check: distinguish between serious conflicts and duplicates

A conflict is just a duplicate when conflicting classes are exactly the same. This indicates that a component (somewhere in the dependency graph) has unclean design or build, but is quite harmless in runtime.

A conflict is serious when conflicting classes (or resources in general) are different. Then the order within classloader decides which one will be effective, and that order is frequently not reliable.

Serious conflicts - as defined here - increase risk of non-reproducible behavior.

allow own modules in approved-content.txt

Now it is not possible to properly control which project modules get into the webapp.
This is because their filename typically contains the "-SNAPSHOT" suffix, which changes during release.

This could be solved by inventing a special syntax, perhaps like

.module groupId:artifactId:classifier:type

which does not need changing with version changes.

This of course relies on availability of matching data in container JAR's manifest, or maven property files.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.