[jira] [Commented] (MPMD-379) Support PMD 7.0.0

2024-04-05 Thread ASF GitHub Bot (Jira)


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

ASF GitHub Bot commented on MPMD-379:
-

lapostoj commented on PR #144:
URL: https://github.com/apache/maven-pmd-plugin/pull/144#issuecomment-2039303886

   @adangel any blocker still with this one or could the plugin be released 
with the PMD 7 support?  




> Support PMD 7.0.0
> -
>
> Key: MPMD-379
> URL: https://issues.apache.org/jira/browse/MPMD-379
> Project: Maven PMD Plugin
>  Issue Type: Improvement
>  Components: CPD, PMD
>Reporter: Andreas Dangel
>Assignee: Andreas Dangel
>Priority: Major
>
> Add support for the new major version of PMD.
> This has some non-backward compatible changes. Upgrading m-pmd-p to PMD 7 
> most likely means, that only PMD 7 will be supported onwards (no backwards 
> compatibility supported).
> wip branch: [https://github.com/apache/maven-pmd-plugin/compare/master...pmd7]
>  
> A snapshot version that is compatible with the current 7.0.0 release 
> candidates is available here as version {*}3.21.1-pmd-7-SNAPSHOT{*}:
> {code:java}
> 
> apache.snapshots
> Apache Snapshot Repository
> https://repository.apache.org/snapshots
> 
> false
> 
> 
> true
> 
>  {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MPMD-379) Support PMD 7.0.0

2024-04-03 Thread Gary D. Gregory (Jira)


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

Gary D. Gregory commented on MPMD-379:
--

Any release plans you can share?

 

> Support PMD 7.0.0
> -
>
> Key: MPMD-379
> URL: https://issues.apache.org/jira/browse/MPMD-379
> Project: Maven PMD Plugin
>  Issue Type: Improvement
>  Components: CPD, PMD
>Reporter: Andreas Dangel
>Assignee: Andreas Dangel
>Priority: Major
>
> Add support for the new major version of PMD.
> This has some non-backward compatible changes. Upgrading m-pmd-p to PMD 7 
> most likely means, that only PMD 7 will be supported onwards (no backwards 
> compatibility supported).
> wip branch: [https://github.com/apache/maven-pmd-plugin/compare/master...pmd7]
>  
> A snapshot version that is compatible with the current 7.0.0 release 
> candidates is available here as version {*}3.21.1-pmd-7-SNAPSHOT{*}:
> {code:java}
> 
> apache.snapshots
> Apache Snapshot Repository
> https://repository.apache.org/snapshots
> 
> false
> 
> 
> true
> 
>  {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MPMD-379) Support PMD 7.0.0

2024-03-22 Thread ASF GitHub Bot (Jira)


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

ASF GitHub Bot commented on MPMD-379:
-

mkolesnikov commented on code in PR #144:
URL: https://github.com/apache/maven-pmd-plugin/pull/144#discussion_r1535384167


##
src/main/java/org/apache/maven/plugins/pmd/exec/PmdExecutor.java:
##
@@ -190,7 +189,7 @@ private PmdResult run() throws MavenReportException {
 configuration.setRuleSets(request.getRulesets());
 
configuration.setMinimumPriority(RulePriority.valueOf(request.getMinimumPriority()));
 if (request.getBenchmarkOutputLocation() != null) {
-configuration.setBenchmark(true);
+TimeTracker.startGlobalTracking();

Review Comment:
   I copied it from `PmdCli.java`  the --benchmark option is still there.





> Support PMD 7.0.0
> -
>
> Key: MPMD-379
> URL: https://issues.apache.org/jira/browse/MPMD-379
> Project: Maven PMD Plugin
>  Issue Type: Improvement
>  Components: CPD, PMD
>Reporter: Andreas Dangel
>Assignee: Andreas Dangel
>Priority: Major
>
> Add support for the new major version of PMD.
> This has some non-backward compatible changes. Upgrading m-pmd-p to PMD 7 
> most likely means, that only PMD 7 will be supported onwards (no backwards 
> compatibility supported).
> wip branch: [https://github.com/apache/maven-pmd-plugin/compare/master...pmd7]
>  
> A snapshot version that is compatible with the current 7.0.0 release 
> candidates is available here as version {*}3.21.1-pmd-7-SNAPSHOT{*}:
> {code:java}
> 
> apache.snapshots
> Apache Snapshot Repository
> https://repository.apache.org/snapshots
> 
> false
> 
> 
> true
> 
>  {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MPMD-379) Support PMD 7.0.0

2024-03-21 Thread ASF GitHub Bot (Jira)


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

ASF GitHub Bot commented on MPMD-379:
-

adangel commented on code in PR #144:
URL: https://github.com/apache/maven-pmd-plugin/pull/144#discussion_r1534120578


##
pom.xml:
##
@@ -83,7 +83,7 @@ under the License.
   
 3.2.5
 8
-6.55.0
+7.0.0-rc4

Review Comment:
   I'm going to release PMD 7.0.0 tomorrow. After that, we can use directly 
7.0.0 here.
   Note, that there will be a few more changes required...
   
   Also, please add a new row in 
https://github.com/apache/maven-pmd-plugin/blob/master/src/site/apt/examples/upgrading-PMD-at-runtime.apt.vm#L91
 
   This should document the default pmd version, that is used by 
maven-pmd-plugin - and this is determined by this property here.



##
src/it/MPMD-244-logging/verify.groovy:
##
@@ -20,12 +20,13 @@
 File buildLog = new File( basedir, 'build.log' )
 assert buildLog.exists()
 assert buildLog.text.contains( "PMD processing errors" )
-assert buildLog.text.contains( "Error while parsing" )
+assert buildLog.text.contains( "Parse exception in file" )
 
 String disabledPath = new File( basedir, 
'logging-disabled/src/main/java/BrokenFile.java' ).getCanonicalPath()
 String enabledPath = new File( basedir, 
'logging-enabled/src/main/java/BrokenFile.java' ).getCanonicalPath()
 
 // logging disabled: the pmd exception is only output through the processing 
error reporting (since MPMD-246)
-assert 1 == buildLog.text.count( "net.sourceforge.pmd.PMDException: Error 
while parsing ${disabledPath}" )
+assert 1 == buildLog.text.count( "net.sourceforge.pmd.lang.ast.ParseException: 
Parse exception in file \'${disabledPath}\'" )
 // logging enabled: the pmd exception is output twice: through the processing 
error reporting (since MPMD-246) and through PMD's own logging
-assert 2 == buildLog.text.count( "net.sourceforge.pmd.PMDException: Error 
while parsing ${enabledPath}" )
+// not true anymore, logged always once
+assert 1 == buildLog.text.count( "net.sourceforge.pmd.lang.ast.ParseException: 
Parse exception in file \'${enabledPath}\'" )

Review Comment:
   I think, this deserves a little bit more work. I noted in my personal branch:
   
   ```
   // build.log contains the logging from the two PMD executions
   // only one execution has logging enabled, so we expect only one log output
   // TODO assert 1 == buildLog.text.count( "[DEBUG] Rules loaded from" )
   // TODO logging is always enabled and can't be disabled, because PMD 7 
switched to slf4j
   ```
   
   Which essentially means, that the property 
[showPmdLog](https://maven.apache.org/plugins/maven-pmd-plugin/pmd-mojo.html#showPmdLog)
 is broken now. Either we need to deprecate it and eventually remove it, or we 
need to fix it.
   



##
src/main/java/org/apache/maven/plugins/pmd/ExcludeViolationsFromFile.java:
##
@@ -84,8 +84,10 @@ public boolean isExcludedFromFailure(final Violation 
errorDetail) {
  * @return true if the violation should be excluded, 
false otherwise.
  */
 public boolean isExcludedFromFailure(final RuleViolation errorDetail) {
-final String className =
-extractClassName(errorDetail.getPackageName(), 
errorDetail.getClassName(), errorDetail.getFilename());
+final String className = extractClassName(
+errorDetail.getPackageName(),
+errorDetail.getClassName(),
+errorDetail.getFileId().getAbsolutePath());

Review Comment:
   This will change in final PMD 7.0.0, see here for the needed change:
   
   
https://github.com/apache/maven-pmd-plugin/blob/02910c902b168ce14ef948d65db7b239a5ee56c4/src/main/java/org/apache/maven/plugins/pmd/ExcludeViolationsFromFile.java#L87-L92
   



##
src/main/java/org/apache/maven/plugins/pmd/exec/PmdExecutor.java:
##
@@ -190,7 +189,7 @@ private PmdResult run() throws MavenReportException {
 configuration.setRuleSets(request.getRulesets());
 
configuration.setMinimumPriority(RulePriority.valueOf(request.getMinimumPriority()));
 if (request.getBenchmarkOutputLocation() != null) {
-configuration.setBenchmark(true);
+TimeTracker.startGlobalTracking();

Review Comment:
   Does this feature still work? It is enabled with the property 
[benchmark](https://maven.apache.org/plugins/maven-pmd-plugin/pmd-mojo.html#benchmark)



##
src/it/MPMD-258-multiple-executions/invoker.properties:
##
@@ -15,5 +15,6 @@
 # specific language governing permissions and limitations
 # under the License.
 
+invoker.debug = true

Review Comment:
   this might not be needed?
   
   Update: ok, yes it is needed. Can you please update verify.groovy for this 
test to explain it, similar what I have done here:
   
   

[jira] [Commented] (MPMD-379) Support PMD 7.0.0

2024-01-18 Thread Andreas Dangel (Jira)


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

Andreas Dangel commented on MPMD-379:
-

[~chonton] In order to use PMD 7.0.0-rc4 (and later) with maven-pmd-plugin, 
please follow the instructions at [pmd/pmd#4478 
(comment)|https://github.com/pmd/pmd/discussions/4478#discussioncomment-7607566]

> Support PMD 7.0.0
> -
>
> Key: MPMD-379
> URL: https://issues.apache.org/jira/browse/MPMD-379
> Project: Maven PMD Plugin
>  Issue Type: Improvement
>  Components: CPD, PMD
>Reporter: Andreas Dangel
>Assignee: Andreas Dangel
>Priority: Major
>
> Add support for the new major version of PMD.
> This has some non-backward compatible changes. Upgrading m-pmd-p to PMD 7 
> most likely means, that only PMD 7 will be supported onwards (no backwards 
> compatibility supported).
> wip branch: [https://github.com/apache/maven-pmd-plugin/compare/master...pmd7]
>  
> A snapshot version that is compatible with the current 7.0.0 release 
> candidates is available here as version {*}3.21.1-pmd-7-SNAPSHOT{*}:
> {code:java}
> 
> apache.snapshots
> Apache Snapshot Repository
> https://repository.apache.org/snapshots
> 
> false
> 
> 
> true
> 
>  {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MPMD-379) Support PMD 7.0.0

2023-12-29 Thread Charles Honton (Jira)


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

Charles Honton commented on MPMD-379:
-

[PMD 
7.0.0-rc4|https://repo1.maven.org/maven2/net/sourceforge/pmd/pmd/7.0.0-rc4/] 
has been 
[released|https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_release_notes_pmd7.html].
  Is anything blocking release of this support?

(I really want to get onto Java21)

> Support PMD 7.0.0
> -
>
> Key: MPMD-379
> URL: https://issues.apache.org/jira/browse/MPMD-379
> Project: Maven PMD Plugin
>  Issue Type: Improvement
>  Components: CPD, PMD
>Reporter: Andreas Dangel
>Assignee: Andreas Dangel
>Priority: Major
>
> Add support for the new major version of PMD.
> This has some non-backward compatible changes. Upgrading m-pmd-p to PMD 7 
> most likely means, that only PMD 7 will be supported onwards (no backwards 
> compatibility supported).
> wip branch: [https://github.com/apache/maven-pmd-plugin/compare/master...pmd7]
>  
> A snapshot version that is compatible with the current 7.0.0 release 
> candidates is available here as version {*}3.21.1-pmd-7-SNAPSHOT{*}:
> {code:java}
> 
> apache.snapshots
> Apache Snapshot Repository
> https://repository.apache.org/snapshots
> 
> false
> 
> 
> true
> 
>  {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MPMD-379) Support PMD 7.0.0

2023-05-22 Thread Andreas Dangel (Jira)


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

Andreas Dangel commented on MPMD-379:
-

This is currently needed in two cases: When toolchain is used, then PMD is not 
invoked within the current JVM process, but a new one is spawned. This is, what 
Executor#setupLogLevel is responsible for - recreating the environment, that 
maven cli already provided, in the new process.

 

The other case is the parameter {{showPmdLog}} - if this is true, then any 
slf4j log message from within PMD should show up as usual. But if this is set 
to false, then we want to silence out any PMD logging. Since this parameter can 
be true for one module and false for another, the log levels needs to switch at 
runtime if no toolchain is in use. This is what Executor#setupPmdLogging is 
doing.

We could however decide, to remove this parameter and keep the logging enabled 
all the time. That would make it easier. Are there any best practices on how to 
deal with logs from third-party-libs (in that case, PMD is a 3rd-party lib to 
maven)? If one wanted to silence out the logging from PMD, then one could 
change maven's simplelogger.properties (or provide equivalent system properties 
via MAVEN_OPTS).

 

> Support PMD 7.0.0
> -
>
> Key: MPMD-379
> URL: https://issues.apache.org/jira/browse/MPMD-379
> Project: Maven PMD Plugin
>  Issue Type: Improvement
>  Components: CPD, PMD
>Reporter: Andreas Dangel
>Assignee: Andreas Dangel
>Priority: Major
>
> Add support for the new major version of PMD.
> This has some non-backward compatible changes. Upgrading m-pmd-p to PMD 7 
> most likely means, that only PMD 7 will be supported onwards (no backwards 
> compatibility supported).
> wip branch: [https://github.com/apache/maven-pmd-plugin/compare/master...pmd7]
>  
> A snapshot version that is compatible with the current 7.0.0 release 
> candidates is available here as version {*}3.21.1-pmd-7-SNAPSHOT{*}:
> {code:java}
> 
> apache.snapshots
> Apache Snapshot Repository
> https://repository.apache.org/snapshots
> 
> false
> 
> 
> true
> 
>  {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MPMD-379) Support PMD 7.0.0

2023-05-21 Thread Michael Osipov (Jira)


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

Michael Osipov commented on MPMD-379:
-

I checked {{src/main/java/org/apache/maven/plugins/pmd/exec/Executor.java}}. 
Why is this entire logging pain necessary? I mean SLF4J logger and done. The 
rest is up to the client, no?

> Support PMD 7.0.0
> -
>
> Key: MPMD-379
> URL: https://issues.apache.org/jira/browse/MPMD-379
> Project: Maven PMD Plugin
>  Issue Type: Improvement
>  Components: CPD, PMD
>Reporter: Andreas Dangel
>Assignee: Andreas Dangel
>Priority: Major
>
> Add support for the new major version of PMD.
> This has some non-backward compatible changes. Upgrading m-pmd-p to PMD 7 
> most likely means, that only PMD 7 will be supported onwards (no backwards 
> compatibility supported).
> wip branch: [https://github.com/apache/maven-pmd-plugin/compare/master...pmd7]
>  
> A snapshot version that is compatible with the current 7.0.0 release 
> candidates is available here as version {*}3.21.1-pmd-7-SNAPSHOT{*}:
> {code:java}
> 
> apache.snapshots
> Apache Snapshot Repository
> https://repository.apache.org/snapshots
> 
> false
> 
> 
> true
> 
>  {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MPMD-379) Support PMD 7.0.0

2023-05-19 Thread Michael Osipov (Jira)


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

Michael Osipov commented on MPMD-379:
-

If this is not a compatible change it should wait for the next major which I 
want to release in the summer.

> Support PMD 7.0.0
> -
>
> Key: MPMD-379
> URL: https://issues.apache.org/jira/browse/MPMD-379
> Project: Maven PMD Plugin
>  Issue Type: Improvement
>  Components: CPD, PMD
>Reporter: Andreas Dangel
>Assignee: Andreas Dangel
>Priority: Major
> Fix For: 3.21.1
>
>
> Add support for the new major version of PMD.
> This has some non-backward compatible changes. Upgrading m-pmd-p to PMD 7 
> most likely means, that only PMD 7 will be supported onwards (no backwards 
> compatibility supported).
> wip branch: https://github.com/apache/maven-pmd-plugin/compare/master...pmd7



--
This message was sent by Atlassian Jira
(v8.20.10#820010)