Okay, so, I am trying what I would’ve thought would be simple and extremely common. But I can’t get passed a "Missing artifact’ error. Everything worked fine without Maven, now I’m transitioning to Maven and having the issue.
I’m just creating a maven vaadin project with vaadin-archetype-clean and then typing in a dependency in the pom and adding the vaadin-addon repository. I followed the instructions listed here
Maven Vaadin Wiki
and here
Using Vaadin Addons with Maven
as best I could but I still keep getting this error. It does not matter what addon I choose. Any vaadin add-on gives me the same “Missing artifact” error.
I tried using the vaadin-archetype-sample and vaadin-archetype-widget just to see if they would work for me. Both of them did! But the problem is even though I was able to compile the widgetset in vaadin-archetype-sample its widgetset was not an external vaadin add-on, so the sample did not demonstrate for me how to reference a vaadin addon with maven successfully.
I found this forum post
similar problem
and thought the sample code link on google code for vopenlayers might be useful to me, but I could not see any significant differences in the pom.xml listed there. I also could not see how to download it and try it in eclipse. (I downloaded the jar file but that didn’t really help me.)
So, in my sample test project where I am getting this “Missing artifact” error I tossed in an org.primefaces dependency, with it’s corresponding repository from another project because I knew that one had worked for me… and it still worked fine here in my Vaadin project. But no Vaadin add-on dependencies will, it seems.
I came across this link
Missing Artifact
that suggests the metatdata for the artifact might be incorrect in the Nexus, but these artifacts are not cached there at all. I’ve tried deleting the vaadin folder and all its subdirectories from my local maven repo but it still did not get me anywhere.
I am using m2e. In Eclipse I am told I have the following two errors on this project called VaadinTest “Missing artifact org.vaadin.addons:formsender:jar:0.1” “Missing artifact org.vaadin.addons:browsercookies.jar:1.04” These are the two add-ons I tried to add, but I get the same message for any add-on I try. Any help toward a resolution for this would be greatly appreciated.
Here is the output of my Maven install attempt in the console:
(note: I have placed ***** in certain places to mask certain bits of inconsequential private data.)
[INFO]
Scanning for projects...
[INFO]
[INFO]
------------------------------------------------------------------------
[INFO]
Building Vaadin Web Application 0.0.1-SNAPSHOT
[INFO]
------------------------------------------------------------------------
[WARNING]
The POM for org.vaadin.addons:browsercookies:jar:1.04 is missing, no dependency information available
[WARNING]
The POM for org.vaadin.addons:formsender:jar:0.1 is missing, no dependency information available
[INFO]
------------------------------------------------------------------------
[INFO]
BUILD FAILURE
[INFO]
------------------------------------------------------------------------
[INFO]
Total time: 0.762s
[INFO]
Finished at: Tue Jun 05 16:47:46 CDT 2012
[INFO]
Final Memory: 6M/119M
[INFO]
------------------------------------------------------------------------
[ERROR]
Failed to execute goal on project VaadinTest: Could not resolve dependencies for project *************:VaadinTest:war:0.0.1-SNAPSHOT: The following artifacts could not be resolved: org.vaadin.addons:browsercookies:jar:1.04, org.vaadin.addons:formsender:jar:0.1: Failure to find org.vaadin.addons:browsercookies:jar:1.04 in http://*************:8081/nexus/content/groups/public was cached in the local repository, resolution will not be reattempted until the update interval of nexus has elapsed or updates are forced -> [Help 1]
[ERROR]
[ERROR]
To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR]
Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR]
For more information about the errors and possible solutions, please read the following articles:
[ERROR]
[Help 1]
http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
My pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.******</groupId>
<artifactId>VaadinTest</artifactId>
<packaging>war</packaging>
<version>0.0.1-SNAPSHOT</version>
<name>Vaadin Web Application</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.3.1</version>
<configuration>
<archive>
<index>true</index>
<manifest>
<addClasspath>true</addClasspath>
<!-- Implementation-Title and Implementation-Version come from the POM by default -->
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
</manifest>
<manifestEntries>
<!-- Package format version - do not change -->
<Vaadin-Package-Version>1</Vaadin-Package-Version>
<!-- Add-on specific fields to update -->
<!-- Implementation-Title and Implementation-Version come from the POM by default -->
<!--
<Implementation-Title>${pom.name}</Implementation-Title>
<Implementation-Version>${pom.version}</Implementation-Version>
-->
<!-- Comma-separated list of widgetsets in the package -->
<!-- Vaadin-Widgetsets>com.**********.VaadinWidgetTest.gwt.MyWidgetSet</Vaadin-Widgetsets-->
</manifestEntries>
</archive>
</configuration>
</plugin>
<!-- Compile custom GWT components or widget dependencies with the GWT compiler -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<version>2.1.0-1</version>
<configuration>
<webappDirectory>${project.build.directory}/${project.build.finalName}/VAADIN/widgetsets</webappDirectory>
<extraJvmArgs>-Xmx512M -Xss1024k</extraJvmArgs>
<runTarget>VaadinTest</runTarget>
<hostedWebapp>${project.build.directory}/${project.build.finalName}</hostedWebapp>
<noServer>true</noServer>
<port>8080</port>
<soyc>false</soyc>
</configuration>
<executions>
<execution>
<goals>
<goal>resources</goal>
<goal>compile</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-maven-plugin</artifactId>
<version>1.0.1</version>
<executions>
<execution>
<configuration>
</configuration>
<goals>
<goal>update-widgetset</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- A simple Jetty test server at http://localhost:8080/VaadinTest can be launched with the Maven goal jetty:run
and stopped with jetty:stop -->
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>6.1.24</version>
<configuration>
<stopPort>9966</stopPort>
<stopKey>VaadinTest</stopKey>
<!-- Redeploy every x seconds if changes are detected, 0 for no automatic redeployment -->
<scanIntervalSeconds>0</scanIntervalSeconds>
<!-- make sure Jetty also finds the widgetset -->
<webAppConfig>
<contextPath>/VaadinTest</contextPath>
<baseResource implementation="org.mortbay.resource.ResourceCollection">
<!-- Workaround for Maven/Jetty issue http://jira.codehaus.org/browse/JETTY-680 -->
<!-- <resources>src/main/webapp,${project.build.directory}/${project.build.finalName}</resources> -->
<resourcesAsCSV>src/main/webapp,${project.build.directory}/${project.build.finalName}</resourcesAsCSV>
</baseResource>
</webAppConfig>
</configuration>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.codehaus.mojo</groupId>
<artifactId>
gwt-maven-plugin
</artifactId>
<versionRange>
[2.1.0-1,)
</versionRange>
<goals>
<goal>resources</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore></ignore>
</action>
</pluginExecution>
<pluginExecution>
<pluginExecutionFilter>
<groupId>com.vaadin</groupId>
<artifactId>
vaadin-maven-plugin
</artifactId>
<versionRange>
[1.0.1,)
</versionRange>
<goals>
<goal>update-widgetset</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore></ignore>
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
<repositories>
<repository>
<id>vaadin-snapshots</id>
<url>http://oss.sonatype.org/content/repositories/vaadin-snapshots/</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>vaadin-addons</id>
<url>http://maven.vaadin.com/vaadin-addons</url>
</repository>
<repository>
<id>prime-repo</id>
<name>PrimeFaces Maven Repository</name>
<url>http://repository.primefaces.org</url>
<layout>default</layout>
</repository>
</repositories>
<!--
<pluginRepositories>
<pluginRepository>
<id>codehaus-snapshots</id>
<url>http://nexus.codehaus.org/snapshots</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
<releases>
<enabled>false</enabled>
</releases>
</pluginRepository>
<pluginRepository>
<id>vaadin-snapshots</id>
<url>http://oss.sonatype.org/content/repositories/vaadin-snapshots/</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
<releases>
<enabled>false</enabled>
</releases>
</pluginRepository>
</pluginRepositories>
-->
<dependencies>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin</artifactId>
<version>6.5.3</version>
</dependency>
<!-- This is also used by gwt-maven-plugin to deduce GWT version number. -->
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>
<version>2.1.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.vaadin.addons</groupId>
<artifactId>browsercookies</artifactId>
<version>1.04</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>org.primefaces</groupId>
<artifactId>primefaces</artifactId>
<version>3.0.1</version>
</dependency>
<dependency>
<groupId>org.vaadin.addons</groupId>
<artifactId>formsender</artifactId>
<version>0.1</version>
<type>jar</type>
</dependency>
</dependencies>
</project>