3

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>
Jasper de Vries
  • 19,370
  • 6
  • 64
  • 102
xandl1994
  • 41
  • 2
  • 2
  • 12

5 Answers5

4

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.

Denise
  • 1,947
  • 2
  • 17
  • 29
  • 1
    I think you don't need the primefaces repository. The primefaces artifacts are in maven central: http://search.maven.org/#search%7Cga%7C1%7Cprimefaces - it may be new the brand new versions are not or only a few days later. Snapshot versions are probably never in maven central (if you plan do early adopt new releases). Then you'll need the additional repository. – wemu Oct 15 '14 at 13:18
  • 1
    You might be right about that. I think to use that version, he'd have to put org.primefaces.extensions as the groupId and he'd have to use version 1.0.8. – Denise Oct 15 '14 at 14:01
  • what is the deference between org.primefaces.themes and org.primefaces.extensions? And when I need what? – xandl1994 Oct 16 '14 at 08:27
  • 1
    I honestly don't know, it's just that there's an artifact called all-themes in org.primefaces.extensions in maven central (ie, that wouldn't require adding the repository). If you've added the repository and it's working, it probably isn't worth investigating. – Denise Oct 16 '14 at 11:17
3

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.

Jasper de Vries
  • 19,370
  • 6
  • 64
  • 102
khmarbaise
  • 92,914
  • 28
  • 189
  • 235
3

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

Jasper de Vries
  • 19,370
  • 6
  • 64
  • 102
Qadir Hussain
  • 1,263
  • 1
  • 10
  • 26
1

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"/>
Tires
  • 1,529
  • 16
  • 27
  • Since the underlying technology is jQuery, it should be compatible in general. With Primefaces 5.3 it works fine, but there might be some limitations in detail. – Tires Feb 22 '16 at 09:13
  • PrimeFaces needs structural css to, that is NOT jquery based... The reason this (for now) works (or just with what you checked) is that the IceFaces components are to a certain extend a fork of the PrimeFaces components. https://www.google.com/search?q=icefaces+forks+primefaces. This compatibility will become less and less in the future, so consequently, this is not a good advice. – Kukeltje Feb 22 '16 at 11:07
  • In fact, it works for now. Until Primefaces places their own themes in Central, I don't see any reasons against using it. Otherwise it's pure speculation. – Tires Feb 25 '16 at 09:21
  • So your actual problem is that theydid not put themes in maven central? So adding anadditional repository is the blocker? Ok… – Kukeltje Feb 25 '16 at 09:26
  • Using an corporate nexus or uploading your own project to Central could prevent you from adding other repositories. Obviously, others also want that. – Tires Feb 25 '16 at 09:31
  • ??? We have a corporate nexus and we simply requested the PF repo to be added. No problem... And if you use it as a proxy(!) you can still add the PrimeFaces repo in your pom, no problem, not even when you upload your project to central... – Kukeltje Feb 25 '16 at 09:36
1

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

Jasper de Vries
  • 19,370
  • 6
  • 64
  • 102