maven for wurfl 1.4 - java

Is anybody else working on wurfl API version 1.4 (latest stable release). I am stuck on configuring my pom.xml for wurfl 1.4
I do not want to add wurfl manually.
ScintiaMobile says that new wurfl is hosted at their server. But the link they provide does not contain 1.4
In short my problem is I have to use maven and wurfl 1.4

Luca Passani, ScientiaMobile's CTO here.
I know some user of the WURFL java API have requested support for Maven.
ScientiaMobile had removed Maven support in 2011, to avoid that people would inject AGPL code in their code base without fully realizing the implications of the AGPL license (strong-copyleft).
We have now introduced support for Maven for commercial licensees of the library, who can use their ScientiaMobile credentials to interact with our private Maven repo.
Details here:
http://www.scientiamobile.com/page/wurfl-adds-maven-support-for-java-programmers
thanks

Well, if the following doesn't work in your pom.xml file:
<dependency>
<groupId>net.sourceforge.wurfl</groupId>
<artifactId>wurfl</artifactId>
<version>1.4</version>
</dependency>
Then what you could probably do is download the proper JAR and stick it into your organization's maven repository (Nexus, Archiva, etc) by uploading it by hand.

Download the jar from https://sourceforge.net/projects/wurfl/files/ .
Add following in your pom.xml:
<dependency>
<groupId>net.sourceforge.wurfl</groupId>
<artifactId>wurfl</artifactId>
<version>{{the.version}}</version>
</dependency>
Fire the below command:
mvn install:install-file -Dfile=path_to_jar/thejar.jar -DgroupId=net.sourceforge.wurfl -DartifactId=wurfl -Dversion=the.version -Dpackaging=jar
This will add the jar in your .m2 folder which can later be picked while your are building your maven project.

Related

why does maven don't download jar files for newer versions of hibernate-core?

So I'm new to maven and watching a course on how to download hibernate-core using maven,
and he went online and got the 5.2.11 version
but I downloaded the latest one 6.1.4
the thing is when he opened his local files the jar files were there like this:
but my version only downloaded these files, even when I removed the type pom:
and when I tried the older version it worked for me, so my question is why did maven do that, and does it make any problem?
also, can I now use hibernate if I don't have an internet connection, or do I need to download the jar files anyway?
NOTE: I'm using Eclipse
Your dependency is declared in a different way from the official documentation. They don't specify a <type>pom</type>, which may be the cause of your problem.
They have it like this:
<dependency>
<groupId>org.hibernate.orm</groupId>
<artifactId>hibernate-core</artifactId>
<version>6.1.4.Final</version>
</dependency>
Remove the type and rebuild the project.

Add library without gradle or maven

I'm developing application backend using google app engine, using eclipse as IDE, and I want to use the google's Firebase SDK. In the integration page, Google give these options to install the backend's SDK:
We publish the Firebase Java SDK to the Maven central repository. To install the library, you can simply declare it as a dependency in your build.gradle file:
dependencies {
compile 'com.google.firebase:firebase-server-sdk:[3.0.0,)'
}
If you use Maven to build your application, you can add the following dependency to your pom.xml:
<dependency>
<groupId>com.google.firebase</groupId>
<artifactId>firebase-server-sdk</artifactId>
<version>[3.0.0,)</version>
</dependency>
The backend doesn't use Gradle to build, and I'm not sure about the Maven option. Until now, I always downloaded the jars for the libraries I used
Thanks.
You can always manually download the jar from a central repository like Maven Central Repository. But I would strongly recommend getting familiar with some Java build tool as it will make your life a lot easier.

What correct maven dependencies to specify for JBehave tutorial project?

I want to study the java spring portion of the Jbehave-tutorial project at https://github.com/jbehave/jbehave-tutorial.
The README.MD states the REQUIREMENTS for building at the bottom:
Building the tutorial has been tested with Maven 3.0.5-3.2.1 and JDK 1.6-1.7. Newer versions of Maven and JDK should work but could also present issues.If you find any, please report them via JIRA
On my computer My Computer I am running Maven Version: 3.3.3 and STS Version: 3.6.4 for 64-bit Windows 7.
I really don't want to make an Atlassian account in order to resolve this issue if I can resolve it on StackOverflow.
So these are the steps I took to build JBehave-tutorial on my machine:
git clone https://github.com/jbehave/jbehave-tutorial.git
mvn clean install -Pstable # Issued in the main parent folder 'jbehave-tutorial'
Imported into Spring Tool Suite (STS) as an existing maven project.
Received the following errors in STS:
This lead me to believe that maven did not correctly download and build those dependencies so I looked into the .m2\repository\org\jbehave folder and this is what I seen.
Did anybody else get this to work?
What workarounds are there?
What correct maven dependencies to specify for JBehave tutorial project in pom.xml(s)?
I'm not immediately clear on your specific situation but here are dependencies required to use JBehave without Spring. (example pom below - you'll only need gherkin if your user scenarios are in gherkin).
https://stackoverflow.com/questions/30685909/jbehave-dependencies-not-available-in-central-maven-repo
I'm also going to hazard a guess that you're going to need the below at the appropriate version.
<dependency>
<groupId>org.jbehave</groupId>
<artifactId>jbehave-spring</artifactId>
<version>4.0.3</version>
</dependency>
Maven cannot find "SNAPSHOT" dependencies.
You need to google "Maven + dependency name without specified version" and check what is the latest version of them and make appropriate changes in pom file.
For example I have jbehave-web-runner version 3.6-beta-2 NOT 3.6-SNAPSHOT.

