Dave Perrett

Adding Appfuse Dependencies

appfuse, java, programming, quickie, web

I recently had trouble importing the com.sun.media.jai imaging library into appfuse :

1
The import com.sun.media.jai cannot be resolved

To add a dependency in your pom.xml, first add the new repository (may not be strictly necessary if the library is already in the default appfuse repositories) :

1
2
3
4
5
6
7
8
<repositories>
    ......
    <repository>
        <id>com.sun.media</id>
        <url>http://repository.jboss.com/maven2</url>
    </repository>
    ......
</repositories>

Next, add the dependency version :

1
2
3
4
5
<properties>
    ......
        <jai.version>1.1.3</jai.version>
    ......
<properties>

And finally, add the dependency itself :

1
2
3
4
5
6
7
8
9
<dependencies>
    ......
    <dependency>
        <groupId>com.sun.media</groupId>
        <artifactId>jai-codec</artifactId>
        <version>${jai.version}</version>
    </dependency>
    ......
</dependencies>