Where can I find jar dependencies versions for each JBoss release? - jboss

I need to easily find what version of, let's say, JGroups bundled with JBoss 4.2.3.
Is there some documentation, wiki, or something else where I can find this information easily?

https://anonsvn.jboss.org/repos/jbossas/tags/JBoss_4_2_3_GA/build/build-thirdparty.xml
In your specific case, it uses JGroups 2.4.1.SP4. For newer JBoss versions, there's a "component-matrix" directory with a pom.xml with all versions:
https://anonsvn.jboss.org/repos/jbossas/tags/JBoss_5_1_0_GA/component-matrix/pom.xml

If you want to know the dependencies for a single JAR file or an application, then you can have a look at Tattletale project which helps you also to find missing classes from the classpath, spot if a class/package is located in multiple JAR files and much more. Here you can find also a Tattletale tutorial.
Hope it helps
Francesco

Related

Upgrade log4j to log4j2 in OSGi environment (Eclipse plugin)

I have an OSGi application (Eclipse plugin) that contains several bundles.
I have a com.domain.dependencies bundle that, as the name suggests, contains dependencies. There is NO code in this bundle. The concept is that all 3rd-party dependencies used by 1+ other bundles are contained in this bundle and made available to other bundles within the plugin. This has always worked for the past decade or so that this plugin has evolved.
The above bundle 'pulls in' log4j - an older log4j version 1.x. So, log4j has always been exposed as an available library to other bundles that use com.domain.dependencies.
Due to the recent security issues with log4j2, a company security directive/edict has stated that all use of log4j or log4j2 must be upgraded to log4j2 v2.16.0
Initially I thought I'd just change the declaration in the build.gradle file for com.domain.dependencies to pull in that newer log4j2 but discovered that log4j2 is split in to 'core' and 'api' jars. OK so I tried to use those instead. I then followed the Apache migration steps for moving from log4j 1.x to 2.x, updated all the code etc.
After the above, compilation fails. None of the other bundles 'see' log4j2 as they saw log4j. A bit of Googling and I see people talk about creating OSGi Fragments. What's a Fragment? I've read a bit about them and feel none the wiser when it comes to my issue.
I should point out that my plugin also has a dedicated bundle com.domain.log, which depends on com.domain.dependencies and it's the com.domain.log bundle that contains the log4j.properties file (which also needs tweaking for log4j2). This logging bundle wrapped log4j (and soon to be log4j2) to expose logging features to the other bundles within the plugin.
So when it comes to using fragments, I am confused. I see some articles on the internet suggest at least 2 bundles are required. I don't know if these have to be new, or if I can re-use my existing arrangement of bundles. I struggle to relate those articles to how things are currently set up in my plugin, but I wish to maintain the idea that com.domain.dependencies supplies dependencies to other bundles and has no code of itself, while also having the com.domain.log continue to expose the same logging functionality to the other bundles that need it.
My instinctive feelings are that com.domain.log which exposes logging functionality to my other bundles, should use log4j-api, while com.domain.dependencies should obtain log4j-core (implementation) and expose it to com.domain.log. However, I can imagine too many different ways to try and set this up, and all will fail unless I am doing it the right way. Basically, I need help from somebody who knows how to in an OSGi environment.
So, how should I wire-in log4j2 to mimic the traditional behaviour/functionality in my OSGi environment?

Why do the JBoss/wildfly BOMs not contain all of the provided modules?

Wildfly 8.x ships with BOMs for easy dependency management: https://github.com/wildfly/boms
These are useful for the module-based classloading described here: https://docs.jboss.org/author/display/WFLY8/Implicit+module+dependencies+for+deployments
However, when I look in $JBOSS_HOME\modules\system\layers\base, I see many, many more included modules. For example, dozens of org.apache modules like commons-lang, etc. are included.
These deps are also not in the JBoss parent POM: https://github.com/jboss/jboss-parent-pom
Nor the Java EE specs: https://github.com/jboss/jboss-javaee-specs
For these dependencies (ones not in the BOMs or in the docs), how is the developer supposed to know they are provided? What is the intended dependency management strategy for developers using tools like Maven, etc.
Not all modules used by the server are meant to be used on deployments. There is a list of implicit module dependencies.
If you look at the module.xml file for some of these you'll probably see a property <property name="jboss.api" value="private"/>. This essentially just means that the dependency can change at any time. It may be upgraded to a different version or even removed. It's best to just include those dependencies in your deployment.

