Hi Hilco,
The enforcer plugin requirePluginVersions rule intentionally scans
everything in your pom inheritance to see anything that isn't defined.
This also includes things you haven't declared but are being used by the
standard lifecycle (compile,install etc etc). The alternative is that
everytime you tried something new, it would complain about the version.
It also doesn't care if the profile is active or not, if you declare a
plugin without a version anywhere...the enforcer will punch you in the
face.

There is one known issue right now and that's when you run mvn site. It
gets confused because mvn injects the reporting plugins into the project
as plugins and since I'm not currently scanning the reporing
declarations, it incorrectly says they aren't locked down. Once I get
time to fix this, I'll be putting out 1.0.

--Brian

-----Original Message-----
From: Hilco Wijbenga [mailto:[EMAIL PROTECTED] 
Sent: Thursday, January 10, 2008 8:06 PM
To: Maven Developers List
Subject: Maven Enforcer Plugin

I ran into some issues with the Maven Enforcer plugin. Since I'm using
the latest and greatest straight from Subversion I didn't want to
create a JIRA ticket without first making sure that that would be
helpful.

Given that 1.0-alpha-3 doesn't support requirePluginVersions I want to
use 1.0-SNAPSHOT. However, I don't want to force other developers to
install the Enforcer locally (I haven't set up a mirror repository
yet) so I figured I'd use a profile. As it turns out, however, if I
put m-e-p in a profile like so

<profile>
  <id>enforce</id>
  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-enforcer-plugin</artifactId>
          <version>1.0-Local-1</version>
          <executions>...</executions>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
        <version>1.0-Local-1</version>
      </plugin>
    </plugins>
  </build>
</profile>

and then run something like "mvn compile -Penforce", it fails because
the Compiler plugin has not been explicitely set. Perfect.

However, once its version has been specified (and those for the Site,
Install, Deploy, Compiler, Jar, Surefire, Resources, and Clean
plugins), the Enforcer *still* complains ... about its own version!
Even though I've specified it in two places. Removing the profile part
and putting the Enforcer straight into the <build>...</build> works,
though.

So this leads me to two questions:

1. Why do I have to specify seemingly unrelated plugins when only
requesting the Compiler plugin? (This is not a big deal, of course,
I'll have to set their versions anyway.)
2. Should the profile set up work?

Cheers,
Hilco

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to