添加到itextg摇篮 [英] Adding itextg to gradle

查看:201
本文介绍了添加到itextg摇篮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想通过gradle这个添加itextg以避免维护一组库罐子。也许是我,但我不能在任何地方找到正确编译的gradle声明。

  {相关性
    编译文件树(包括:['的* .jar'],DIR:库)
    编译com.android.support:appcompat-v7:20.0.0
    编译com.google code.gson:GSON:2.3.1
    编译com.itextg:itextg:5.4.3
}

常规iText的工作得很好,但我想要做的东西与图像。

 编译com.itextpdf:itextpdf-5.5.6


解决方案

我想这是因为我们发布的 iText的 JAR Maven的中央(其中摇篮也使用作为存储库),也可以作为从不同的网站下载( GitHub上,SourceForge上);但 iTextG 只是作为各种网站上下载,而不是在Maven的中央。 iTextG采用相同的命名空间iText的: com.itextpdf:itextpdf 所以有它的Maven中央太想会产生冲突。类似 com.itextg:itextg 根本不存在的(据我知道 - 我应该知道,因为我在iText的软件测试工程师)的。
事实上,iText的和iTextG之间的主要区别,在于我们从剥离所有iTextG AWT的依赖。对于剩下的他们是完全一样的codeBase的。

所以,到最后回答你的问题后,这一切的背景信息:你必须下载 iTextG JAR 并手动将它添加到你的文件夹中。

作为的iText的 5.5.9 ,你可以添加到您的摇篮文件:

  {相关性
    编译文件树(包括:['的* .jar'],DIR:库)
    编译com.android.support:appcompat-v7:20.0.0
    编译com.google code.gson:GSON:2.3.1
    编译com.itextpdf:itextg:5.5.9
}

I want to add itextg via gradle to avoid having to maintain a set of library jars. Maybe it's me but I can't find the correct gradle compile statement anywhere.

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile 'com.android.support:appcompat-v7:20.0.0'
    compile 'com.google.code.gson:gson:2.3.1'
    compile 'com.itextg:itextg:5.4.3'
}

Regular itext works just fine but I'm trying to do stuff with images.

compile 'com.itextpdf:itextpdf-5.5.6'

解决方案

I think that's because we released iText as a jar on Maven Central (which Gradle also uses as a repository) and also as a download from various sites (GitHub, SourceForge); but iTextG only as a download on various sites, not on Maven Central. iTextG uses the same namespace as iText: com.itextpdf:itextpdf so having it on Maven Central too would create conflicts. Something like com.itextg:itextg simply does not exist (as far as I know - and I am supposed to know because I am QA Engineer at iText Software). In fact, the main difference between iText and iTextG, is that we have stripped all AWT dependencies from iTextG. For the rest they are exactly the same codebase.

So, to finally answer your question after all this background information: you'll have to download the iTextG jar and manually add it to your libs folder.

As of iText 5.5.9, you can add this to your Gradle file:

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile 'com.android.support:appcompat-v7:20.0.0'
    compile 'com.google.code.gson:gson:2.3.1'
    compile 'com.itextpdf:itextg:5.5.9'
}

这篇关于添加到itextg摇篮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