Skip to content

Publish ua-parser Java lib to Maven Central  #1

Closed

Description

@jogjayr

Clojure developers would find using this library a lot easier if it were published to Maven Central.

Would this require changing the package name to org.ua-parser?

Please let me know if I can help to achieve this.

Activity

  1. russellwhitaker commented on Dec 18, 2014

    @russellwhitaker

    +1

  2. magicknot commented on Jan 31, 2015

    @magicknot

    +1 as well

  3. sdboer78 commented on Feb 1, 2015

    @sdboer78

    +1

  4. MaximumDamage commented on Feb 10, 2015

    @MaximumDamage

    +1
    I guess maven is the way to go with java in general

  5. kdekooter commented on Mar 10, 2015

    @kdekooter

    👍

  6. OuIChien commented on Mar 23, 2015

    @OuIChien

    +1 as well

  7. vnydvd commented on Apr 22, 2015

    @vnydvd

    If this gets closed, it will be great. Maven will be nice

  8. elicwhite commented on May 31, 2015

    @elicwhite

    👍

  9. cgi commented on Jun 1, 2015

    @cgi

    +1 for such artifact in Maven Central

  10. dennismaassnp commented on Jun 1, 2015

    @dennismaassnp

    +1

  11. russellwhitaker commented on Jun 3, 2015

    @russellwhitaker

    @jogjayr I'm not sure this is ever going to happen: this Java language repo, while having been preserved after the split/migration to the ua-parser github org, doesn't seem to be actively maintained since the split (latest commit was about 5 months ago). In the meantime, if you need Clojure functionality for doing useragent parsing, I've just released v1.0.0 of uap-clj:

    https://clojars.org/uap-clj

    Associated repo: https://github.com/russellwhitaker/uap-clj

    Hope you find it useful.

  12. jogjayr commented on Jun 3, 2015

    @jogjayr
    Author

    @russellwhitaker Nice! I personally don't need this functionality any more. Since there's now a good alternative for Clojure (thanks for that!), I'll close this issue.

  13. russellwhitaker commented on Jun 3, 2015

    @russellwhitaker

    My pleasure @jogjayr . Feel free to post issues on that Clojure version's repo, I'm happy to consider PRs and issues. I might even consider checking with @elsigh and asking if they'd be interested in forking the now-feature-complete and fully-specification-compliant Clojure implementation to the ua-parser org.

  14. kdekooter commented on Jun 4, 2015

    @kdekooter

    Hang on guys, not so fast! The issue says "Publish the JAVA Library to Maven". That's what I - and I suppose a lot of other commenter - +1-ed this issue for. So please reopen the issue. I am actively using the java version of ua-parser.

  15. 41 remaining items

  16. asafm commented on Nov 30, 2016

    @asafm

    The source files says Twitter copyright.
    I also found version 1.3.0 in mvnrepository under Twitter Maven repo:
    http://mvnrepository.com/artifact/ua_parser/ua-parser/1.3.0

    I'll give it a go there.

  17. russellwhitaker commented on Dec 26, 2016

    @russellwhitaker

    I've updated uap-clj to v1.3.0; as before, the Java wrapper API is available as well.

  18. asafm commented on Dec 26, 2016

    @asafm

    We're using this for the past 3-4 weeks and it works flawlessly:
    http://mvnrepository.com/artifact/ua_parser/ua-parser/1.3.0

                <dependency>
                    <groupId>ua_parser</groupId>
                    <artifactId>ua-parser</artifactId>
                    <version>1.3.0</version>
                </dependency>
  19. russellwhitaker commented on Dec 26, 2016

    @russellwhitaker

    @asafm that's an old artifact (a little over a year); does it regress 100% against the current core regexes.yaml? Curious.

  20. asafm commented on Jan 1, 2017

    @asafm

    @russellwhitaker - The core code hasn't really changed so it's ok that it's over a year old. What we do in our project is pull the latest yaml file and use it, and not the one bundled in the jar. We use the following maven snippet to do it:

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-antrun-plugin</artifactId>
                    <executions>
                        <execution>
                            <id>download-files</id>
                            <phase>process-classes</phase>
                            <goals>
                                <goal>run</goal>
                            </goals>
                            <configuration>
                                <tasks>
                                    <!--User Agent processor regexes file (download from github by commit id)-->
                                    <get src="https://raw.githubusercontent.com/ua-parser/uap-core/0dabfd35a465e1c7dd5b07c273d4b693d46ee387/regexes.yaml"
                                         dest="${project.build.outputDirectory}/regexes.yaml" />                                
                                </tasks>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
    

    Once in a while we update the commit ID above to be the latest after we tested it locally.

  21. fbacchella commented on Jan 27, 2017

    @fbacchella

    I downloaded the artifact for twitter. In it the pom.properties says:

    #Generated by Maven
    #Mon Nov 18 14:49:18 PST 2013
    version=1.3.0
    groupId=ua_parser
    artifactId=ua-parser
    

    The URL in the build in the embedded pom.xml:

      <url>https://github.com/tobie/ua-parser/</url>
    

    Looks like a very old build.

  22. asafm commented on Jan 27, 2017

    @asafm
  23. fbacchella commented on Jan 27, 2017

    @fbacchella

    Yes it's the twitter maven repo that is too old. There has been some commit since November 2013.

  24. russellwhitaker commented on Jan 27, 2017

    @russellwhitaker

    An alternative is to use uap-clj, which is actively maintained. In fact, I wrote it because this Java repo isn't actively maintained. Add this to your pom.xml:

    <repository>
      <id>clojars</id>
      <url>http://clojars.org/repo/</url>
    </repository>

    So you can pull in this dependency:

    <dependency>
      <groupId>org.clojure</groupId>
      <artifactId>clojure</artifactId>
      <version>1.8.0</version>
    </dependency>
    <dependency>
      <groupId>uap-clj</groupId>
      <artifactId>uap-clj</artifactId>
      <version>1.3.1</version>
    </dependency>

    Example usage:

    package useragent;
    
    import java.util.HashMap;
    
    // Java API for uap-clj Clojure implementation of useragent parser
    import uap_clj.java.api.*;
    
    public class Parser {
      public Parser() {};
    
      public static void main(String[] args) {
        String ua = args[0];
    
        HashMap b = Browser.lookup(ua);
        HashMap o = OS.lookup(ua);
        HashMap d = Device.lookup(ua);
    
        System.out.println("Browser family: " + b.get("family"));
        System.out.println("Browser major number: " + b.get("major"));
        System.out.println("Browser minor number: " + b.get("minor"));
        System.out.println("Browser patch number: " + b.get("patch"));
    
        System.out.println("O/S family: " + o.get("family"));
        System.out.println("O/S major number: " + o.get("major"));
        System.out.println("O/S minor number: " + o.get("minor"));
        System.out.println("O/S patch number: " + o.get("patch"));
        System.out.println("O/S patch_minor number: " + o.get("patch_minor"));
    
        System.out.println("Device family: " + d.get("family"));
        System.out.println("Device brand: " + d.get("brand"));
        System.out.println("Device model: " + d.get("model"));
      }
    }
  25. bpossolo commented on May 6, 2018

    @bpossolo
    Contributor

    Is this project still maintained? If not, can someone transfer ownership?
    I would like to get a new jar with the latest regexes.yaml file published to mvn central and am willing to do it myself if someone can hand it over.

  26. bpossolo commented on May 9, 2018

    @bpossolo
    Contributor

    I've requested a namespace on Maven Central repo.

    group id: com.github.ua-parser
    artifact id: uap-java

    screen shot 2018-05-09 at 1 28 46 am

  27. russellwhitaker commented on May 9, 2018

    @russellwhitaker
  28. bpossolo commented on May 14, 2018

    @bpossolo
    Contributor

    I am pleased to announce that uap-java is now published to Maven Central Repository for the first time ever.

    <groupId>com.github.ua-parser</groupId>
    <artifactId>uap-java</artifactId>
    <version>1.4.0</version>
    <packaging>jar</packaging>
    

    This includes the latest regexes.yaml file and I fixed the tests to pass with the new file.

    I also bumped the dependencies to the latest versions.

    org.yaml.snakeyaml: 1.20
    org.apache.commons.commons-collections4: 4.1
    
  29. fbaligand commented on May 14, 2018

    @fbaligand

    Great news !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions