Skip to content
This repository has been archived by the owner on Dec 18, 2022. It is now read-only.

[taskdef] Could not load definitions from resource com/rimerosolutions/ant/git/jgit-ant-lib.xml. It could not be found. #32

Open
kobelobster opened this issue May 1, 2017 · 4 comments

Comments

@kobelobster
Copy link

kobelobster commented May 1, 2017

I don't know if this issue tracker is still active, but I'm getting the error from the title. This is my config

<project name="Test" default="init" basedir="."
	xmlns:ivy="antlib:org.apache.ivy.ant"
	xmlns:git="antlib:com.rimerosolutions.ant.git">

	<target name="init">
		<ivy:cachepath pathid="ant.git.tasks.classpath" conf="compile"/>
		<taskdef uri="antlib:com.rimerosolutions.ant.git"
        resource="com/rimerosolutions/ant/git/jgit-ant-lib.xml">
        	<classpath>
        		<path refid="ant.git.tasks.classpath"/>
        	</classpath>
	    </taskdef>

		<!-- Install repositories -->
		<git:git directory=".">
 			<git:clone uri="someuri"/>
		</git:git>
	</target>
</project>
<ivy-module version="2.0">
	<info organisation="Test GmbH" module="Test"/>
	<configurations>
		<conf name="compile"/>		
	</configurations>
	<dependencies>
		<dependency org="org.eclipse.jgit"
			name="org.eclipse.jgit.ant" 
            rev="4.7.0.201704051617-r" conf="compile"/>
		<dependency org="org.eclipse.jgit" 
            name="org.eclipse.jgit" 
            rev="4.7.0.201704051617-r" conf="compile"/>
		<dependency org="com.jcraft" 
            name="jsch" 
            rev="0.1.54" conf="compile"/>
		<dependency org="com.rimerosolutions.ant" 
            name="ant-git-tasks"
            rev="1.3.2" 
            changing="true" conf="compile"/>
	</dependencies>
</ivy-module>
<ivysettings>
	<settings defaultResolver="central"/>
	<resolvers>
		<url name="sonatype-snapshots" m2compatible="true">
			<artifact pattern="https://oss.sonatype.org/content/repositories/snapshots/[organisation]/[module]/[revision]/[artifact]-[revision](-[classifier]).[ext]"/>
		</url>
		<ibiblio name="central" m2compatible="true"/>
	</resolvers>
</ivysettings>

And this is the error output

Buildfile: /home/tzfrs/dev/Test/TestAnt/build.xml

