You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Daniel Sanchez Gonzalez <ds...@at4wireless.com> on 2008/03/12 11:01:53 UTC

Ant, Eclipse & CVS problem adding a file

Hello, 
 
I'm writing an script to compile, make a jar and put it into CVS
repository. I'm using Eclipse. My source files are in an Eclipse project
(MySrcJava, for example) and jars are in another project (MyJars). Each
project is linked to a CVS directory. There is an ant file in MySrcJava
project that build a jar into MyJars folder. I want to add (and commit)
this jar into CVS repository. My problem is that ant file is in
MySrcJava and I don't know how to do it. 
 
When I run the script, this message appears: 
 
[cvs] cvs [add aborted]: there is a version in
C:\workspace\component_name/....../builds/lib/at4-dao already
 
 
This is my ant file. 
 
 
<?xml version="1.0" encoding="UTF-8"?>
<project default="inicio" name="compilar" basedir="..">
 
 [...] 
 
 <target name="borrar_clases">
  <echo message=" valor: ${basedir}"/>
  <delete dir="classes/*"/>
 </target>
 
 <target name="compilar_fuentes">
         <javac srcdir="src" destdir="classes" debug="on"
classpath="${classpath}">
         </javac>
 </target>
 
 <target name="crear_jar">
  
  <!-- create jar file in MyJars project -->
  <jar
destfile="${basedir}/../builds/lib/component_name/component_name.jar">
   <zipfileset dir="classes">
   </zipfileset>
  </jar>
  
 </target>
 
 <target name="autenticacion_cvs">
  <property name="cvs.host" value="ip"/>
  <property name="cvs.root"
value=":pserver:${user.name}@${cvs.host}:/relative/URL"/>
  <cvspass cvsroot="${cvs.root}" password="${cvs.password}"/>
 </target>
 
 <target name="commit_cvs_jar">
  
  <cvs cvsRoot="${cvs.root}"
   command="checkout"
   dest="${basedir}/.."
   package="CVS_PATH/builds/lib/${componente.nombre}" 
   quiet="false"/>
  
  <cvs cvsRoot="${cvs.root}" 
   command="add -m'my test'
${basedir}/../builds/lib/component_name/component_name.jar"
   quiet="false"/>
 </target>
 
 
</project>

 
 
Thank you in advance, 
 
Dani
 

Re: Ant, Eclipse & CVS problem adding a file

Posted by Gilbert Rebhan <an...@schillbaer.de>.
Daniel Sanchez Gonzalez wrote:
> I've read this:
> 
> "Use import to incorporate an entire source distribution from an outside source (e.g., a source vendor) into your source repository directory. You can use this command both for initial creation of a repository, and for wholesale updates to the module from the outside source."

yes that's right

> And I only want to add a file to a CVS folder. Is it possible using import? 

hm, maybe i misread your first posting, thought it would be a
source tree from the somewhat strange error message
"there is a version in C:\workspace\component_name/....../builds/lib/at4-dao
already"

said.

../at4-dao is a directory, right ?!

btw, dealing with cvs for years now, i never had seen
your error message; only something like =
"there's no version ..."

So, we need some more details =

which version of cvs do you use ? cvs || cvsnt
which platform ?

That's what i took from your posting =

You have 2 projects in one eclipse workspace, means the
reside in the same filesystem.
Both projects are under revision control by cvs, means
when looking on the filesystem, you'll see those CVS
folders everywhere.

Project1 has the sources, you need to compile.
After compilation you want to create a jar in the
filesysem of Project2 and add/commit that, right ?

Maybe the file is already added, did you try
a commit only ?

Maybe you call the cvs command from the wrong
directory, means you need an existing cvs workspace
with CVS metainfos to call the cvs commands

And remember, unlike other cvs commands, add
ain't recursive and has no -R flag, means every
directory has to be added separately, f.e.

cvs add foo
cvs add foo/bar
cvs add foo/bar/foobar.jar


Regards, Gilbert








---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


RE: Ant, Eclipse & CVS problem adding a file

