xandl1994
xandl1994

Reputation: 41

Why do I need PrimeFaces Maven Repository to use a theme?

Why do I need PrimeFaces Maven Repository, when using all-themes dependency from PrimeFaces?
When I just use one dependency I got no errors and can work. But when I use all-themes I get missing artifact org.primefaces.themes:all-themes.jar:1.0.10, but why?

<repositories>
    <repository>
        <id>prime-repo</id>
        <name>PrimeFaces Maven Repository</name>
        <url>http://repository.primefaces.org</url>
        <layout>default</layout>
    </repository>
</repositories>
<dependency>
        <groupId>org.primefaces</groupId>
        <artifactId>primefaces</artifactId>
        <version>5.0</version>
</dependency>
<dependency>
        <groupId>org.primefaces.themes</groupId>
        <artifactId>all-themes</artifactId>
        <version>1.0.10</version>
</dependency>

Upvotes: 3

Views: 12113

Answers (5)

Jasper de Vries
Jasper de Vries

Reputation: 20253

We can only guess why this solution was chosen back then. Currently there is no need to a custom repository for themes. They are simply built-in, or, in case of premium themes, you will need to add the resources to your project yourself.

See https://primefaces.github.io/primefaces/12_0_0/#/core/themes

Upvotes: 1

Qadir Hussain
Qadir Hussain

Reputation: 1263

Question:

But when I use all-themes I get missing artifact org.primefaces.themes:all-themes.jar:1.0.10, but why?

Answer:

Because the version of PrimeFaces all-theme you are using it does not exist in Maven repo. Currently Maven has 1.0.8 version as latest.

<dependency>
    <groupId>org.primefaces.extensions</groupId>
    <artifactId>all-themes</artifactId>
    <version>1.0.8</version>
</dependency>

Maven Repo

Upvotes: 3

khmarbaise
khmarbaise

Reputation: 97467

The PrimeFaces people have decided not to deliver their packages into Maven central so that's the reason why you need to define the prime faces repository separately.

For such purposes it's a good idea to start using a repository manager which can be configured in a central location for your company to use PrimeFaces repository as well. This will make life easier.

Upvotes: 3

Tires
Tires

Reputation: 1602

Alternatively, you can use single themes from Icefaces

<dependency>
    <groupId>org.icefaces.ace-themes</groupId>
    <artifactId>ace-sunny</artifactId>
    <version>4.1.0</version>
</dependency>

In your XHTML page include the style:

<h:outputStylesheet name="theme.css" library="ace-sunny"/>

Upvotes: 1

Denise
Denise

Reputation: 2005

Maven's default repository is "maven central". There are a lot of artifacts in there, but some vendors may not have put their artifacts there and primefaces is one of them. Maven will look for the jar in maven central and won't find it. If you don't specify that it should also look in the Primefaces Maven Repository (which does have the artifact), it can't find the artifact.

Upvotes: 4

Related Questions