init:
[ivy:cachepath] :: Apache Ivy 2.4.0 - 20141213170938 :: http://ant.apache.org/ivy/ ::
[ivy:cachepath] :: loading settings :: file = /home/tzfrs/dev/Test/TestAnt/ivysettings.xml
[ivy:cachepath] :: resolving dependencies :: Test GmbH#Test;working@tzfrs-home
[ivy:cachepath] 	confs: [compile]
[ivy:cachepath] 	found org.eclipse.jgit#org.eclipse.jgit.ant;4.7.0.201704051617-r in central
[ivy:cachepath] 	found org.eclipse.jgit#org.eclipse.jgit;4.7.0.201704051617-r in central
[ivy:cachepath] 	found com.jcraft#jsch;0.1.54 in central
[ivy:cachepath] 	found com.googlecode.javaewah#JavaEWAH;1.1.6 in central
[ivy:cachepath] 	found org.apache.httpcomponents#httpclient;4.3.6 in central
[ivy:cachepath] 	found org.apache.httpcomponents#httpcore;4.3.3 in central
[ivy:cachepath] 	found commons-logging#commons-logging;1.1.3 in central
[ivy:cachepath] 	found commons-codec#commons-codec;1.6 in central
[ivy:cachepath] 	found org.slf4j#slf4j-api;1.7.2 in central
[ivy:cachepath] 	found org.apache.ant#ant;1.9.6 in central
[ivy:cachepath] 	found org.apache.ant#ant-launcher;1.9.6 in central
[ivy:cachepath] 	found com.rimerosolutions.ant#ant-git-tasks;1.3.2 in central
[ivy:cachepath] downloading https://repo1.maven.org/maven2/org/eclipse/jgit/org.eclipse.jgit.ant/4.7.0.201704051617-r/org.eclipse.jgit.ant-4.7.0.201704051617-r.jar ...
[ivy:cachepath] ......... (18kB)
[ivy:cachepath] .. (0kB)
[ivy:cachepath] 	[SUCCESSFUL ] org.eclipse.jgit#org.eclipse.jgit.ant;4.7.0.201704051617-r!org.eclipse.jgit.ant.jar (58ms)
[ivy:cachepath] downloading https://repo1.maven.org/maven2/org/eclipse/jgit/org.eclipse.jgit/4.7.0.201704051617-r/org.eclipse.jgit-4.7.0.201704051617-r.jar ...
[ivy:cachepath] .................................................................................................................................................................. (2397kB)
[ivy:cachepath] .. (0kB)
[ivy:cachepath] 	[SUCCESSFUL ] org.eclipse.jgit#org.eclipse.jgit;4.7.0.201704051617-r!org.eclipse.jgit.jar (298ms)
[ivy:cachepath] downloading https://repo1.maven.org/maven2/com/jcraft/jsch/0.1.54/jsch-0.1.54.jar ...
[ivy:cachepath] ............................. (273kB)
[ivy:cachepath] .. (0kB)
[ivy:cachepath] 	[SUCCESSFUL ] com.jcraft#jsch;0.1.54!jsch.jar (71ms)
[ivy:cachepath] downloading https://repo1.maven.org/maven2/org/apache/ant/ant/1.9.6/ant-1.9.6.jar ...
[ivy:cachepath] ........................................................................................................................................ (1982kB)
[ivy:cachepath] .. (0kB)
[ivy:cachepath] 	[SUCCESSFUL ] org.apache.ant#ant;1.9.6!ant.jar (208ms)
[ivy:cachepath] downloading https://repo1.maven.org/maven2/com/googlecode/javaewah/JavaEWAH/1.1.6/JavaEWAH-1.1.6.jar ...
[ivy:cachepath] ...................... (161kB)
[ivy:cachepath] .. (0kB)
[ivy:cachepath] 	[SUCCESSFUL ] com.googlecode.javaewah#JavaEWAH;1.1.6!JavaEWAH.jar(bundle) (68ms)
[ivy:cachepath] downloading https://repo1.maven.org/maven2/org/apache/httpcomponents/httpclient/4.3.6/httpclient-4.3.6.jar ...
[ivy:cachepath] ................................................ (578kB)
[ivy:cachepath] .. (0kB)
[ivy:cachepath] 	[SUCCESSFUL ] org.apache.httpcomponents#httpclient;4.3.6!httpclient.jar (96ms)
[ivy:cachepath] downloading https://repo1.maven.org/maven2/org/slf4j/slf4j-api/1.7.2/slf4j-api-1.7.2.jar ...
[ivy:cachepath] ............... (25kB)
[ivy:cachepath] .. (0kB)
[ivy:cachepath] 	[SUCCESSFUL ] org.slf4j#slf4j-api;1.7.2!slf4j-api.jar (59ms)
[ivy:cachepath] downloading https://repo1.maven.org/maven2/org/apache/httpcomponents/httpcore/4.3.3/httpcore-4.3.3.jar ...
[ivy:cachepath] ............................. (276kB)
[ivy:cachepath] .. (0kB)
[ivy:cachepath] 	[SUCCESSFUL ] org.apache.httpcomponents#httpcore;4.3.3!httpcore.jar (69ms)
[ivy:cachepath] downloading https://repo1.maven.org/maven2/commons-logging/commons-logging/1.1.3/commons-logging-1.1.3.jar ...
[ivy:cachepath] ............... (60kB)
[ivy:cachepath] .. (0kB)
[ivy:cachepath] 	[SUCCESSFUL ] commons-logging#commons-logging;1.1.3!commons-logging.jar (82ms)
[ivy:cachepath] downloading https://repo1.maven.org/maven2/commons-codec/commons-codec/1.6/commons-codec-1.6.jar ...
[ivy:cachepath] .......................... (227kB)
[ivy:cachepath] .. (0kB)
[ivy:cachepath] 	[SUCCESSFUL ] commons-codec#commons-codec;1.6!commons-codec.jar (80ms)
[ivy:cachepath] downloading https://repo1.maven.org/maven2/org/apache/ant/ant-launcher/1.9.6/ant-launcher-1.9.6.jar ...
[ivy:cachepath] ........ (17kB)
[ivy:cachepath] .. (0kB)
[ivy:cachepath] 	[SUCCESSFUL ] org.apache.ant#ant-launcher;1.9.6!ant-launcher.jar (67ms)
[ivy:cachepath] :: resolution report :: resolve 2941ms :: artifacts dl 1170ms
[ivy:cachepath] 	:: evicted modules:
[ivy:cachepath] 	org.eclipse.jgit#org.eclipse.jgit.ant;3.0.0.201306101825-r by [org.eclipse.jgit#org.eclipse.jgit.ant;4.7.0.201704051617-r] in [compile]
[ivy:cachepath] 	org.eclipse.jgit#org.eclipse.jgit;3.0.0.201306101825-r by [org.eclipse.jgit#org.eclipse.jgit;4.7.0.201704051617-r] in [compile]
[ivy:cachepath] 	com.jcraft#jsch;0.1.50 by [com.jcraft#jsch;0.1.54] in [compile]
	---------------------------------------------------------------------
	|                  |            modules            ||   artifacts   |
	|       conf       | number| search|dwnlded|evicted|| number|dwnlded|
	---------------------------------------------------------------------
	|      compile     |   15  |   12  |   12  |   3   ||   11  |   11  |
	---------------------------------------------------------------------
  [taskdef] Could not load definitions from resource com/rimerosolutions/ant/git/jgit-ant-lib.xml. It could not be found.

