[ 
https://issues.apache.org/jira/browse/MPMD-278?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16812655#comment-16812655
 ] 

Andreas Dangel commented on MPMD-278:
-------------------------------------

It depends on what you want to achieve with "aggregate=true"...

The issue is, that PMD needs a compiled project, so you need to make sure, you 
have the project at least compiled before executing the m-pmd-p with 
aggregate=true. If you do this, then it's fine. It involves however to maven 
executions: e.g. {{mvn clean package}} and then {{mvn verify}} (note: the 
second execution does not include clean).

Since you use the check goal, I assume, you want to have the build just failed, 
if a violation is found. In that case, I would recommend to *not* use 
aggregate=true and let just build module by module - and the build will stop at 
the first module with a violation.

However, if you e.g. execute {{mvn deploy}}, then you could end up with some 
modules deployed to the repository, but some are not (because the build failed 
somewhere in the middle) - this might create a inconsistent state. Then you 
need to use either a CI server, that deploys the artifacts after all modules 
have been successfully built or use the nexus staging plugin or use the [deploy 
at 
end|https://maven.apache.org/plugins/maven-deploy-plugin/deploy-mojo.html#deployAtEnd]
 property of the maven deploy plugin.

I'm closing this issue now as a duplicate of MPMD-277.

> pmd-plugin 3.11.0 fails in multi module release builds
> ------------------------------------------------------
>
>                 Key: MPMD-278
>                 URL: https://issues.apache.org/jira/browse/MPMD-278
>             Project: Maven PMD Plugin
>          Issue Type: Bug
>          Components: PMD
>    Affects Versions: 3.11.0
>            Reporter: Andreas Müller
>            Priority: Major
>
> When using maven-pmd-plugin 3.11.0 the pmd plugin fails in release builds of 
> multi module maven projects:
> {noformat}[INFO] [ERROR] Failed to execute goal 
> org.apache.maven.plugins:maven-pmd-plugin:3.11.0:pmd (pmd) on project xxx: 
> Execution pmd of goal org.apache.maven.plugins:maven-pmd-plugin:3.11.0:pmd 
> failed: 
> org.apache.maven.reporting.MavenReportException: 
> org.eclipse.aether.resolution.DependencyResolutionException: 
> Could not find artifact xxx:jar:<Version that will be released> in <remote 
> maven repository> -> [Help 1]
> {noformat}
> or 
> {noformat}[INFO] [ERROR] Failed to execute goal 
> org.apache.maven.plugins:maven-pmd-plugin:3.11.0:pmd (pmd) on project xxx: 
> Execution pmd of goal org.apache.maven.plugins:maven-pmd-plugin:3.11.0:pmd 
> failed: 
> rg.apache.maven.reporting.MavenReportException: 
> org.eclipse.aether.resolution.DependencyResolutionException: 
> Failure to find xxx:jar:<Version that will be released> in <remote maven 
> repository> was cached in the local repository, 
> resolution will not be reattempted until the update interval of <remote repo> 
> has elapsed or updates are forced -> [Help 1]{noformat}
> Normal build are working fine.
> I guess the problem is that the plugin is looking for the released version in 
> the remote repository before it's actually transferred after the successful 
> release.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to