简体   繁体   中英

Add batik as dependency to Gradle project

Before I'll start - I've looked at the following links and none of them worked for me (my assumption is that I'm doing something wrong):

I'm trying to add Batik to my existing Gradle project, from what I could tell this library is not published over Maven repository.

My project structure is as follow:

- root
  - libs
    - batik-1.12
  - src
    - main
      - java
      - resources
  - build.gradle
  - settings.gradle

My build.gradle file looks as follow:

plugins {
    id 'java'
}

group 'org.example'
version '1.0-SNAPSHOT'

repositories {
    mavenCentral()
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')

    testCompile group: 'junit', name: 'junit', version: '4.12'
}

I copied the example page of Batik from this link: https://xmlgraphics.apache.org/batik/using/svg-generator.html

However, this code cannot be compiled as it does not recognize Batik's source.

Have a look at this list. I guess you will find your dependency: https://search.maven.org/search?q=g:org.apache.xmlgraphics%20batik

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM