Coder Social home page Coder Social logo

Comments (8)

ChristianWulf avatar ChristianWulf commented on July 19, 2024

Use IResourceChangeListener. See https://www.eclipse.org/forums/index.php/t/102344/

from qa-eclipse-plugin.

ChristianWulf avatar ChristianWulf commented on July 19, 2024

Problem: a save triggers also a maven build which in turn triggers further change events:

source: org.eclipse.core.internal.resources.Workspace@575754d5
buildKind: 0
file: L/teetime/src/main/java/teetime/example/ParallelCounterConfig.java
org.eclipse.core.internal.resources.MarkerDelta@14da724f: Marker [on: /teetime/src/main/java/teetime/example/ParallelCounterConfig.java, id: 11485, type: pmd.eclipse.plugin.markers.violation, attributes: [lineNumber: 15, message: To avoid mistakes add a comment at the beginning of the element field if you want a default access modifier, pmd.priority: 3, pmd.rulename: CommentDefaultAccessModifier, pmd.rulesetname: Comments], created: 22.11.17 21:20], kind=4
org.eclipse.core.internal.resources.MarkerDelta@7722c5cf: Marker [on: /teetime/src/main/java/teetime/example/ParallelCounterConfig.java, id: 11486, type: pmd.eclipse.plugin.markers.violation, attributes: [lineNumber: 28, message: Avoid instantiating new objects inside loops, pmd.priority: 3, pmd.rulename: AvoidInstantiatingObjectsInLoops, pmd.rulesetname: Optimization], created: 22.11.17 21:20], kind=4
org.eclipse.core.internal.resources.MarkerDelta@1b02bea: Marker [on: /teetime/src/main/java/teetime/example/ParallelCounterConfig.java, id: 11487, type: pmd.eclipse.plugin.markers.violation, attributes: [lineNumber: 29, message: Avoid instantiating new objects inside loops, pmd.priority: 3, pmd.rulename: AvoidInstantiatingObjectsInLoops, pmd.rulesetname: Optimization], created: 22.11.17 21:20], kind=4
org.eclipse.core.internal.resources.MarkerDelta@3f5f4e62: Marker [on: /teetime/src/main/java/teetime/example/ParallelCounterConfig.java, id: 11488, type: pmd.eclipse.plugin.markers.violation, attributes: [lineNumber: 30, message: Avoid instantiating new objects inside loops, pmd.priority: 3, pmd.rulename: AvoidInstantiatingObjectsInLoops, pmd.rulesetname: Optimization], created: 22.11.17 21:20], kind=4
org.eclipse.core.internal.resources.MarkerDelta@78501bcc: Marker [on: /teetime/src/main/java/teetime/example/ParallelCounterConfig.java, id: 11489, type: pmd.eclipse.plugin.markers.violation, attributes: [lineNumber: 39, message: Avoid unused local variables such as 'string'., pmd.priority: 3, pmd.rulename: UnusedLocalVariable, pmd.rulesetname: Unused Code], created: 22.11.17 21:20], kind=4
org.eclipse.core.internal.resources.MarkerDelta@19bdb5b4: Marker [on: /teetime/src/main/java/teetime/example/ParallelCounterConfig.java, id: 11490, type: pmd.eclipse.plugin.markers.violation, attributes: [lineNumber: 40, message: The variable word is not named in plural although its type java.lang.String represents a collection., pmd.priority: 1, pmd.rulename: MissingPluralVariableName, pmd.rulesetname: chw's custom rules], created: 22.11.17 21:20], kind=4
org.eclipse.core.internal.resources.MarkerDelta@19522212: Marker [on: /teetime/src/main/java/teetime/example/ParallelCounterConfig.java, id: 11491, type: pmd.eclipse.plugin.markers.violation, attributes: [lineNumber: 44, message: System.out.println is used, pmd.priority: 2, pmd.rulename: SystemPrintln, pmd.rulesetname: Java Logging], created: 22.11.17 21:20], kind=4
org.eclipse.core.internal.resources.MarkerDelta@5c3b5304: Marker [on: /teetime/src/main/java/teetime/example/ParallelCounterConfig.java, id: 11492, type: pmd.eclipse.plugin.markers.violation, attributes: [lineNumber: 45, message: System.out.println is used, pmd.priority: 2, pmd.rulename: SystemPrintln, pmd.rulesetname: Java Logging], created: 22.11.17 21:20], kind=4
22:25:17.317 [Worker-47] DEBUG o.e.m.c.i.builder.MavenBuilder - Building project teetime
22:25:17.321 [Worker-47] DEBUG o.e.a.i.i.DefaultLocalRepositoryProvider - Using manager EnhancedLocalRepositoryManager with priority 10.0 for C:\Users\Nogge\.m2\repository
22:25:17.322 [Worker-47] DEBUG o.e.m.c.p.c.AbstractCustomizableLifecycleMapping - Build participants for MavenProject: net.sourceforge.teetime:teetime:3.0-SNAPSHOT @ C:\Users\Nogge\git\TeeTime-github\pom.xml
22:25:17.322 [Worker-47] DEBUG o.e.m.c.p.c.AbstractCustomizableLifecycleMapping - Mojo execution key: org.apache.maven.plugins:maven-resources-plugin:2.6:resources (execution: default-resources, phase: process-resources)
22:25:17.322 [Worker-47] DEBUG o.e.m.c.p.c.AbstractCustomizableLifecycleMapping - 	Action: execute
22:25:17.322 [Worker-47] DEBUG o.e.m.c.p.c.AbstractCustomizableLifecycleMapping - Mojo execution key: org.apache.maven.plugins:maven-compiler-plugin:3.5.1:compile (execution: default-compile, phase: compile)
22:25:17.322 [Worker-47] DEBUG o.e.m.c.p.c.AbstractCustomizableLifecycleMapping - Mojo execution key: org.apache.maven.plugins:maven-resources-plugin:2.6:testResources (execution: default-testResources, phase: process-test-resources)
22:25:17.322 [Worker-47] DEBUG o.e.m.c.p.c.AbstractCustomizableLifecycleMapping - 	Action: execute
22:25:17.322 [Worker-47] DEBUG o.e.m.c.p.c.AbstractCustomizableLifecycleMapping - Mojo execution key: org.apache.maven.plugins:maven-compiler-plugin:3.5.1:testCompile (execution: default-testCompile, phase: test-compile)
22:25:17.322 [Worker-47] DEBUG o.e.m.c.p.c.AbstractCustomizableLifecycleMapping - Mojo execution key: org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test (execution: default-test, phase: test)
22:25:17.322 [Worker-47] DEBUG o.e.m.c.p.c.AbstractCustomizableLifecycleMapping - Mojo execution key: org.codehaus.mojo:findbugs-maven-plugin:3.0.4:findbugs (execution: default, phase: test)
22:25:17.322 [Worker-47] DEBUG o.e.m.c.p.c.AbstractCustomizableLifecycleMapping - Mojo execution key: org.apache.maven.plugins:maven-pmd-plugin:3.7:pmd (execution: default, phase: test)
22:25:17.322 [Worker-47] DEBUG o.e.m.c.p.c.AbstractCustomizableLifecycleMapping - Mojo execution key: org.apache.maven.plugins:maven-pmd-plugin:3.7:cpd (execution: default, phase: test)
22:25:17.322 [Worker-47] DEBUG o.e.m.c.p.c.AbstractCustomizableLifecycleMapping - Mojo execution key: com.mycila:license-maven-plugin:3.0:format (execution: default, phase: test)
22:25:17.322 [Worker-47] DEBUG o.e.m.c.p.c.AbstractCustomizableLifecycleMapping - Mojo execution key: org.apache.maven.plugins:maven-jar-plugin:3.0.2:jar (execution: default-jar, phase: package)
22:25:17.322 [Worker-47] DEBUG o.e.m.c.p.c.AbstractCustomizableLifecycleMapping - Mojo execution key: org.apache.maven.plugins:maven-assembly-plugin:2.6:single (execution: make-assembly, phase: package)
22:25:17.322 [Worker-47] DEBUG o.e.m.c.p.c.AbstractCustomizableLifecycleMapping - Mojo execution key: org.apache.maven.plugins:maven-source-plugin:3.0.0:jar-no-fork (execution: attach-sources, phase: package)
22:25:17.322 [Worker-47] DEBUG o.e.m.c.p.c.AbstractCustomizableLifecycleMapping - 	Action: ignore
22:25:17.323 [Worker-47] DEBUG o.e.m.c.p.c.AbstractCustomizableLifecycleMapping - Mojo execution key: org.apache.maven.plugins:maven-javadoc-plugin:2.10.4:jar (execution: attach-javadocs, phase: package)
22:25:17.323 [Worker-47] DEBUG o.e.m.c.p.c.AbstractCustomizableLifecycleMapping - Mojo execution key: org.apache.maven.plugins:maven-install-plugin:2.4:install (execution: default-install, phase: install)
22:25:17.323 [Worker-47] DEBUG o.e.m.c.p.c.AbstractCustomizableLifecycleMapping - Mojo execution key: org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (execution: default-deploy, phase: deploy)
22:25:17.323 [Worker-47] DEBUG o.e.m.c.i.builder.MavenBuilderImpl - Executing build participant org.eclipse.m2e.core.project.configurator.MojoExecutionBuildParticipant for plugin execution org.apache.maven.plugins:maven-resources-plugin:2.6:resources (execution: default-resources, phase: process-resources)
22:25:17.326 [Worker-47] INFO  o.e.m.c.i.embedder.EclipseLogger - Using 'UTF-8' encoding to copy filtered resources.
22:25:17.327 [Worker-47] INFO  o.e.m.c.i.embedder.EclipseLogger - Copying 2 resources
22:25:17.327 [Worker-47] DEBUG o.e.m.c.i.builder.MavenBuilderImpl - Finished executing build participant org.eclipse.m2e.core.project.configurator.MojoExecutionBuildParticipant for plugin execution org.apache.maven.plugins:maven-resources-plugin:2.6:resources (execution: default-resources, phase: process-resources) in 4 ms
22:25:17.327 [Worker-47] DEBUG o.e.m.c.i.builder.MavenBuilderImpl - Executing build participant org.eclipse.m2e.core.project.configurator.MojoExecutionBuildParticipant for plugin execution org.apache.maven.plugins:maven-resources-plugin:2.6:testResources (execution: default-testResources, phase: process-test-resources)
22:25:17.327 [Worker-47] INFO  o.e.m.c.i.embedder.EclipseLogger - Using 'UTF-8' encoding to copy filtered resources.
22:25:17.328 [Worker-47] INFO  o.e.m.c.i.embedder.EclipseLogger - Copying 0 resource
22:25:17.328 [Worker-47] DEBUG o.e.m.c.i.builder.MavenBuilderImpl - Finished executing build participant org.eclipse.m2e.core.project.configurator.MojoExecutionBuildParticipant for plugin execution org.apache.maven.plugins:maven-resources-plugin:2.6:testResources (execution: default-testResources, phase: process-test-resources) in 1 ms
22:25:17.328 [Worker-47] DEBUG o.e.m.c.i.builder.MavenBuilder - Built project teetime in 10 ms
source: org.eclipse.core.internal.resources.Workspace@575754d5
buildKind: 0
file: L/teetime/src/main/java/teetime/example/ParallelCounterConfig.java
org.eclipse.core.internal.resources.MarkerDelta@2abb80f0: Marker [on: /teetime/src/main/java/teetime/example/ParallelCounterConfig.java, id: 11520, type: org.eclipse.jdt.core.problem, attributes: [arguments: 1:teetime.stage.basic.merger.strategy.BusyWaitingRoundRobinStrategy, categoryId: 110, charEnd: 405, charStart: 340, id: 16777221, lineNumber: 11, message: The type BusyWaitingRoundRobinStrategy is deprecated, severity: 1, sourceId: JDT], created: 22.11.17 22:25], kind=1
org.eclipse.core.internal.resources.MarkerDelta@43214606: Marker [on: /teetime/src/main/java/teetime/example/ParallelCounterConfig.java, id: 11521, type: org.eclipse.jdt.core.problem, attributes: [arguments: 1:teetime.stage.basic.merger.strategy.BusyWaitingRoundRobinStrategy, categoryId: 110, charEnd: 936, charStart: 907, id: 16777221, lineNumber: 22, message: The type BusyWaitingRoundRobinStrategy is deprecated, severity: 1, sourceId: JDT], created: 22.11.17 22:25], kind=1
org.eclipse.core.internal.resources.MarkerDelta@6691f685: Marker [on: /teetime/src/main/java/teetime/example/ParallelCounterConfig.java, id: 11522, type: org.eclipse.jdt.core.problem, attributes: [arguments: 2:teetime.stage.basic.merger.strategy.BusyWaitingRoundRobinStrategy#   , categoryId: 110, charEnd: 938, charStart: 907, id: 134217861, lineNumber: 22, message: The constructor BusyWaitingRoundRobinStrategy() is deprecated, severity: 1, sourceId: JDT], created: 22.11.17 22:25], kind=1
org.eclipse.core.internal.resources.MarkerDelta@43cd4f06: Marker [on: /teetime/src/main/java/teetime/example/ParallelCounterConfig.java, not found], kind=2
org.eclipse.core.internal.resources.MarkerDelta@3587fb8f: Marker [on: /teetime/src/main/java/teetime/example/ParallelCounterConfig.java, not found], kind=2
org.eclipse.core.internal.resources.MarkerDelta@7cdf8a4f: Marker [on: /teetime/src/main/java/teetime/example/ParallelCounterConfig.java, not found], kind=2
org.eclipse.core.internal.resources.MarkerDelta@15936e8f: Marker [on: /teetime/src/main/java/teetime/example/ParallelCounterConfig.java, not found], kind=2
file: L/teetime/target/classes/exceptions.properties
file: L/teetime/target/classes/logback.info
file: L/teetime/target/classes/teetime/example/ParallelCounterConfig.class

from qa-eclipse-plugin.

ChristianWulf avatar ChristianWulf commented on July 19, 2024

Possible solution could be the use of the Builder API: https://help.eclipse.org/neon/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Fguide%2FresAdv_builders.htm

from qa-eclipse-plugin.

ChristianWulf avatar ChristianWulf commented on July 19, 2024

See also the builder of the official PMD plugin: https://github.com/pmd/pmd-eclipse-plugin/blob/master/net.sourceforge.pmd.eclipse.plugin/src/main/java/net/sourceforge/pmd/eclipse/runtime/builder/PMDNature.java

from qa-eclipse-plugin.

ChristianWulf avatar ChristianWulf commented on July 19, 2024

However, the PMD plugin relies on a nature. Natures are stored in the. project file which is typically generated by build mgmt tools. So, if the build tool is not configured to add this custom nature, the user must know the nature and activate it by hand.

from qa-eclipse-plugin.

ChristianWulf avatar ChristianWulf commented on July 19, 2024

My plugin is triggered, I think, when a handler from the context menu is executed or when the view is open(ed).

from qa-eclipse-plugin.

ChristianWulf avatar ChristianWulf commented on July 19, 2024

Even a builder is notified about more than the resource which has been saved via the editor.

from qa-eclipse-plugin.

ChristianWulf avatar ChristianWulf commented on July 19, 2024

The only solution seems to exclude certain paths, such as /target/*, and to skip changes concerning markers only.

from qa-eclipse-plugin.

Related Issues (20)

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.