JetBrains / markdown

Markdown parser written in kotlin
Apache License 2.0
682 stars 75 forks source link

Using intellij-markdown as a maven/gradle dependency #18

Open adam-arold opened 7 years ago

adam-arold commented 7 years ago

I tried to use intellij-markdown in my projects but it seems that there is no public Maven repository (maven central, jcenter, etc) which can be used to download intellij-markdown from. How can I automatically add intellij-markdown to my project as a dependency?

valich commented 7 years ago

You should add jetbrains/markdown repo url in your deps like that:

repositories {
  mavenCentral()
  maven { url 'http://dl.bintray.com/jetbrains/markdown' }
}

You may see gradle build samples in markdown or rust plugins for JetBrains IDEs.

Probably this is worth mentioning in README, too so please don't close the issue if it's resolved for you :)

adam-arold commented 7 years ago

Okay, thanks!

ligi commented 7 years ago

Was also facing the same - thanks! But now still facing problems for an android project:

http://stackoverflow.com/questions/42773619/using-intellij-markdown-in-kotlin-android-project

leus commented 6 years ago

Just as a note, I'm using this in my pom file:

<dependency>
    <groupId>org.jetbrains</groupId>
    <artifactId>markdown</artifactId>
    <version>0.1.28</version>
</dependency>

(I leave it here as a reference since I struggled a bit)

joachimnielandt commented 6 years ago

Hi all, I'm trying to get this library working through maven. Can't get IDEA to 'see' the classes.

Added the repository:

<repository>
   <id>jetbrains-markdown</id>
   <url>http://dl.bintray.com/jetbrains/markdown</url>
</repository>

And the dependency:

<dependency>
   <groupId>org.jetbrains</groupId>
   <artifactId>markdown</artifactId>
   <version>0.2.0.pre-5-kotlin-1.2.60</version>
</dependency>

The jar is downloaded, I can see it in my 'external libraries' tab in intellij, and it's present in my .m2 folder. I can browse the contents there as well, I can see org.intellij.markdown.MarkdownElementType for example. But when I try to use the library in an actual piece of code, I can't import the classes. It's as as if org.jetbrains.markdown does not exist. I tried downgrading my kotlin-stdlib to 1.2.60, but that didn't do anything. Any ideas?

edit: I checked the contents of the markdown-0.2.0.pre-5-kotlin-1.2.60.jar jar, it just contains .kotlin_metadata files, no .class files. Would that be correct?

xgouchet commented 5 years ago

@CountZukula I faced the same issue, using <version>0.1.28</version> as @leus said fixed the issue for me

PioBeat commented 5 years ago

In my IntelliJ plugin project, I needed to import the com.intellij.markdown library for testing purposes. Markdown-related errors prevented the project from starting which was caused by a wrong version being used of intellij-markdown.

For this project, I do not use a build system such as Maven. So I had to manually download it from this repo https://mvnrepository.com/artifact/org.jetbrains/markdown/. There, I have chosen the version 0.1.31 as @leus already mentioned which then several errors disappeared associated with this wrong or a missing dependency.

It was not possible with version 0.2.0.pre-5-kotlin-1.2.60.

Cjkjvfnby commented 4 years ago

build.gradle.kts for Kotlin:

repositories {
    mavenCentral()
    maven("http://dl.bintray.com/jetbrains/markdown")
}

dependencies {
    implementation(kotlin("stdlib-jdk8"))
    compile("org.jetbrains:markdown:0.1.30") {
        exclude(module = "kotlin-runtime")
        exclude(module = "kotlin-js")
    }
}

Links to examples in the second post are broken, new rust link.

ibauersachs commented 3 years ago

@valich Please publish this to Maven Central. It's used as a dependency in Dokka that was just released on Central. Using Bintray is not an option (see Kotlin/dokka#41 for details).