Open Rapter1990 opened 1 year ago
Can you debug to see if relevant content has been injected
@godfather1103 I can run CamelCaseMethodNameRuleTest without any error. After I get zip file from repo as plugin, I test it in Intellij Idea 2018 but it couldn't detect the rule and rule can appeared when I click "Analyze code through Ali Baba Java Guideness Plugin". How can I fix it?
@godfather1103 I downloaded your repo but I got this issue when I run this command gradle clean :p3c-idea:buildPlugin --warning-mode all
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'idea-plugin'.
> Could not resolve all files for configuration ':classpath'.
> Could not resolve org.jetbrains.intellij.plugins:gradle-intellij-plugin:1.13.3.
Required by:
project :
> No matching variant of org.jetbrains.intellij.plugins:gradle-intellij-plugin:1.13.3 was found. The consumer was configured to find a runtime of a library compatible with Ja
va 8, packaged as a jar, and its dependencies declared externally, as well as attribute 'org.gradle.plugin.api-version' with value '7.5.1' but:
- Variant 'apiElements' capability org.jetbrains.intellij.plugins:gradle-intellij-plugin:1.13.3 declares a library, packaged as a jar, and its dependencies declared exter
nally:
- Incompatible because this component declares an API of a component compatible with Java 11 and the consumer needed a runtime of a component compatible with Java 8
- Other compatible attribute:
- Doesn't say anything about org.gradle.plugin.api-version (required '7.5.1')
- Variant 'javadocElements' capability org.jetbrains.intellij.plugins:gradle-intellij-plugin:1.13.3 declares a runtime of a component, and its dependencies declared exter
nally:
- Variant 'runtimeElements' capability org.jetbrains.intellij.plugins:gradle-intellij-plugin:1.13.3 declares a runtime of a library, packaged as a jar, and its dependenci
es declared externally:
- Incompatible because this component declares a component compatible with Java 11 and the consumer needed a component compatible with Java 8
- Other compatible attribute:
- Doesn't say anything about org.gradle.plugin.api-version (required '7.5.1')
- Variant 'sourcesElements' capability org.jetbrains.intellij.plugins:gradle-intellij-plugin:1.13.3 declares a runtime of a component, and its dependencies declared exter
nally:
- Incompatible because this component declares documentation and the consumer needed a library
- Other compatible attributes:
- Doesn't say anything about its target Java version (required compatibility with Java 8)
- Doesn't say anything about its elements (required them packaged as a jar)
- Doesn't say anything about org.gradle.plugin.api-version (required '7.5.1')
- Variant 'testFixturesApiElements' capability org.jetbrains.intellij.plugins:gradle-intellij-plugin-test-fixtures:1.13.3 declares a library, packaged as a jar, and its d
ependencies declared externally:
- Incompatible because this component declares an API of a component compatible with Java 11 and the consumer needed a runtime of a component compatible with Java 8
- Other compatible attribute:
- Doesn't say anything about org.gradle.plugin.api-version (required '7.5.1')
- Variant 'testFixturesRuntimeElements' capability org.jetbrains.intellij.plugins:gradle-intellij-plugin-test-fixtures:1.13.3 declares a runtime of a library, packaged as
a jar, and its dependencies declared externally:
- Incompatible because this component declares a component compatible with Java 11 and the consumer needed a component compatible with Java 8
- Other compatible attribute:
- Doesn't say anything about org.gradle.plugin.api-version (required '7.5.1')
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
How can I fix it?
use jdk 17
@godfather1103 I define jdk 17
for project structure
, idea-plugin
and p3c-pmd
under gradle
but nothing changed. I still got the same issue. How can I fix it as I'm stuck there. As you can see, Could not resolve org.jetbrains.intellij.plugins:gradle-intellij-plugin:1.13.3.
@Rapter1990 What about the code for this class "demo.CamelCaseMethodNameRule"
@godfather1103 I forgot to add it. You can see the post above to show all information about custom rule. I have also another problem which I mentioned before. I hope you can help me.
Could not resolve org.jetbrains.intellij.plugins:gradle-intellij-plugin:1.13.3. @Rapter1990
- check jdk Version Have you change jdk between these two places? Settings -> Build -> Gradle -> Gradle Jvm Project Structure -> Project -> SDK
2.Modify buildscript.repositories Order
@godfather1103 Here is what I've done after your response.
1. Settings -> Build -> Gradle -> Gradle Jvm -> Oracle Open JDK version 11.0.20 Project Structure -> Project -> SDK -> Oracle Open JDK version 11.0.20
In the file named gradle-wrapper.properties , here is the gradle version shown below
`distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-all.zip`
2. Move gradlePluginPortal()
to mavenLocal()
above.
It works now. Thank you for your guideness. I can reach out you again if I have any problem.
@godfather1103 How can I find rule example like xpath example such as FinallyStatement, ReturnStatement, ContinueStatement? Can you share its link if you have? Let me know.
@godfather1103 I found this link ( https://josephallen.github.io/PMD-New-Site/writing_pmd_rules.html ) I try to find their usage like FinallyStatement//ContinueStatement
.
Do you have any idea about it?
I don't know.
Message ID: @.***>
@godfather1103 Which contributor has any idea about it?
@godfather1103 I try to find more examples of writing custom rule. Where do I find more them?
@godfather1103 Hi, I want to ask some questions to you?
1) How can I run the app locally? I try this approach
runIde
in Run section idea-plugin:p3c-idea
clean buildPlugin
in Run section
Is it right?
2) I added the rule but it cannot detect.
Can you help me?
Run in debug mode to confirm if the rules have been injected
Follow the steps in the video I sent and check in sequence
I tried to use your plugin in my Intellij IDEA 2023.2.1 Ultimate Edition and it feels very comfortable to analyze the code and suggest some major and minor ideas which help you revise the code.
What I just want to ask is to learn how to add a new rule in the plugin.
Which documentation do I follow that? Can you guide me?
I hope you can help me.
I'm waiting for response as early as possible.