I am developing an application for nitrogen. When I ran maven to generate an archetype, I got directories like features/features-X and features/odl-X with pom.xml in each one. Presumably, I am supposed to put feature dependencies in these pom.xml files. What is the difference between these two directories? Thanks
The features-X directory aggregates all the project's features in a feature repository. The odl-* directories are the project's single features. A feature repository is registered with karaf via the feature:repo-add command or the featuresRepositories property in etc/org.apache.karaf.features.cfg. It makes all the project's features available to karaf so they can be installed via feature:install.
Related
I have project where I use the bnd-maven-plugin from the bndtools project. I've tried to follow the conventions from the enRoute OSGI maven tutorial. So, I have a parent directory with a module pom, and a subdirectory for each bundle, and one for packaging and running the whole thing (with the bndrun file).
Question is, how do I pass configuration? Previously, when I built the bundles with the (felix) maven-bundle-plugin, I would drop the bundles in the deploy folder in Karaf, and make a file for the PID in the config directory, but I can't do that when building a standalone jar - or at least I can't find a way to do it.
Configuration is independent from bndtools and bnd-maven-plugin.
The way to provide configuration depends on the installed configuration admin impl. If you install felix config admin and fileinstall then you can supply the configuration in a config folder like you are used to.
For an example see the osgi-chat example. It is built with maven, the bundles are created with bnd-maven-plugin and the runnable jar is created using bndtools.
Felix config admin and file install are configured in rsa.bndrun.
Is there a way we can load all the jar files inside a folder, as dependencies in a maven project.
So that, I do not have to mention each and every jar files in pom.xml, just mention or tell maven to pick all the jar files from folder 'x' and build the system.
Is this supported by maven?
I think this is supported by ant. Not sure whether gradle supports either.
In
https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#System_Dependencies
you see that you can reference single files, but there is no mechanism for directories. As I mentioned in the comment, using the disk is discouraged in general.
If you need the same set of dependencies in many projects, you can write a pom for that and use it (as parent or by setting a dependency to it).
So I was following http://www.mkyong.com/jsf2/jsf-2-0-hello-world-example/ for a simple tutorial on how to use maven and jsf. I created a maven project by running mvn archetype:generate -Dfilter=org.apache:maven-archetype-webapp in my command prompt. Then I continued with the tutorial, I wound up creating all necessary files, but then when I got to the end, I realized I did have a server created. So I created one real quick, but when it came to the point of adding files to the server (from the add or remove dialog box), no projects or files showed up. I am not on my computer where the project is located so I can't copy/paste the .pom file in, but it looks practically exactly like the pom in the tutorial (only difference is groupId, artifact, ect.) No additional plugins, dependencies, or configs.
Do you want to deploy the webapp within Eclipse to Tomcat? Or as some sort of automatic/continuous deployment?
Within Eclipse you often need to add the Dynamic Web project and JSF facets to your project so Eclipse recognizes the project as deployment capable. If you are using m2eclipse make sure to install the m2eclipse wtp add on so this is done automatically.
If you want to add auto-deployment to the pom.xml I recommend using the maven cargo plugin: http://cargo.codehaus.org/Maven2+plugin - it supports the major containers.
For tomcat you need to modify the tomcat-users.xml to allow auto-deployment and leave the tomcat-manager application in place. If you have startet tomcat and pointing your browser to http://localhost:8080/manager/html/list it should either tell you to login or what to add to that file.
The configured user is then used in the configuration to deploy the war file via the tomcat-manager using the mvn cargo:deploy goal. The configuration has to be added to the pom.xml using war as packaging, not to the parent-pom.xml
I have a number of JAR files that comprise two different Java SDKs for BOXI R3.1: BusinessObjects Enterprise Java SDK and the Web Services Consumer Java SDK.
The BusinessObjects Enterprise Java SDK has a number of 'core' JARs:
biarengine.jar
biplugins.jar
cecore.jar
celib.jar
ceplugins_client.jar
ceplugins_core.jar
ceplugins_cr.jar
cereports.jar
cesession.jar
ceutils.jar
corbaidl.jar
ebus405.jar
flash.jar
SL_plugins.jar
logging.jar
pluginhelper.jar
xcelsius.jar
and a number of dependencies:
asn1.jar
backport-util-concurrent-2.2.jar
certj.jar
commons-logging.jar
derby.jar
freessl201.jar
jsafe.jar
log4j.jar
rascore.jar
sslj.jar
The Javadocs are available as a ZIP file.
The situation is similar for the web-services SDK, so I will omit the details.
Goal: package each SDK and its Javadoc as a local, Maven repository (it doesn't appear that SAP is providing a remote one).
Questions:
can one Maven repository contain multiple JAR files? The mvn deploy:deploy-file plugin seems to only work on a single file: How to add a jar, source and Javadoc to the local Maven repository?
should Javadocs be kept in ZIP format in a Maven repository?
if i choose to make to repos for a given SDK (i.e. core and dependencies), is specifying the linkage as easy as editing the core repos' configuration file?
rather than creating a repo for the dependencies, I'm assuming that it would be better to identify and reference existing Maven repos (e.g log4j.jar). Will this lead me to JAR hell?
Yes a maven repo can contain multiple files, you can execute mvn deploy:deploy-file on each one (using -Djavadoc and -Dsources as needed).
To specify dependencies for a jar, create a pom file for it (with dependencies) and use -DpomFile (and omit -DgeneratePom) in mvn deploy:deploy-file.
Yes you should not re-invent the wheel and deploy artifacts to your repository that are already in central. You can use tools like http://mvnrepository.com to search for your jars (look META-INF/MANIFEST.MF in your jars to find the version).
For more info see: http://maven.apache.org/plugins/maven-deploy-plugin/deploy-file-mojo.html.
I have several Maven profiles, which should not all be available on all machines. So I don't want to put them into the super pom in the root directory.
However, as far as I can see there is no way to put Maven 3 build profiles into different files and include them during runtime using activation rules and command line parameters.
Or am I wrong?
In Maven 3 there is no possibility to put profiles into an external file. In earlier version (Maven 2.2.1 there exists a profiles.xml).