Issues with dependencies in Gradle plugin-project

已回答

I'm reworking my plugin from Maven to Gradle. Plugin Platform Template is targeting to Kotlin, which I'm not familiar to, so I created Gradle from scratch.

Two dependencies are challenge for me:

1. I still cannot figure out how to reference maven pluging to support Maven projects (as I already had issue with). So far I had to use again reference to a local jar-file.

2. I'm getting build error

  • package com.intellij.packaging.artifacts does not exist
  • cannot find symbol class Artifact

Even though I can navigate to its decompiled version from the code.

build.gradle file on GitHub branch for this transition changes.

Any suggestions?

IntelliJ IDEA 2020.2 (Ultimate Edition)
Runtime version: 11.0.7+10-b944.20 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 10.15.6

Thank you

0

Sergey,

 

First of all - Template is targeting both Kotlin and Java. Please check the README for more details.

Something is definitely wrong with your Gradle configuration - but I can't tell you what with no sources available.

Please go through our Building Plugins with Gradle documentation pages.

0

Hi Jakub.

My source code available in github branch.

Thank you for pointing out that I missed this part "So if you decide to use Java instead, sources should be located in the src/main/java directory." (generated repo contains only kotlin sample files) - I'll look at this again.

0

Sergey,

Looks like you didn't add the dependency to the java module. Please check the Modules Specific to Functionality section.

You need to add java to the plugins:

intellij {
  plugins = ['java']
}

and dependency on com.intellij.java in plugin.xml file.

1

Jakub,

This works, for maven plugin as well, thank you for your help!

intellij {
  plugins = ['java', 'maven']
}

I'll leave build.gradle file content here for future reference:

buildscript {
repositories {
maven {
url "https://oss.sonatype.org/content/repositories/snapshots/"
}
maven {
url 'https://dl.bintray.com/jetbrains/intellij-plugin-service'
}
}
dependencies {
classpath "org.jetbrains.intellij.plugins:gradle-intellij-plugin:0.5.0-SNAPSHOT"
}
}

plugins {
id 'java'
id 'org.jetbrains.intellij' version '0.4.21'
}

subprojects {
repositories {
mavenCentral()
}

apply plugin: 'java'
apply plugin: 'org.jetbrains.intellij'

intellij {
version '2020.2'
}
}

intellij {
plugins = ['java', 'maven']
}

repositories {
mavenCentral()
maven{
url "https://cache-redirector.jetbrains.com/jetbrains.bintray.com/intellij-plugin-service"
}
maven{
url "https://cache-redirector.jetbrains.com/repo1.maven.org/maven2"
}
}

group 'io.github.satr.idea.plugin.aws.lambda.connector'
version '2.0-SNAPSHOT'
sourceCompatibility = 1.8

dependencies {
compile "com.amazonaws:aws-java-sdk-lambda:1.11.827"
compile "com.amazonaws:aws-java-sdk-iam:1.11.827"
compile "com.amazonaws:aws-java-sdk-logs:1.11.827"
compile "log4j:log4j:1.2.17"
testCompile "junit:junit:4.12"
testCompile "org.mockito:mockito-all:2.0.2-beta"
}

patchPluginXml {
changeNotes """
<ul>
<li>2.0.RC1</li>
<li>...</li>
</ul>
]]>"""
}
0

请先登录再写评论。