BUILD FAILED
/home/tzfrs/dev/Test/TestAnt/build.xml:15: Problem: failed to create task or type antlib:com.rimerosolutions.ant.git:git
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any <presetdef>/<macrodef> declarations have taken place.
No types or tasks have been defined in this namespace yet

This appears to be an antlib declaration. 
Action: Check that the implementing library exists in one of:
        -/usr/share/ant/lib
        -/home/tzfrs/.ant/lib
        -a directory added on the command line with the -lib argument


Total time: 4 seconds

@jwheeler31
Copy link

jwheeler31 commented Aug 14, 2017

I had this issue too. It turns out you need the git settings:

<git:settings refId="git.testing"
  username="xxxtesting"
  password="xxxtesting"
  name="xxxtesting"
  email="[email protected]"/>

as well as the settingsref applied to the opening git tag:

<git:git directory="${mydir}" settingsref="${git.testing}">
  <!-- git tasks here... -->
</git:git>

@trutia
Copy link

trutia commented Nov 28, 2017

I have this issue too. Same error
BUILD FAILED
/Users/trutia/Projects/group-shopping-services/build.xml:34: Problem: failed to create task or type antlib:com.rimerosolutions.ant.git:settings
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any / declarations have taken place.
No types or tasks have been defined in this namespace yet

This appears to be an antlib declaration.
Action: Check that the implementing library exists in one of:
-/Users/trutia/apache-ant-1.7.1/lib
-/Users/trutia/.ant/lib
-a directory added on the command line with the -lib argument

This is what my build.xml looks like

<git:settings refId="git.testing"
              username="xxxtesting"
              password="xxxtesting"
              name="xxxtesting"
              email="[email protected]"/>

Also how do I exactly use this plugin ?

@jwheeler31
Copy link

@trutia Can you post a link to your repo?

@17swifts
Copy link

@kobelobster did you come to a resolution? I am having the same problem

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants