• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Unable to compile the build.xml in Ant

 
Ranch Hand
Posts: 151
1
Eclipse IDE MySQL Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Following is the build file



Error: Unable to resolve artefact: Missing:

1) hsqldb:hsqldb:jar:2.3.2

How do I create a build.xml file if I wish to use MySQL instead of HSQLDB?

Please help!! Thanks!!
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have you tried anything yet? I see a number of references to the database - the dependency and the driver jump out immediately. Also, do you have the mysql jar? That will need to be available to Ant and when you run the program.
 
Abhimanyu Jain
Ranch Hand
Posts: 151
1
Eclipse IDE MySQL Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, I have the MySQL jar file. I am trying to learn hibernate but I am not able to run the build.xml file properly.
 
Jeanne Boyarsky
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Great. The three lines you need to change are:

<dependency groupId="hsqldb" artifactId="hsqldb" version="2.3.2"/>

<arg value="org.hsqldb.jdbcDriver"/>

<arg value="jdbc:hsqldb:${data.dir}/music"/>

What do you think you need to change them to? What error did you get when you tried that?
 
Abhimanyu Jain
Ranch Hand
Posts: 151
1
Eclipse IDE MySQL Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks. I need to change them to relevant version and driver, I guess.

About the error I need to run it first after the changes.

When you talked about MySQL jar file, I believe you were talking about the connector jar file, am I correct?
 
Jeanne Boyarsky
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Abhimanyu Jain wrote:When you talked about MySQL jar file, I believe you were talking about the connector jar file, am I correct?


Correct
 
Abhimanyu Jain
Ranch Hand
Posts: 151
1
Eclipse IDE MySQL Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


I changed the HSQLDB to MYSQL. Still I am getting the same error as follows:

BUILD FAILED
D:\build.xml:11: Unable to resolve artifact: Missing:
----------
1) mysql:mysql:jar:5.1.35

Try downloading the file manually from the project website.

Then, install it using the command:
mvn install:install-file -DgroupId=mysql -DartifactId=mysql -Dversion=5.1.
35 -Dpackaging=jar -Dfile=/path/to/file

Alternatively, if you host your own repository you can deploy the file there:

mvn deploy:deploy-file -DgroupId=mysql -DartifactId=mysql -Dversion=5.1.35
-Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]

Path to dependency:
1) org.apache.maven:super-pom:jar:2.0
2) mysql:mysql:jar:5.1.35

----------
1 required artifact is missing.

for artifact:
org.apache.maven:super-pom:jar:2.0

from the specified remote repositories:
central (http://repo1.maven.org/maven2)


Total time: 2 seconds
 
Rancher
Posts: 2759
32
Eclipse IDE Spring Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What are you trying to do? DOwnload MYSQL JDBC driver? Or download MYSQL server :p. If you want the JDBC driver, you should use



For HSQLDB, you should use



When you are using the maven repository, it's a good idea to search http://mvnrepository.com/ for what you need. It will tell you the exact dependency tag that you need to put in your build file. This way, you aren't guessing

 
Abhimanyu Jain
Ranch Hand
Posts: 151
1
Eclipse IDE MySQL Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


Following is the error now that I am getting after changing it to MySQL. Kindly help!!

D:\>ant db
Buildfile: D:\build.xml

db:
[java] Error: Could not find or load main class org.hsqldb.util.DatabaseManager
[java] Java Result: 1

BUILD SUCCESSFUL
Total time: 1 second
 
Jayesh A Lalwani
Rancher
Posts: 2759
32
Eclipse IDE Spring Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, if you are using mysql, how can you load a HSQLDB class? If you want to use HSQLDB, add a dependency to HSQLDB.
 
Abhimanyu Jain
Ranch Hand
Posts: 151
1
Eclipse IDE MySQL Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Which class should I use then for MySQL? Could you please let me know?
 
Jayesh A Lalwani
Rancher
Posts: 2759
32
Eclipse IDE Spring Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What are you trying to do here? Why are you using MYSQL? AFAIK, MySQL doesn't have a database management UI. You started with HSQL. You might want to make sure it's working with HSql first before you start messing around with MySQL.
 
Abhimanyu Jain
Ranch Hand
Posts: 151
1
Eclipse IDE MySQL Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am willing to learn hibernate using MySQL. But I am not able to create a build.xml file for ANT. The example in the book uses HSQLDB.
 
Abhimanyu Jain
Ranch Hand
Posts: 151
1
Eclipse IDE MySQL Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


BUILD FAILED
D:\build.xml:11: Unable to resolve artifact: Missing:
----------
1) hsqldb:hsqldb:jar:2.3.2

Try downloading the file manually from the project website.

Then, install it using the command:
mvn install:install-file -DgroupId=hsqldb -DartifactId=hsqldb -Dversion=2.
3.2 -Dpackaging=jar -Dfile=/path/to/file

Alternatively, if you host your own repository you can deploy the file there:

mvn deploy:deploy-file -DgroupId=hsqldb -DartifactId=hsqldb -Dversion=2.3.
2 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]

Path to dependency:
1) org.apache.maven:super-pom:jar:2.0
2) hsqldb:hsqldb:jar:2.3.2

----------
1 required artifact is missing.

for artifact:
org.apache.maven:super-pom:jar:2.0

from the specified remote repositories:
central (http://repo1.maven.org/maven2)


Total time: 2 seconds

Above is the error that I get when I try to create a build file using HSQLDB.
 
Jayesh A Lalwani
Rancher
Posts: 2759
32
Eclipse IDE Spring Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Jayesh A Lalwani wrote:
For HSQLDB, you should use


 
Abhimanyu Jain
Ranch Hand
Posts: 151
1
Eclipse IDE MySQL Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Now the error is as follows:

dependency does not support the "org", "name" and "rev" attributes.
 
Abhimanyu Jain
Ranch Hand
Posts: 151
1
Eclipse IDE MySQL Database Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Following is the "build.xml" file, I was looking for:



It worked now.
reply
    Bookmark Topic Watch Topic
  • New Topic