Android Support Library v7 + Maven + Eclipse: apklib dependency not found in workspace

I'm trying to configure the library v7 support in my project so that it uses ActionBarActivity, thus keeping compliant with some of the Android 2.X versions.
First, follow the documentation from Google and imported the project android-support-v7-appcompat as a library in accordance with Section Adding libraries with resources on Support Library Setup. But this way my Maven Build failed because it could not find the dependence of the library in question.
Now, I decided to seek a cleaner solution, keeping my dependences managed by Maven. To do this follow the instructions of the answer, but using version 19.0.1. This made my Maven Build it were executed successfully, but my project is not compiling in my workspace, the following error occurs on first line of my POM:
dependency=[com.android.support:appcompat-v7:apklib:19.0.1:compile]not found in workspace
My dependencies are as follows:
<dependency>
<groupId>com.android.support</groupId>
<artifactId>appcompat-v7</artifactId>
<version>${com.android.support-version}</version>
<type>apklib</type>
</dependency>
<dependency>
<groupId>com.android.support</groupId>
<artifactId>appcompat-v7</artifactId>
<version>${com.android.support-version}</version>
<type>jar</type>
</dependency>
The project in question is on GitHub, if they want to view it: https://github.com/veniltonjr/msplearning
Thank you in advance!
First, there is no apklib for com.android.support:appcompat-v7. It only ships as an aar.
Second, that library is not available in maven-central, it ships with the Android SDK.
You need to manually deploy it to your local maven repository.
Though you can use maven-sdk-deployer to construct and deploy the apk to your local folder. But you github project is failing due to missing internal dependencies.
com.msplearning.android-support-v4:jar:19.1.0, com.msplearning:android-support-v7-appcompat:jar:19.1.0

Cannot load classes from Guava r08 running in Tomcat. Cannot compile from source. Missing javax.annotations

I'm trying to use RichFaces in my learning JSF application. I have set up Maven using
https://repository.jboss.org/nexus/content/groups/public-jboss/
I have included the dependencies
<dependency>
<groupId>org.richfaces.ui</groupId>
<artifactId>richfaces-components-ui</artifactId>
<version>4.0.0.Final</version>
</dependency>
<dependency>
<groupId>org.richfaces.core</groupId>
<artifactId>richfaces-core-impl</artifactId>
<version>4.0.0.Final</version>
</dependency>
<dependency>
<groupId>org.richfaces.ui</groupId>
<artifactId>richfaces-components-api</artifactId>
<version>4.0.0.Final</version>
<type>pom</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.richfaces.core</groupId>
<artifactId>richfaces-core-api</artifactId>
<version>4.0.0.Final</version>
<type>pom</type>
<scope>compile</scope>
</dependency>
This has fetched guava-r08.jar.
When I try to run the project in Tomcat7 I see a lot of class load exceptions - failing to load classes that I can see exist within guava-r08.jar along with sac-1.3 and cssparser-0.9.5.
If I try to use the source instead - taking source from guava-r09 - Eclipse tells me that it cannot find classes such as javax.annotation.Nullable. Problem is neither can I!
Where can I find these classes, or am I taking the wrong approach from the start?
Thanks
Richard
Maven configuration for RichFaces dependencies
Tomcat fails to load these classes, because RichFaces' dependency on Guava has a runtime scope. Contrary to the compile scope, these dependencies are not added to the classpath when compiling. You must include them yourself.
To achieve this, you should include richfaces-bom in the dependency management section of your POM, as explained in this JBoss wiki article. This will include Guava and all other required dependencies RichFaces might need.
This is the "Bill of Materials" (BOM) pattern. The JBoss wiki explains this pattern far better than I would, and links to other articles on the subject.
javax.annotation.Nullable warnings in the Guava source
These occur because Guava uses JSR 305 annotations. It is not required to depend on the JSR 305 jar when using Guava, because annotations do not require to be present on the classpath once compiled. Of course, if you want to use #Nullable and other such annotations in your code (you definitely should), you'll need to add a dependency on the JSR 305 jar.
I have started from scratch using instructions at jboss.org
I installed Maven 3.0.3
I copied the supplied settings.xml to my .m2 directory and added the JBOSS section from 1
I used the command line to create the project:
mvn archetype:generate -DarchetypeGroupId=org.richfaces.archetypes \
-DarchetypeArtifactId=richfaces-archetype-simpleapp \
-DarchetypeVersion=4.0.0-SNAPSHOT \
-DgroupId=uk.m0rjc \
-DartifactId=jsfplay
I then built the project. I had to remove the previously downloaded guava jars from my m2 repository because they were corrupt - perhaps my initial problem.
mvn clean package
I copied the WAR file it produced to Tomcat and navigated to the sample page at localhost:8080/jsfplay-1.0-SNAPSHOT/
I had some issues making the project work in Eclipse. These may be due to my setup from previous experiments.
I used the "Import -> Maven -> Existing Maven Project" to import it
I had to switch the project to JDK 1.6 and 1.6 compatibility mode.
I was unable to use the JavaServer Faces facet. This does not seem to matter.
I had to set my Server Profile to use the right JDK
I had to map *.xhtml to the Faces Servlet in web.xml. It may have been corrupted when I pressed a wrong button to accept a JSF addin.
Then it worked!!
Now to try porting my existing code to the new project.

Categories