Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Beginner's Guide to Setup Xuggler

To work with Xuggler you need xuggle-xuggler-5.4.jar. According to the people who made this, most users only need the above-mentioned JAR file. However, this is what they say about using Xuggler without Maven or Ivy:

Using Xuggler WITHOUT Apache Maven or Apache Ivy

What are you... stuck in 2003? Anyway, if you insist on this, Xuggler's pre-compiled binaries (including native versions) can be found here. Make sure that xuggle-xuggler.jar and its dependencies are included in your Java classpath. See the xuggle-xugger-*.pom file distributed with the version of Xuggler that you use to find the (small) set of dependent jars, and download them as well.

I downloaded the xuggle-xuggler.jar file for the latest version, 5.4 but I don't understand the pom file for it.

  • What dependencies is he talking about?
  • Next, how do I download these dependencies ?
  • Once I get these dependencies, how do I start working in Eclipse?



  • Update After Downloading Dependencies

    I have the following directory structure:
    enter image description here

  • xuggle-xuggler-5.4.jar is stored in E:\xuggle
  • enter image description here
  • the various xuggler dependencies are stored in E:\xuggle\xuggle-dependencies
  • Question:

  • How do I start working with Xuggler in Eclipse? What paths do I have to set and what values do these paths have?
  • like image 209
    An SO User Avatar asked Dec 23 '12 11:12

    An SO User


    2 Answers

    The following files list the other jars which xuggle depends upon:

    • ivy.xml
    • pom.xml

    You can read these and then manually retrieve them from the appropriate repository, but I would submit it's simpler to start using a dependency manager.

    You asked how to download these dependencies, well ivy has a convenient command-line mode of operation. (See example below)

    Eclipse integration is very tough.... Once you've downloaded the jar you could try and generate the ".classpath" file or just manually add each jar via the Eclipse GUI. The reason I don't recommend this approach is because there are Eclipse plugins for both Maven and Ivy that would do this for you automatically.

    Example

    Run ivy from command-line as follows:

    java -jar ivy.jar -settings ivysettings.xml -dependency xuggle xuggle-xuggler 5.4 -retrieve "lib/[artifact]-[revision].[ext]"
    

    It will retrieve xuggle and all its dependencies into a "lib" directory as follows:

    ├── ivysettings.xml
    └── lib
        ├── commons-cli-1.1.jar
        ├── logback-classic-1.0.0.jar
        ├── logback-core-1.0.0.jar
        ├── slf4j-api-1.6.4.jar
        └── xuggle-xuggler-5.4.jar
    

    ivysettings.xml

    This file tells ivy to retrieve jars from either Maven Central, or the Maven repository provided by the Xuggle project.

    <ivysettings>
        <settings defaultResolver="repos" />
        <resolvers>
            <chain name="repos">
                <ibiblio name="central" m2compatible="true"/>
                <ibiblio name="xuggle" m2compatible="true" root="http://xuggle.googlecode.com/svn/trunk/repo/share/java"/>
            </chain>
        </resolvers>
    </ivysettings>
    
    like image 119
    Mark O'Connor Avatar answered Nov 10 '22 20:11

    Mark O'Connor


    Don't fight Maven, embrace it. These days all major build systems are maven compatible (Maven, Ivy, Gradle, Grape, Buildr ...). But you can use Maven from Eclipse:

    create a file called pom.xml with this content:

    <project>
     <groupId>com.foo<groupId>      <!-- change these -->
     <artifactId>foo</artifactId>   <!-- parameters to whatever -->
     <version>1.0-SNAPSHOT</version><!-- you like -->
     <repositories>
      <repository>
       <id>xuggle repo</id>
       <url>http://xuggle.googlecode.com/svn/trunk/repo/share/java/</url>
      </repository>
     </repositories>
     <dependencies>
      <dependency>
       <groupId>xuggle</groupId>
       <artifactId>xuggle-xuggler</artifactId>
       <version>5.2</version>
      </dependency>
     </dependencies>
    </project>
    

    Install the m2e extension and, from Eclipse, do "File > Import ... > Existing Maven Projects". In the dialog, select the Folder that contains the pom.xml.

    Make sure that the Folder's layout is like this:

    pom.xml
    src/main/java // sources go here
    src/test/java // test sources go here
    

    Then you should have a working Eclipse project with the required dependencies.


    Update after your update:

    You can see the dependencies when you look at this file: http://xuggle.googlecode.com/svn/trunk/repo/share/java/xuggle/xuggle-xuggler/5.2/xuggle-xuggler-5.2.pom

    • commons-cli (a utility library for command line processing)
    • logback (a logging framework)
    • junit (a testingframework)

    Maven will take care of loading these dependencies for you. So will Eclipse, if you use the m2e plugin as suggested above.


    If you absolutely don't want to do that, you will have to download the dependencies manually. Look at the pom file above, note the names and versions of the dependencies, look them up at http://mvnrepository.com/ and download them there, e.g. this is the page for slf4j-api: http://mvnrepository.com/artifact/org.slf4j/slf4j-api/1.6.4

    like image 3
    Sean Patrick Floyd Avatar answered Nov 10 '22 22:11

    Sean Patrick Floyd