Posted by Daniel Sanchez Gonzalez <ds...@at4wireless.com>.
Ok. I'm new in using ant, so maybe this is a stupid mistake. The problem
was that I was using absolute path:


<project default="inicio" name="compilar" basedir="..">

	.......

	<target name="commit_cvs_jar">
		<cvs cvsRoot="${cvs.root}" 
			command="add
${basedir}/../builds/lib/${componente.nombre}/${componente.nombre}.${eti
queta.version}.jar"
			quiet="false"/>
		
		<cvs cvsRoot="${cvs.root}" 
			command="commit -m'${etiqueta.version}'
${basedir}/../builds/lib/${componente.nombre}/${componente.nombre}.${eti
queta.version}.jar"
			quiet="false"/>
		
		<cvs cvsRoot="${cvs.root}" 
			command="add
${basedir}/../builds/lib/${componente.nombre}/${componente.nombre}.${eti
queta.version}.jar.md5"
			quiet="false"/>
		
		<cvs cvsRoot="${cvs.root}" 
			command="commit -m'${etiqueta.version}'
${basedir}/../builds/lib/${componente.nombre}/${componente.nombre}.${eti
queta.version}.jar.md5"
			quiet="false"/>
	</target>
....


And this is the solution: 


<project default="inicio" name="compilar" basedir="..">

	.......

	<target name="commit_cvs_jar">
		<cvs cvsRoot="${cvs.root}" 
			command="add
./../builds/lib/${componente.nombre}/${componente.nombre}.${etiqueta.ver
sion}.jar"
			quiet="false"/>
		
		<cvs cvsRoot="${cvs.root}" 
			command="commit -m'${etiqueta.version}'
./../builds/lib/${componente.nombre}/${componente.nombre}.${etiqueta.ver
sion}.jar"
			quiet="false"/>
		
		<cvs cvsRoot="${cvs.root}" 
			command="add
./../builds/lib/${componente.nombre}/${componente.nombre}.${etiqueta.ver
sion}.jar.md5"
			quiet="false"/>
		
		<cvs cvsRoot="${cvs.root}" 
			command="commit -m'${etiqueta.version}'
./../builds/lib/${componente.nombre}/${componente.nombre}.${etiqueta.ver
sion}.jar.md5"
			quiet="false"/>
	</target>


Thank you very much
	

-----Mensaje original-----
De: Rebhan, Gilbert [mailto:Gilbert.Rebhan@huk-coburg.de] 
Enviado el: lunes, 17 de marzo de 2008 8:12
Para: Ant Users List
CC: Daniel Sanchez Gonzalez
Asunto: RE: Ant, Eclipse & CVS problem adding a file

 

-----Original Message-----
From: Daniel Sanchez Gonzalez [mailto:dsanchez@at4wireless.com]
Sent: Monday, March 17, 2008 8:05 AM
To: Ant Users List
Subject: RE: Ant, Eclipse & CVS problem adding a file

/*
 Finally it works. Thank you very much. 
*/

Posting the solution, that fixed your problems would be nice.

1. Other may learn from
2. it helps others with the same / a similar problem, when searching the
    ant user list archive

Regards, Gilbert



-- 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


RE: Ant, Eclipse & CVS problem adding a file

Posted by "Rebhan, Gilbert" <Gi...@huk-coburg.de>.
 

-----Original Message-----
From: Daniel Sanchez Gonzalez [mailto:dsanchez@at4wireless.com] 
Sent: Monday, March 17, 2008 8:05 AM
To: Ant Users List
Subject: RE: Ant, Eclipse & CVS problem adding a file

/*
 Finally it works. Thank you very much. 
*/

Posting the solution, that fixed your problems would be nice.

1. Other may learn from
2. it helps others with the same / a similar problem, when searching the
    ant user list archive

Regards, Gilbert



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


RE: Ant, Eclipse & CVS problem adding a file

Posted by Daniel Sanchez Gonzalez <ds...@at4wireless.com>.
 Finally it works. Thank you very much. 

