SmartGWT 3.0 with Maven - maven

I couldn't find the SmartGWT 3.0 entry for maven.
For 2.4, I found below link:
http://code.google.com/p/smartgwt/wiki/NightlyBuilds_and_MavenRepository

Have you tried: http://www.smartclient.com/maven2/com/smartgwt/smartgwt/3.0/smartgwt-3.0.pom ?
Repository: http://www.smartclient.com/maven2
<dependency>
<groupId>com.smartgwt</groupId>
<artifactId>smartgwt</artifactId>
<version>3.0</version>
</dependency>

I do realize this questions is about SmartGWT 3.0 but I ended up here looking for maven dependency setup for SmartGWT 4.0 and since this is the current stable version it may be worth sharing. This is the repositories/dependencies setup that works for me:
<repositories>
<!-- other repositories -->
<repository>
<id>smartgwt</id>
<url>http://www.smartclient.com/maven2</url>
</repository>
</repositories>
<dependencies>
<!-- other dependencies -->
<dependency>
<groupId>com.smartgwt</groupId>
<artifactId>smartgwt</artifactId>
<version>4.0</version>
</dependency>
</dependencies>

<groupId>com.googlecode.smartgwt-maven-plugin</groupId>
<artifactId>smartgwt-maven-plugin</artifactId>
<version>3.1</version>

Related

Maven spring-data-elasticsearch dependency Not Found

I have a spring boot app for which I want to use the dependency spring-data-elasticsearch. I'm using one of the latest version of Elasticsearch on my server (v5.4.x) so I had to use the latest snapshot of spring-data-elasticsearch (3.0.0.BUILD-SNAPSHOT).
According to the git page (link below) :
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/README.md
I have to declare in my pom.xml a special repository where is located this specific version of the dependency, as you can see below :
<repositories>
<repository>
<id>spring-libs-snapshot</id>
<name>Spring Snapshot Repository</name>
<url>http://repo.spring.io/libs-snapshot</url>
</repository>
</repositories>
<dependencies>
<!-- ELK -->
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-elasticsearch</artifactId>
<version>3.0.0.BUILD-SNAPSHOT</version>
</dependency>
<!-- Spring -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<!-- MySQL -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
</dependencies>
But I have the following error on my pom.xml :
Missing artifact org.springframework.data:spring-data-elasticsearch:jar:3.0.0.BUILD-SNAPSHOT
Anyone knows where the problem is coming from please ? I'm pulling hairs out of my head since 2 hours.
Thank you !
You probably have to add the Spring snapshot repository to your pom.xml
<repositories>
<repository>
<id>repository.spring.snapshot</id>
<name>Spring Snapshot Repository</name>
<url>http://repo.spring.io/snapshot</url>
</repository>
</repositories>
Thanks for your replies but I'm feeling like a fool. In my company we work with a nexus where all the repos are deployed, so I had to add the informations about the repos in my nexus too.
Sorry for the inconvenience.

Missing artifact de.jetwick:snacktory:jar:1.1-SNAPSHOT

I am trying to use snacktory thus I have the following in my pom.xml file:
<!-- ... -->
<dependencies>
<!-- ... -->
<dependency>
<groupId>de.jetwick</groupId>
<artifactId>snacktory</artifactId>
<version>1.1-SNAPSHOT</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>snacktory_snapshots</id>
<url>https://github.com/karussell/mvnrepo/tree/master/snapshots/de/jetwick/snacktory/</url>
</repository>
</repositories>
</project>
However, I am getting
Missing artifact de.jetwick:snacktory:jar:1.1-SNAPSHOT
in Eclipse from the Maven build. I've tried, as in another question stated 1.2 and 1.3 as well but the result is the same.
Why am I not able to get this dependency?
If you look on their github repository (used as a maven repository), they provide the repository url to use : https://github.com/karussell/mvnrepo
Change the repository to:
<repository>
<id>snacktory_snapshots</id>
<url>https://github.com/karussell/mvnrepo/raw/master/snapshots</url>
</repository>
Use the release instead
I would advise you to use their release version instead:
<repository>
<id>snacktory_releases</id>
<url>https://github.com/karussell/mvnrepo/raw/master/releases</url>
</repository>
with the dependency:
<dependency>
<groupId>de.jetwick</groupId>
<artifactId>snacktory</artifactId>
<version>1.2</version>
</dependency>

Maven dependecy for EL 2.1

i want to add the maven dependency for EL 2.1 with scope provided to be used with tomcat 6 but couldn't find it, any ideas where i can download it ?
There is a special tomcat version of el-api:
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>el-api</artifactId>
<version>6.0.35</version>
<scope>provided</scope>
</dependency>
Unfornately the source isn't in central, use:
<repository>
<id>intersult-repo</id>
<name>Intersult Repository</name>
<url>http://intersult.com/public/maven</url>
</repository>
http://search.maven.org/#search%7Cga%7C1%7Cel
Jeez.. I got a downvote for that although it is right there. In detail
http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22javax.el%22%20AND%20a%3A%22el-api%22
or completely done all your work
<dependency>
<groupId>javax.el</groupId>
<artifactId>el-api</artifactId>
<version>2.2</version>\
<scope>provided</scope>
</dependency>
Note that this is in central and it is 2.2. because 2.1 was released as 2.2 when it went final..

