简体   繁体   English

通过SBT将Google Analytics Jar添加到Scala项目

[英]adding google analytics jar via SBT to scala project

I want to add google analytics package/jar to a scala project with SBT. 我想使用SBT将Google Analytics(分析)软件包/ jar添加到Scala项目。 However I cannot find the URL of the project on http://mvnrepository.com/ I've also tried looking for it on google forums but to no avail. 但是我无法在http://mvnrepository.com/上找到该项目的URL,我也曾尝试在Google论坛上寻找它,但无济于事。

I'm thinking of downloading the jar and adding it to sbt as an unmanaged jar. 我正在考虑下载jar,并将其作为非托管jar添加到sbt。 I think a jar is found at https://code.google.com/p/google-api-java-client/source/browse/com/google/apis/google-api-services-analytics/v3-1.3.3-beta?repo=mavenrepo&r=5f31c0ad06088b1762f414890cef93ba177ad4b8 but this is a maven repository. 我认为可以在https://code.google.com/p/google-api-java-client/source/browse/com/google/apis/google-api-services-analytics/v3-1.3.3找到一个jar。 -beta?repo = mavenrepo&r = 5f31c0ad06088b1762f414890cef93ba177ad4b8,但这是一个maven存储库。 Now, instead of downloading the jar, I'd like to let SBT handle downloading of libs, but for this I need the URL of the maven repository that I just posted the link to where the google code is. 现在,我不想让jar下载,而是让SBT处理lib的下载,但是为此,我需要我刚刚将链接发布到Google代码所在位置的maven存储库的URL。

Question
Is there a way to figure out the URL to the maven repository where google analytics jar is stored (from the URL above)? 有没有办法找出存储Google Analytics jar的Maven存储库的URL(从上面的URL)? Any other repository that has a copy of google analytics will also do. 具有Google Analytics(分析)副本的任何其他存储库也都可以。

I think this is what you want: http://mvnrepository.com/artifact/com.google.apis/google-api-services-analytics 我认为这就是您想要的: http : //mvnrepository.com/artifact/com.google.apis/google-api-services-analytics

In this case I just googled the artifact name ("google-api-services-analytics") but the structure of maven repositories tends to be very predictable. 在这种情况下,我只搜索了工件名称(“ google-api-services-analytics”),但是Maven存储库的结构往往非常可预测。 If you go one level up in the google code page you linked and check out maven-metadata.xml, that will tell you the group and artifact to look for in a repository. 如果您在所链接的Google代码页中上一层,并检出maven-metadata.xml,它将告诉您要在存储库中查找的组和工件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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