-----Mensaje original-----
De: Daniel Sanchez Gonzalez [mailto:dsanchez@at4wireless.com] 
Enviado el: viernes, 14 de marzo de 2008 12:00
Para: Ant Users List
Asunto: RE: Ant, Eclipse & CVS problem adding a file

I've read this:

"Use import to incorporate an entire source distribution from an outside source (e.g., a source vendor) into your source repository directory. You can use this command both for initial creation of a repository, and for wholesale updates to the module from the outside source."

And I only want to add a file to a CVS folder. Is it possible using import? 

Thanks.

 

-----Mensaje original-----
De: Rebhan, Gilbert [mailto:Gilbert.Rebhan@huk-coburg.de]
Enviado el: miƩrcoles, 12 de marzo de 2008 13:08
Para: Ant Users List
Asunto: RE: Ant, Eclipse & CVS problem adding a file

 
-----Original Message-----
From: Daniel Sanchez Gonzalez [mailto:dsanchez@at4wireless.com]
Sent: Wednesday, March 12, 2008 11:02 AM
To: user@ant.apache.org
Subject: Ant, Eclipse & CVS problem adding a file

/*
When I run the script, this message appears: 
 
[cvs] cvs [add aborted]: there is a version in C:\workspace\component_name/....../builds/lib/at4-dao already
 
 [...]

  <cvs cvsRoot="${cvs.root}" 
   command="add -m'my test'
${basedir}/../builds/lib/component_name/component_name.jar"
   quiet="false"/>
 </target>
 */

use cvs command import instead of add


Regards, Gilbert




---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional commands, e-mail: user-help@ant.apache.org


-- 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional commands, e-mail: user-help@ant.apache.org


-- 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


RE: Ant, Eclipse & CVS problem adding a file

Posted by Daniel Sanchez Gonzalez <ds...@at4wireless.com>.
I've read this:

"Use import to incorporate an entire source distribution from an outside source (e.g., a source vendor) into your source repository directory. You can use this command both for initial creation of a repository, and for wholesale updates to the module from the outside source."

And I only want to add a file to a CVS folder. Is it possible using import? 

Thanks.

 

-----Mensaje original-----
De: Rebhan, Gilbert [mailto:Gilbert.Rebhan@huk-coburg.de] 
Enviado el: miƩrcoles, 12 de marzo de 2008 13:08
Para: Ant Users List
Asunto: RE: Ant, Eclipse & CVS problem adding a file

 
-----Original Message-----
From: Daniel Sanchez Gonzalez [mailto:dsanchez@at4wireless.com]
Sent: Wednesday, March 12, 2008 11:02 AM
To: user@ant.apache.org
Subject: Ant, Eclipse & CVS problem adding a file

/*
When I run the script, this message appears: 
 
[cvs] cvs [add aborted]: there is a version in C:\workspace\component_name/....../builds/lib/at4-dao already
 
 [...]

  <cvs cvsRoot="${cvs.root}" 
   command="add -m'my test'
${basedir}/../builds/lib/component_name/component_name.jar"
   quiet="false"/>
 </target>
 */

use cvs command import instead of add


Regards, Gilbert




---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional commands, e-mail: user-help@ant.apache.org


-- 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


RE: Ant, Eclipse & CVS problem adding a file

Posted by "Rebhan, Gilbert" <Gi...@huk-coburg.de>.
 
-----Original Message-----
From: Daniel Sanchez Gonzalez [mailto:dsanchez@at4wireless.com] 
Sent: Wednesday, March 12, 2008 11:02 AM
To: user@ant.apache.org
Subject: Ant, Eclipse & CVS problem adding a file

/*
When I run the script, this message appears: 
 
[cvs] cvs [add aborted]: there is a version in
C:\workspace\component_name/....../builds/lib/at4-dao already
 
 [...]

  <cvs cvsRoot="${cvs.root}" 
   command="add -m'my test'
${basedir}/../builds/lib/component_name/component_name.jar"
   quiet="false"/>
 </target>
 */

use cvs command import instead of add


Regards, Gilbert




---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org