Maven build failure from missing artifact

734 views
Skip to first unread message

marcus wells

unread,
Sep 21, 2013, 10:52:05 PM9/21/13
to home-clima...@googlegroups.com
Hello all

When building with maven using subversion I get the following error:

[ERROR] Failed to execute goal on project dz3-scheduler-gcal: Could not resolve dependencies for project net.sf.dz3:dz3-scheduler-gcal:jar:3.6.6-SNAPSHOT: Could not find artifact com.github.dcarter.gdata-java-client:gdata-calendar-2.0:jar:1.41.1-SNAPSHOT in sonatype-nexus-snapshots (http://oss.sonatype.org/content/repositories/snapshots) -> [Help 1]

Vadim tells me that Google hasn't released their jars to Maven Central Repository, and David Carter came forward in the past with a mechanism to make it available. This no longer seems to be working. Are you still around David? Does anybody have a workaround that they are using? It seems I can find what I need here: http://www.java2s.com/Code/Jar/g/Downloadgdatacalendar20jar.htm , but I'm not sure how to use subversion to manage it so will have to clunk it out manually.

Thanks for any help

Marcus

marcus wells

unread,
Sep 22, 2013, 3:08:43 AM9/22/13
to home-clima...@googlegroups.com
An update:

Given the repository path in [install dir}/dz3-master/pom.xml installed when running:

refers to http://oss.sonatype.org/content/repositories/snapshots which is no longer maintained I started looking for alternatives. The options seem either:

1. Manual installation of jars (ouch)
2. Alternative repository and pom.xml update so I could do a "maven clean install" in the directory. 

When exploring option 2 I came upon the following pieces of information:
https://github.com/dcarter/Google-Data-APIs-Mavenized -this is an explanatory document by David Carter relating why he set up the (no longer maintained) repo, and it refers to;

So I've been trying to update my  [install dir}/dz3-master/pom.xml to reflect the new repo, but as alluded to in David's missive one needs to be careful with dependencies (which vadim seems to tidily manage in  [install dir}/dz3-master/dz3-scheduler-gcal/pom.xml

mandubian seems to have a nice explanation on dependencies here: https://code.google.com/p/mandubian-mvn/wiki/HowTo

Trouble is I'm buggered if I can get maven to build successfully as it keeps coming up with an error explaning that it cannot come up with artifact in the mandubian repo described in the dependency (I have it set to 1.41.1 in the <version> tag, essentially removing "-SNAPSHOT" from [install dir}/dz3-master/dz3-scheduler-gcal/pom.xml )

So I'm giving up pending the working week. If I'm missing anything please feel free to point out my errors (as building with maven is new to me)

Thanks

Marcus

marcus wells

unread,
Oct 9, 2013, 12:46:32 AM10/9/13
to home-clima...@googlegroups.com, Maximilian Scheel
Max must have been bored as he has kindly written a bash script which:

1. Checks out up-to-date code with svn
2. Downloads missing dependencies from mandubian.com
3. Patches the appropriate pom file to reflect alternative dependencies

I'm having problems with my setup with the installation built from source, but I think they are related to my ARM setup, rather than the updated dependencies as the problems seem worse with the downloaded prebuilt code. I'm still digging through logs....

Hope this helps somebody!

If using this build remember to reference classpath-dev in dz-runner (rather than classpath), update version info in classpath-dev (instructions in file) and modify paths in classpath-dev for your created directory (old ones below):

# GOOGLE_COLLECT=./lib/google-collect-1.0-rc1.jar
# GDATA_CORE=./lib/gdata-core-1.0.jar
# GDATA_CLIENT=./lib/gdata-client-1.0.jar
# GDATA_CALENDAR=./lib/gdata-calendar-2.0.jar

Install and build file follows:


#! /bin/bash
version=1.41.1
echo $version


# NOTES:
#
#

#Change following to installation directory for your needs
mkdir code3
cd code3




mvn install:install-file -Dfile=gdata-calendar-2.0-${version}.jar -DpomFile=gdata-calendar-2.0-${version}.pom
mvn install:install-file -Dfile=gdata-client-1.0-${version}.jar -DpomFile=gdata-client-1.0-${version}.pom
mvn install:install-file -Dfile=gdata-core-1.0-${version}.jar -DpomFile=gdata-core-1.0-${version}.pom


mkdir xbee
cd xbee
unzip xbee-api-0.5.5.zip
mvn install:install-file -DgroupId=com.rapplogic -DartifactId=xbee-api -Dversion=0.5.5 -Dfile=xbee-api-0.5.5.jar -Dpackaging=jar -DgeneratePom=true
cd ..


rm -rf gdata*
rm -rf xbee


patch dz3-master/dz3-scheduler-gcal/pom.xml < ../patch.txt

#    <dependency>
#      <groupId>com.google.gdata</groupId>
#      <artifactId>gdata-calendar-2.0</artifactId>
#      <version>1.41.5</version>
#    </dependency>

cd jukebox-master
mvn install -Dmaven.test.skip

cd ../servomaster-common
mvn install -Dmaven.test.skip

cd ../dz3-master
mvn install -Dmaven.test.skip


Thanks Max!

marcus wells

unread,
Oct 12, 2013, 11:36:58 PM10/12/13
to home-clima...@googlegroups.com, Maximilian Scheel
Hello list

After a successful maven build as per the previous post's bash script I found that I was getting a few errors that meant that:

1. The proxy was not being fed the data from the dz installation
2. The schedule wasn't being pulled from google calendar

It turns out that stock xbee and gcal jars don't work for dz3 so the  solution is to use the jar's provided with code checked out with svn while using some pom's from mandubin to help it all fit into place. There are several files that include:

- a script for checking code out, downloading pom's from mandubian, configuring maven to use jar's in checked out data and patching a pom file to point to different dependency that is absent due to David Carter no longer maintaining the jar repo
- the patch file
- a script for patching classpath-dev, dz-runner and dz-jconsole to reflect local install paths with various patch files (some are a bit messy - sorry)

initial build script first:

#! /bin/bash
version=1.41.1
echo $version

#install location and directory - ensure they don't exist prior to start and delete repo
# contents from ~/.m2
install_location=/home/dz
install_dir=codebase


# NOTES:
# mandubian gcal jars build OK but don't seem to allow us to to connect to google calendar to pull a schedule
# so we use their poms to build from jars sourced from checked out dz3-shell
# We must do the same for xbee jar as Vadim has modified it for dz (see https://groups.google.com/forum/#!topic/home-climate-control/Cz2imtCUEyM )

cd $install_location
mkdir $install_dir
cd $install_dir
#need pom's from mandubian to make the damn thing work? 
# install gdata jars from dz3-shell rather than missing repo (cannot use mandubian files because they don't work)
mvn install:install-file -Dfile=dz3-shell/lib/gdata-calendar-2.0.jar -DpomFile=gdata-calendar-2.0-${version}.pom
mvn install:install-file -Dfile=dz3-shell/lib/gdata-client-1.0.jar -DpomFile=gdata-client-1.0-${version}.pom
mvn install:install-file -Dfile=dz3-shell/lib/gdata-core-1.0.jar -DpomFile=gdata-core-1.0-${version}.pom

# install xbee jar from dz3-shell for same reason
mvn install:install-file -DgroupId=com.rapplogic -DartifactId=xbee-api -Dversion=0.5.5 -Dfile=dz3-shell/lib/xbee-api-0.5.5.jar -Dpackaging=jar -DgeneratePom=true

# Clean up
rm gdata*.pom

# patch svn pom as it references missing repo
patch dz3-master/dz3-scheduler-gcal/pom.xml < ../patch.txt

#    <dependency>
#      <groupId>com.google.gdata</groupId>
#      <artifactId>gdata-calendar-2.0</artifactId>
#      <version>1.41.5</version>
#    </dependency>

cd jukebox-master
mvn install -Dmaven.test.skip

cd ../servomaster-common
mvn install -Dmaven.test.skip

cd ../dz3-master
mvn install -Dmaven.test.skip

echo " "
echo "Run classpath and shell script patches to finalise install"

Then patch.txt:

--- dz3-master/dz3-scheduler-gcal/pom.xml 2013-09-25 02:33:09.697304698 +0200
+++ dz3-master/dz3-scheduler-gcal/pom.xml 2013-09-25 02:52:25.318899474 +0200
@@ -24,9 +24,9 @@
       for better decoupling
     -->
     <dependency>
-      <groupId>com.github.dcarter.gdata-java-client</groupId>
+      <groupId>com.google.gdata</groupId>
       <artifactId>gdata-calendar-2.0</artifactId>
-      <version>1.41.1-SNAPSHOT</version>
+      <version>1.41.1</version>
     </dependency>
   </dependencies>
 </project>

Then patch script:

#! /bin/bash

# Installation directory
install_dir=home/dz/codebase

# patch classpaths and scripts
patch $install_dir/dz3-shell/dz-runner < dz-runner.patch
patch $install_dir/dz3-shell/dz-jconsole < dz-jconsole.patch
patch $install_dir/dz3-shell/classpath-dev < classpath-dev.patch

Then dz-runner.patch

--- codebase/dz3-shell/dz-runner_bak 2013-10-12 22:20:12.896440416 +1300
+++ /home/max/code3/dz3-shell/dz-runner 2013-10-06 18:18:24.467732505 +1300
@@ -4,17 +4,17 @@
 
 # Following line should be uncommented if you want to run the distribution code
 
-. ${BASENAME}/classpath
+#. ${BASENAME}/classpath
 
 # Following line should be uncommented if you want to run the code produced locally on your box
 # by Maven build
 
-#. ${BASENAME}/classpath-dev
+. ${BASENAME}/classpath-dev
 
 # Comment out the next line if DZ blows out of memory for you - and don't forget to file a bug report.
 
-MEM_LIMITS="-Xms4m -Xmx4m"
+MEM_LIMITS="-Xms20m -Xmx20m"
 
 # Uncomment the next line if you experience random freezes.
 # Please see http://code.google.com/p/diy-zoning/issues/detail?id=6 for more details and instructions.

Then dz-jconsole.patch

--- codebase/dz3-shell/dz-jconsole 2013-10-12 22:15:29.935833349 +1300
+++ /home/max/code3/dz3-shell/dz-jconsole 2013-10-12 14:35:20.462816547 +1300
@@ -4,12 +4,12 @@
 
 # Following line should be uncommented if you want to run the distribution code
 
-. ${BASENAME}/classpath
+#. ${BASENAME}/classpath
 
 # Following line should be uncommented if you want to run the code produced locally on your box
 # by Maven build
 
-#. ${BASENAME}/classpath-dev
+. ${BASENAME}/classpath-dev
 
 # Remember that arguments on the command line are relative to the root of CLASSPATH


Then classpath-dev.patch

--- codebase/dz3-shell/classpath-dev_bak 2013-10-12 22:20:31.511150907 +1300
+++ /home/max/code3/dz3-shell/classpath-dev 2013-10-06 18:40:07.992702137 +1300
@@ -4,7 +4,7 @@
 # Don't forget to adjust version numbers if necessary.
 
 # This might need '-SNAPSHOT' added to it if you're using the up-to-date SVN code
-DZ_VERSION=3.6.5
+DZ_VERSION=3.6.6-SNAPSHOT
 
 JUKEBOX_VERSION=6.1.2
 SERVOMASTER_VERSION=0.8.2.4
@@ -16,17 +16,27 @@
 COMMONS_HTTPCLIENT=${LIBDIR}/commons-httpclient/commons-httpclient/3.1/commons-httpclient-3.1.jar
 LOG4J=${LIBDIR}/log4j/log4j/1.2.16/log4j-1.2.16.jar
 SPRING=${LIBDIR}/org/springframework/spring/2.5.6/spring-2.5.6.jar
-GOOGLE_COLLECT=./lib/google-collect-1.0-rc1.jar
-GDATA_CORE=./lib/gdata-core-1.0.jar
-GDATA_CLIENT=./lib/gdata-client-1.0.jar
-GDATA_CALENDAR=./lib/gdata-calendar-2.0.jar
+
+GOOGLE_COLLECT=${LIBDIR}/com/google/collections/google-collections/1.0-rc1/google-collections-1.0-rc1.jar
+GDATA_CORE=${LIBDIR}/com/google/gdata/gdata-core-1.0/1.41.1/gdata-core-1.0-1.41.1.jar
+GDATA_CLIENT=${LIBDIR}/com/google/gdata/gdata-client-1.0/1.41.1/gdata-client-1.0-1.41.1.jar
+GDATA_CALENDAR=${LIBDIR}/com/google/gdata/gdata-calendar-2.0/1.41.1/gdata-calendar-2.0-1.41.1.jar
+
+# GOOGLE_COLLECT=./lib/google-collect-1.0-rc1.jar
+# GDATA_CORE=./lib/gdata-core-1.0.jar
+# GDATA_CLIENT=./lib/gdata-client-1.0.jar
+# GDATA_CALENDAR=./lib/gdata-calendar-2.0.jar
+
 GSON=${LIBDIR}/com/google/code/gson/gson/1.7.1/gson-1.7.1.jar
-XBEE_API=./lib/xbee-api-0.5.5.jar
+
+# XBEE_API=./lib/xbee-api-0.5.5.jar
 
 DZ=${LIBDIR}/net/sf/dz3
 JUKEBOX=${LIBDIR}/net/sf/jukebox
 SERVOMASTER=${LIBDIR}/net/sf/servomaster
 
+# ${DZ}/dz3-xbee/${DZ_VERSION}/dz3-xbee-${DZ_VERSION}.jar:\
+
 export CLASSPATH="./conf:\
 ${DZ}/dz3-model/${DZ_VERSION}/dz3-model-${DZ_VERSION}.jar:\
 ${DZ}/dz3-common/${DZ_VERSION}/dz3-common-${DZ_VERSION}.jar:\
@@ -39,7 +49,6 @@
 ${DZ}/dz3-owapi/${DZ_VERSION}/dz3-owapi-${DZ_VERSION}.jar:\
 ${DZ}/dz3-servomaster/${DZ_VERSION}/dz3-servomaster-${DZ_VERSION}.jar:\
 ${DZ}/dz3-swing/${DZ_VERSION}/dz3-swing-${DZ_VERSION}.jar:\
-${DZ}/dz3-xbee/${DZ_VERSION}/dz3-xbee-${DZ_VERSION}.jar:\
 /usr/share/java/RXTXcomm.jar:\
 /usr/share/java/jsr80.jar:\
 /usr/share/java/jsr80_linux.jar:\
@@ -61,7 +70,7 @@
 ${GDATA_CLIENT}:\
 ${GDATA_CORE}:\
 ${GDATA_CALENDAR}:\
-${GSON}:\
-${XBEE_API}"
+${GSON}"
+# ${XBEE_API}"
 
 echo $CLASSPATH | tr ":" "\n"

This has built a working system on my arm board (when an appropriate config is used)

Hope that helps somebody. I'll head over to the wiki ( https://code.google.com/p/diy-zoning/w/list ) in the next period of time for some more comprehensive instructions 

Marcus

marcus wells

unread,
Oct 13, 2013, 12:50:12 AM10/13/13
to home-clima...@googlegroups.com, Maximilian Scheel
As Max pointed out the patches should use relative paths (oops)
 
Then dz-runner.patch

--- codebase/dz3-shell/dz-runner_bak 2013-10-12 22:20:12.896440416 +1300
+++ codebase/dz3-shell/dz-runner 2013-10-06 18:18:24.467732505 +1300
@@ -4,17 +4,17 @@
 
 # Following line should be uncommented if you want to run the distribution code
 
-. ${BASENAME}/classpath
+#. ${BASENAME}/classpath
 
 # Following line should be uncommented if you want to run the code produced locally on your box
 # by Maven build
 
-#. ${BASENAME}/classpath-dev
+. ${BASENAME}/classpath-dev
 
 # Comment out the next line if DZ blows out of memory for you - and don't forget to file a bug report.
 
-MEM_LIMITS="-Xms4m -Xmx4m"
+MEM_LIMITS="-Xms20m -Xmx20m"
 
 # Uncomment the next line if you experience random freezes.
 # Please see http://code.google.com/p/diy-zoning/issues/detail?id=6 for more details and instructions.

Then dz-jconsole.patch

--- codebase/dz3-shell/dz-jconsole 2013-10-12 22:15:29.935833349 +1300
+++ codebase/dz3-shell/dz-jconsole 2013-10-12 14:35:20.462816547 +1300
@@ -4,12 +4,12 @@
 
 # Following line should be uncommented if you want to run the distribution code
 
-. ${BASENAME}/classpath
+#. ${BASENAME}/classpath
 
 # Following line should be uncommented if you want to run the code produced locally on your box
 # by Maven build
 
-#. ${BASENAME}/classpath-dev
+. ${BASENAME}/classpath-dev
 
 # Remember that arguments on the command line are relative to the root of CLASSPATH


Then classpath-dev.patch

--- codebase/dz3-shell/classpath-dev_bak 2013-10-12 22:20:31.511150907 +1300
+++ codebase/dz3-shell/classpath-dev 2013-10-06 18:40:07.992702137 +1300
Reply all
Reply to author
Forward
0 new messages