jersey and jackson maven dependency issues?

I have just started building a web app using jersey and jackson. After initially getting up and running I decided that it made sense in the long run to convert the project to be a maven one. I'm very new to maven and it seems like I might have run into a dependency issue between jersey and jackson.
I put together a simple test to check that everything had been set up correctly after running into issues with some of my project tests that use jackson. The user object is based on the one in the jackson tutorial
#Test
public void testJacksonSetup() throws IOException {
String json = "{\"name\":{\"first\":\"Joe\",\"last\":\"Sixpack\"},\"verified\":false,\"gender\":\"MALE\",\"userImage\":\"Rm9vYmFyIQ==\"}";
ObjectMapper mapper = new ObjectMapper();
User user = mapper.readValue(json, User.class);
assertEquals("Joe", user.getName().getFirst());
Writer strWriter = new StringWriter();
mapper.writeValue(strWriter, user);
assertEquals(json, strWriter.toString());
}
which is throwing the following exception
org.codehaus.jackson.type.JavaType.isMapLikeType()Z
java.lang.NoSuchMethodError: org.codehaus.jackson.type.JavaType.isMapLikeType()Z
at org.codehaus.jackson.map.ser.BasicSerializerFactory.buildContainerSerializer(BasicSerializerFactory.java:396)
at org.codehaus.jackson.map.ser.BasicSerializerFactory.buildContainerSerializer(BasicSerializerFactory.java:396)
at org.codeh
I tried running the same test in a simple maven java application to make sure there weren't issues with the way I had set up the jackson dependencies and everything worked. I suspect the problem is caused by some dependency issue between jersey and jackson since it also uses jackson. I also suspect that way I cobbled have the pom file for my web app together could be problem. Here is the content of my pom with some slight naming changes (as I said before I'm new to using maven so I'd say this is a pretty ugly pom file)
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.myproject.app</groupId>
<artifactId>app</artifactId>
<version>0.1-SNAPSHOT</version>
</parent>
<groupId>com.myproject.app</groupId>
<version>${project.parent.version}</version>
<artifactId>my-web-app</artifactId>
<name>My web app</name>
<packaging>war</packaging>
<properties>
<netbeans.hint.deploy.server>gfv3</netbeans.hint.deploy.server>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jersey-version>1.8-SNAPSHOT</jersey-version>
</properties>
<profiles>
<profile>
<id>default</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<dependencies>
<dependency>
<groupId>com.myproject.app</groupId>
<artifactId>myproject-core</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-server</artifactId>
<version>${jersey-version}</version>
<!--<scope>provided</scope>-->
</dependency>
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-json</artifactId>
<version>${jersey-version}</version>
<!--<scope>provided</scope>-->
</dependency>
<dependency>
<groupId>com.sun.jersey.contribs</groupId>
<artifactId>jersey-multipart</artifactId>
<version>${jersey-version}</version>
<!--<scope>provided</scope>-->
</dependency>
<dependency>
<groupId>com.sun.jersey.jersey-test-framework</groupId>
<artifactId>jersey-test-framework-grizzly2</artifactId>
<version>${jersey-version}</version>
<scope>test</scope>
</dependency>
<!-- for external testing -->
<dependency>
<groupId>com.sun.jersey.jersey-test-framework</groupId>
<artifactId>jersey-test-framework-external</artifactId>
<version>${jersey-version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
<version>1.8.2</version>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-xc</artifactId>
<version>1.8.1</version>
</dependency>
</dependencies>
</profile>
</profiles>
<build>
<finalName>mywebapp</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.1.1</version>
<configuration>
<packagingExcludes>WEB-INF/glassfish-web.xml</packagingExcludes>
</configuration>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<inherited>true</inherited>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<!-- Run the application using "mvn embedded-glassfish:run" -->
<plugin>
<groupId>org.glassfish</groupId>
<artifactId>maven-embedded-glassfish-plugin</artifactId>
<version>3.1</version>
<configuration>
<goalPrefix>embedded-glassfish</goalPrefix>
<app>${basedir}/target/mywebapp.war</app>
<autoDelete>true</autoDelete>
<port>8080</port>
</configuration>
<dependencies>
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-server</artifactId>
<version>1.7</version>
</dependency>
<dependency>
<groupId>org.glassfish</groupId>
<artifactId>javax.servlet</artifactId>
<version>3.1</version>
</dependency>
<dependency>
<groupId>org.glassfish</groupId>
<artifactId>javax.ejb</artifactId>
<version>3.1</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>6.1.24</version>
<configuration>
<webApp>${basedir}/target/mywebapp.war</webApp>
<contextPath>treemetrics-api-01</contextPath>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>xslt-maven-plugin</artifactId>
<version>1.0</version>
<executions>
<execution>
<id>update-gf-deps</id>
<phase>package</phase> <!-- append to the packaging phase. -->
<goals>
<goal>transform</goal> <!-- goals == mojos -->
</goals>
<configuration>
<xslFile>src/main/xslt/gf.xsl</xslFile>
<srcDir>.</srcDir>
<srcIncludes>pom.xml</srcIncludes>
<destDir>target/gf-pom-file</destDir>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<pluginRepositories>
<pluginRepository>
<id>maven2-repository.dev.java.net</id>
<name>Java.net Repository for Maven</name>
<url>http://download.java.net/maven/2/</url>
<layout>default</layout>
</pluginRepository>
<pluginRepository>
<id>maven2-glassfish-repository.dev.java.net</id>
<name>Java.net Repository for Maven</name>
<url>http://download.java.net/maven/glassfish/</url>
</pluginRepository>
</pluginRepositories>
<repositories>
<repository>
<id>glassfish-repository</id>
<name>Java.net Repository for Glassfish</name>
<url>http://download.java.net/maven/glassfish</url>
</repository>
<repository>
<id>maven2-repository.dev.java.net</id>
<name>Java.net Repository for Maven</name>
<url>http://download.java.net/maven/2/</url>
<layout>default</layout>
</repository>
</repositories>
Does anyone know what is causing the issues with jackson and If there is a dependency issue with jersey and how to resolve it?
As already mentioned, this is probably a version conflict (error message does suggest that something is compiled against 1.8, but an earlier version is being used somehow).
One thing that I have noticed to cause issues is that versions of "core" and "mapper" jars may differ. In this case, for example, it sounds like mapper version 1.8 was being used, but core jar version was earlier. Although Jackson core jar does define proper version, Maven may not rely on that information but by version some other component mandates.
So whenever specifying dependency to Jackson from your own pom.xml, make sure that versions of core (jackson-asl-core) and mapper (jackson-ask-mapper) are both defined, and have same value (or at least same minor versions, 1.8.x).
I was having the same issue after I upgraded the datanucleus-hbase lib.
My solution was to include the two jackson libs:
<dependency>
<groupId>org.datanucleus</groupId>
<artifactId>datanucleus-hbase</artifactId>
<version>3.1.0-m1</version>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-core-asl</artifactId>
<version>1.9.4</version>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
<version>1.9.4</version>
</dependency>
The jersey-json dependencies have its own jackson dependency.
For Jersey 1.8 its Jackson 1.7.1. So, start by removing the 1.8.1 and 1.8.2 dependencies, they may cause trouble. Maven is not deterministic: if it encounters two versions of the same dependency (with the same count), the chosen one cannot be predicted.
You don't have to create a JSON string neither to call Jackson mapper yourself. Take a look a this fully working/tested app I've post on GitHub. Hope it will help.

maven repository unavailable - richfaces

Update: As soon as I posted this, the repository URL began working. However, If you know how to address this, please enlighten me since I can see this happening again. Thank you all very much.
New to maven here.
I'm using RichFaces 4 and Netbeans 7
When I package the app gets:
http://download.java.net/maven/2/org/richfaces/richfaces-bom/4.0.0-SNAPSHOT/maven-metadata.xml
That URL is currently unavailable. As such, I'm not able to run my app because the build fails.
There must be a way around this and it's probably simple but my searches have come up with nothing.
Here are the relevent parts of my pom.xml
<repository>
<id>java-net</id>
<name>Java.net Maven Repository</name>
<url>http://download.java.net/maven/2</url>
</repository>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<!-- Setting this property using archetype-metadata.xml requiredPorperty
so that generated project uses correct version of richfaces.
-->
<org.richfaces.bom.version>4.0.0-SNAPSHOT</org.richfaces.bom.version>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.richfaces</groupId>
<artifactId>richfaces-bom</artifactId>
<version>${org.richfaces.bom.version}</version>
<scope>import</scope>
<type>pom</type>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.richfaces.ui</groupId>
<artifactId>richfaces-components-ui</artifactId>
</dependency>
<dependency>
<groupId>org.richfaces.core</groupId>
<artifactId>richfaces-core-impl</artifactId>
</dependency>
<dependencies>
I've tried setting up mirrors in my settings but it appears to be incomplete since it's not working for me. Here is my attempt at the mirror.
Note: I randomly selected the mirror so it's probably not what I want. Just trial and error to see what would happen.
<mirrors>
<mirror>
<id>RM</id>
<name>Java Net Mirror</name>
<url>http://repo1.maven.org/maven2</url>
<mirrorOf>java-net</mirrorOf>
</mirror>
Thanks in advance for any help you can sen my way.
You should definitly install a repository manager like Archiva, Nexus or Artifactory (http://www.jfrog.com/products.php) to avoid situations like this.
A Repository Manager will cache the external or self-generated maven artifacts for you and is really indispensible for any serious maven work.

Resources