EAR modules in m2e

I'm converting an existing project structure to Maven where there's EJBs and JARs contained in EARs that are deployed. My issue is with making EARs. It seems obvious to use the Maven EAR plugin, which either takes an existing application.xml or generates one on basis of configuration.modules. I feel I'm not entirely leveraging Maven if I would not use the modules configuration (although it would allow developers to reuse the existing application.xml editor), but I'm thinking about many of our developers who love to click around in RAD/Eclipse to get things configured. So I took a look at RAD/Eclipse in full expectation to see some m2e support that would allow me to point-and-pick my EAR modules, and then see the modules in the POM file being populated accordingly. But I'm not able to find such thing. I believe I installed m2e (1.3.0) and m2e-wtp (0.17.0) although it seems to bring me very little in terms of WTP/EAR support. Also I spent most of tonight googling around, to no avail. Should I forget about it and have devs just manually edit the POM file, or am I overlooking some nifty UI for this purpose? Thanks for your pointers!
Seeing a comment and an answer that drive me to elaborate. I do appreciate that when using Maven, Maven is leading. No argument there. And I know that I can take control over the application.xml back using generateApplicationXml, but that's not even what I'm after, again Maven can be leading. But as I can use the "Maven POM Editor" to edit the basic structure of the POM, would there be any UI available to edit the configuration.modules? Our devs are very acustomed to IDE-centric development, and them having to start editing POM file XML in order to manage modules is something that scares me slightly...
If you want to configure your application.xml manually you can include the file to your source folder and set the generateApplicationXml property to false so maven will not overwrite it.
See for details: http://maven.apache.org/plugins/maven-ear-plugin/generate-application-xml-mojo.html#generateApplicationXml

Is there a quick way to convert Eclipse "libraries" to Maven POM entries?

I've got an eclipse project with several "libraries", each containing a significant number (35-40) of individual jar files. For instance, a JBoss "library" will generally have several hundred .jar file associated with a particular runtime.
Is there a way to find/use the "library" objects with Maven so that I can specify them in my POM.xml, or am I stuck with individual entries for each individual .jar file?
Sorry Josh, think you're stuck.
We had this issue once (a legacy app with loads of jars that had to be moved to Maven) and what we did was write a little script that returned the SHA hash of all of the jar files, and searched the maven repository (given khmarbaise's link above) using that. This way you know that you're getting the exact jar that you're already using.
The best solution i can recommend is to use:
http://search.maven.org
For JBoss you need to use the search in JBoss repository.
https://repository.jboss.org/nexus/index.html
But better check the documentation at JBoss if there is a more up-to-date source for JBoss.

tomcat 5.5 web.xml change WEB-INF/lib directory

I have a jruby rails app that has some jar dependencies in rails lib/java. I prefer this to just putting them straight in lib as it separates my java libs from ruby libs. Works locally using jruby. Problem is, on deploy, tomcat is looking for a bunch of these jars (such as jruby) in WEB-INF/lib, not WEB-INF/lib/java.
I think i need to put some config in the web.xml that tells tomcat to also look in lib/java, but i can't find ANY docs on the matter.
I don't want to modify tomcat's system wide classpath, I just want to tell its class loader to check a directory other than WEB-INF/lib for this particular app only
Can anyone enlighten me on how to do this?
you can't change this directory, j2ee spec says that all libs go in WEB-INF/lib. That is where they are supposed to go.
Just stay with your two directories in your project folder, but join them, when creating your .war file. This should be pretty easy with apache ant and other build tools.