Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The <code>bannedDependencies</code> snippet in the question above does not work because of the fact that the <code>&lt;include&gt;</code> tag does not understand the <code>groupId:artifactId:version:type</code> notation. Thus, wildcard cannot be used to replace whole sections to convey <code>include all versions of ALL artifacts in a group</code>. </p> <p>However, by using the maven <a href="http://docs.codehaus.org/display/MAVEN/Dependency+Mediation+and+Conflict+Resolution#DependencyMediationandConflictResolution-DependencyVersionRanges" rel="nofollow">Dependency Version Range</a> it is possible to enforce a specific dependency.</p> <p>Given the following versions of a given artifact (in the order that they were released):</p> <p><code>3.0.0</code> , <code>3.0.1</code> , <code>3.1.0</code>, <code>3.2.0.RELEASE</code>, <code>3.3.0</code></p> <p>let's say we want to tell the enforcer plugin to exclude everything but <code>3.2.0.RELEASE</code> then the only way to do that is :</p> <p><code>exclude versions X where X &lt; DESIRED_VERSION OR X &gt; DESIRED VERSION</code></p> <p>The above would effectively mean : <code>exclude all versions X where X != DESIRED_VERSION</code></p> <p>Since the maven dependency version notation does not permit a 'Not Version' notation, we have to make do with using the less than and greater than notations in combination like so:</p> <p><code>(,3.2.0.RELEASE),(3.2.0.RELEASE,)</code></p> <p>which means: <code>version &lt; '3.2.0.RELEASE' or version &gt; '3.2.0.RELEASE'</code>.</p> <p>Finally, a snippet of what works is as follows:</p> <pre><code>&lt;bannedDependencies&gt; &lt;searchTransitive&gt;true&lt;/searchTransitive&gt; &lt;excludes&gt; &lt;exclude&gt;org.springframework:*:(,${spring.version}),(${spring.version},)&lt;/exclude&gt; &lt;/excludes&gt; &lt;/bannedDependencies&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload