Why are some RichFaces artifacts not in Maven Central? - jsf

In order to get the RichFaces Validator artifact org.richfaces.ui.validator:richfaces-ui-validator-ui (4.2.2 Final) in my build, I had to add https://repository.jboss.org/nexus/content/repositories/releases as repository in my POM.
I went that way after my build complained it couldn't find that artifact and a search for 'richfaces' in Maven Central did not return the "complete set" of RichFaces artifacts.
Just curious if anyone knows how RichFaces artifacts are chosen for inclusion in Maven Central.

Short answer: if you need this, you're probably doing something wrong. Maven Central should have all the dependencies required to create an app with RichFaces.
I was trying to add the ui-validator component separately (which is not deployed to Maven central) under the mistaken assumption that I needed it explicitly identified as a dependency. Including it caused me a considerable amount of pain (multiple csv.xml files in deployment).
In the end, I realized that the ui-components dependency (which is installed on Maven Central) bundles up the validation dependency (and many others).
In the end, I wasn't getting the components I was looking for anyway. I thought I needed the rich:ajaxValidator, but that was only because I was attempting to use code from the 3.x RichFaces Showcase in a 4.x app (and that tag was removed in 4.x).

Related

What is the difference between maven and npm respository?

I want to know the differences between npm and maven respository
Same tool, different language?
Maven is the most popular build and dependency resolution tool for Java, just like NPM is for JS. But it's not just the same tool for a different language. There are obviously huge differences between Java and JS builds, and these differences are directly visible in the way Maven operates. For example, while many JS tools rely on Git to do some heavy-lifting, Maven works with custom filesystem-based Maven repositories, as Maven predates Git and needs to handle binary artifacts, which Git historically didn't handle well. In Maven there's a clear separation between sources and binaries, while they are often the same thing in JS world.
Maven basics
Maven in its purest form follows a declarative model, where pom.xml (similar to package.json) defines different properties of the build, but contains no scripts. The disadvantage is it can be a challenge to fine-tune some aspects of the build without using scripts as you have to rely on plugins. The advantage is it can be easier to understand other builds just by looking at pom.xml, as they usually follow the same approach without too much customization. Gradle is a popular Groovy-based tool built on top of Maven standards and conventions, and is specifically designed to simplify pom.xml and break this "no script" barrier.
Referencing your dependencies
Similarly to package.json, you don't work with pom.xml of your dependency directly, but rather define dependency coordinates and let your build tool handle the rest. In Maven the basic form of these coordinates is GAV (groupId, artifactId, version).
Flat dependency tree?
Based on comments in the other answer, Maven provides "flat dependency tree", not "nested dependency tree" that NPM provides by default. Maven does not allow multiple versions of the same dependency. If it happens that different versions are requested, Maven uses dependency resolution to pick a single version. This means that sometimes your transitive dependencies will get a different version than they require, but there are ways to manage this. However, this limitation comes from Java, not Maven, as (normally) in Java a class loader will only provide access to a single class definition even if multiple definitions are found on the classpath. Since Java is not particularly good at handling this, Maven tries to avoid this scenario in the first place.
Note: since npm v3 the dependencies are flatten. The alternative package manager yarn also does the same.
Maturity
Furthermore, Maven is considerably older than NPM, has a larger user base, huge number of custom plugins, and so far could probably be considered more mature overall. Sometimes Maven is used for non-Java or even polyglot projects, as there are plugins for handling other languages or specific environments, such as Android. There are plugins that bridge Maven and other build tools, such as frontend-maven-plugin that actually handles multiple JS build tools.
NPM is focused on JavaScript while Maven is focused on Java and JVM derived (that is Scala, Kotlin, Groovy).
So comparing them doesn't make sense at all as these are not concurrent.
While comparing Maven to Gradle (Java world concurrent) or NPM to Yarn (JavaScript world concurrent) makes more sense.
Now Maven and NPM have closed features. Which is not surprising : good recipes spread beyond a language.
Here are some common points/features:
- these are package(JavaScript term)/ dependency (Maven term) managers that works with local/remote repositories.
- these are also a way to manage dependencies in your projects and to execute build tasks for them.

Spark do not resolve ivy specified repositories after upgrade form 2.2.1 to 2.3

We have spark configuration that uses spark.jars.ivySettings to customize jars resolution.
Spark jobs run in environment without internet access, so we want to skip maven central calls and use our repositories.
In spark 2.2.1 everything was working fine, but when we upgraded to 2.3, repositories specified in ivy settings are ignored. As the result our jobs are failing due to missing dependencies.
Specifying our repos with new spark.jars.repositories makes it visible for spark, but does not change an order (so it will always first check maven central, which we cannot allow).
Is this some bug introduced in new version? Or I'm doing something wrong here?
Ok, I found where is the problem. So apparently the way of acquiring spark.jars.ivySettings has changed in 2.3. Now system properties are used for that:
sys.props.get("spark.jars.ivySettings")
This change is not followed by documentation update, and for me it seems like a bug.

JBOSS EAP 6.4 dependency

We are deploying multiple Maven application wars in Jboss EAP 6.4. All Maven applications have some common jars. We want to put the common dependencies in Jboss server.
How can I achieve this?
You have to create a custom module. http://michaelrice.com/2015/01/how-to-develop-a-custom-module-for-jboss-eap-6x-as-7
And then set the dependencies in a file (WEB-INF/jboss-deployment-structure.xml) in each WAR you will deploy.
If you have JBoss EAP subscription you can get more complete documentation: https://access.redhat.com/solutions/195403
Make sure you have the list of custom jar and jar which already exists in Jboss EAP6 as this can cause issue while deploying because of multiple jars
Next Create a deployment structure then set the dependencies in a file (WEB-INF/jboss-deployment-structure.xml) (Add this to your multiple project )
Make sure to exclude dependencies causing multiples by defining in the above file.
check if you need any submodule in config files of JBOSS EAP (you can comment it, if you are not using).
Deploy your project and check if any dependencies causing issue and update it accordingly.

Downloading Dependences From Private Amazon S3 Repository with Gradle

I am looking to add Groovy support to an existing java project so that I can seemlessly compile mixed Java and Groovy code using invokedynamic so that I can get Java-like execution speed without needing to waste excessive amounts of time with verbose Java syntax
After reading that the gmaven plugin no longer supports compilation -and that the groovy eclipse compiler plugin doesn't yet support invokedynamic, I asked myself, why would I want to continue using Maven if it compiles Groovy code that is needlessly slow?
Consequently, I decided I would try scrapping maven for Gradle so that I could obtain faster code while also porting some python deployment scripts to Gradle tasks so as to only need one codebase.
I have some libraries stored on a simple password protected s3 maven repository (in order to avoid needing enterprise overkill like artifactory). After doing some basic research, I have found that Gradle has no built in support for adding in custom dependency management as determined by this stack overlow question and this support forums post.
I did manage to find a s3 plugin for gradle -but it doesn't deal with management of dependencies.
If the whole point of Gradle is to be more flexible than Maven and if the core purpose of a dependency management/ build system is to effectively manage dependencies from a variety of sources-then lack of support for custom repositories appears to be a fairly significant significant design flaw which makes any issues I have encounted with Maven thus far pale in comparison.
However, it is quite possible that I am missing something, and I have already invested several hours learning Gradle -so I figured I would see if there is some reasonable way to emulate dependency management for these s3 dependencies until Gradle developers fix this critical issue. Otherwise I will have to conclude that I am better off just using Maven and tolerating slower Groovy code until the compiler plugin supports invokedynamic.
Basically I need a solution that does the following:
Downloads dependencies and transitive dependencies to the gradle cache
Doesn't require me to hardcode the path to the gradle cache -so that my build script is platform independent.
Doesn't download the dependencies again if they are already in the cache.
Works with a multi-module project.
However, I cannot find anything in the documentation that would even give me a clue as to where to begin:
Gradle 2.4 has native support for S3 repositories. Both downloading dependencies and publishing artifacts.
To download with IAM credentials (paraphrased from the link above):
repositories {
maven {
url "s3://someS3Bucket/path/to/repo/root"
credentials(AwsCredentials) {
accessKey 'access key'
secretKey 'secret key'
}
}
}
Then specify your dependencies as usual.
You don't need any custom repository support to make this work. Just declare a maven repository with the correct URL. If the repository works when used from Maven, it will also work with Gradle. (Uploading may be a different matter.)
You can use S3 and http
repositories {
mavenCentral()
ivy {
url "https://s3-eu-west-1.amazonaws.com/my-bucket"
layout "pattern", {
artifact "[artifact]-[revision].[ext]"
m2compatible = true
}
}
}
Name the jar in S3 to name-rev.jar (joda-time-3.2.jar) in my-bucket.
Also upload a pom file.
And in S3 give all permission to Download the jar and pom.

OSGi Bundle Repositories

I am empirically testing OSGi Bundles and their relationships for this I need lots of bundles.
Making these datasets is a difficult task. I already have Eclipse update (1700 Bundles) sites and Spring Enterprise bundle repository for testing, however I want more, anyone out there got massive amounts of bundles.
I don't even need the code, just the manifests would be fine.
Cheers
Google Code Search returns 15800 results for query 'Bundle-SymbolicName file:MANIFEST.MF'. If you find some way to automatically download them and remove duplicates you might get a sizable dataset.
Another similar idea is to find some way to search the Maven central repository for artifacts that include OSGi bundle manifest.

Resources