• Post Reply Bookmark Topic Watch Topic
  • New Topic

how to generate org/hawkular/commons/cassandra-driver-wf-module/0.2.5.Final/ jar with maven  RSS feed

 
Joseph Hwang
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am a newbie to maven.
I try to build cassandra-driver-wf-module.0.2.5.Final.jar with maven. I set configuration with apache-maven-3.3.9 folder in windows 10 and folder path.
I downloaded 2 files from http://central.maven.org/maven2/org/hawkular/commons/cassandra-driver-wf-module/0.2.5.Final/ ,
cassandra-driver-wf-module-0.2.5.Final-module.zip and cassandra-driver-wf-module-0.2.5.Final.xml.
However I don't know how to generate cassandra-driver-wf-module.0.2.5.Final.jar with maven command.
Kindly inform me how to build jar file with maven command.
Best regards.
 
Campbell Ritchie
Sheriff
Posts: 54516
150
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Too difficult a question for this forum. Let's try the forum where we usually discuss Maven.
 
Knute Snortum
Sheriff
Posts: 3724
90
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you post your pom.xml file?
 
Joseph Hwang
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I downloaded cassandra-driver-wf-module-0.2.5.Final.xml file and change the file name to pom.xml
The content is below



I hope this is helpful
 
Knute Snortum
Sheriff
Posts: 3724
90
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What happens when you change this line:

...to this?
 
Joseph Hwang
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for your reply. As you said I change pom to jar in packaging element. And execute 'mvn compile' and 'mvn package'. But it throws following error.

WARNING] JAR will be empty - no content was marked for inclusion!
[INFO] Building jar: C:\temp\target\cassandra-driver-wf-module-0.2.5.Final.jar
[INFO]
[INFO] --- maven-assembly-plugin:2.5.4:single (module) @ cassandra-driver-wf-mod
ule ---
[INFO] Reading assembly descriptor: assembly.xml
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.736 s
[INFO] Finished at: 2016-09-09T12:43:47+09:00
[INFO] Final Memory: 14M/35M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-assembly-plugin:2.
5.4:single (module) on project cassandra-driver-wf-module: Error reading assembl
ies: Error locating assembly descriptor: assembly.xml
[ERROR]
[ERROR] [1] [INFO] Searching for file location: C:\temp\assembly.xml
[ERROR]
[ERROR] [2] [INFO] File: C:\temp\assembly.xml does not exist.
[ERROR]
[ERROR] [3] [INFO] File: C:\temp\assembly.xml does not exist.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
[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 rea
d the following articles:
[ERROR] [Help 1]

Any advise will be deeply appreciated.
 
Knute Snortum
Sheriff
Posts: 3724
90
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Let's step back.  Are you trying to create a jar specifically with Maven, or are you just trying to get the cassandra-driver-wf-module jar file?  Because the link you provided has the jar file already made in it.  And if you are trying to create the jar file "with Maven", then you would need the source files.
 
Joseph Hwang
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First sorry for my poor knowledge.
I just need cassandra-driver-wf-module jar file which is like a kind of jdbc file, like mysql-connector-java-5.1.38-bin.jar of mysql or ojdbc7.jar file of oracle 12c.
I try to add the generated cassandra-driver-wf-module jar file to widfly modules with module.xml.
Any comments will be appreciated. Thanks in advance.
 
Joseph Hwang
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Joseph Hwang wrote:First sorry for my poor knowledge.
I just need cassandra-driver-wf-module jar file which is like a kind of jdbc file, like mysql-connector-java-5.1.38-bin.jar of mysql or ojdbc7.jar file of oracle 12c.
I try to add the generated cassandra-driver-wf-module jar file to widfly modules with module.xml. cassandra-driver-core-2.2.0-rc2.jar file throws exception when deployed in wildfly.
Any comments will be appreciated. Thanks in advance.
 
Knute Snortum
Sheriff
Posts: 3724
90
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When I open the zip file, I get:

You just need to unzip (extract) the zip file and put cassandra-driver-core-2.2.0-rc2.jar in your library or somewhere in the classpath. 

 
Joseph Hwang
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First, I made repository folder in maven_home with setting.xml.



And I unzip and move cassandra-driver-core-2.2.0-rc2.jar in a specific folder - C:\test\com\datastax\cassandra\main
Then I execute the following mvn command

> mvn install:install-file -Dfile=C:\test\com\datastax\cassandra\main\cassandra-driver-core-2.2.0-rc2.jar -DgroupId=org.hawkular.commons -DartifactId=cassandra-driver-wf-module -Dversion=0.2.5.Final -Dpackaging=jar

Build is successful. I copy the pom.xml to c:\test and modifled the pom.xml like below



Build is successful but jar file is empty. Build message is shown,



I need your advice desperately. Thanks
 
Knute Snortum
Sheriff
Posts: 3724
90
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Joseph Hwang wrote:First, I made repository folder in maven_home with setting.xml.


Ok

And I unzip and move cassandra-driver-core-2.2.0-rc2.jar in a specific folder - C:\test\com\datastax\cassandra\main

Ok

Then I execute the following mvn command

> mvn install:install-file -Dfile=C:\test\com\datastax\cassandra\main\cassandra-driver-core-2.2.0-rc2.jar -DgroupId=org.hawkular.commons -DartifactId=cassandra-driver-wf-module -Dversion=0.2.5.Final -Dpackaging=jar

Build is successful.

Ok.  You should be done.  (There's an easier way, but...)

I copy the pom.xml to c:\test and modifled the pom.xml like below


Why are you taking this step? 

And I need to ask the bigger question: in what project are you using the cassandra driver?  Or what is it you're trying to accomplish?  Do you have a Java project you want to use the jar file in?  If so, can I see that pom.xml?
 
Joseph Hwang
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am evaluating the Hawkular project of jboss monitoring system with wildfly 10.0.
As you know Hawkular monitoring system uses cassandra nosql db.
So I install and execute cassandra db first and configure the hawkular component into wildfly.(If you want to know the process, I will explain)
After configuration, I run hawkular agent contained wildfly 10.0. But wildfly throws the following exception.



To run hawkular agent contained wildfly, I have to embed org.kawkular.common.cassandra-driver. in wildfly modules.
After googling I found the ref-site http://central.maven.org/maven2/org/hawkular/commons/cassandra-driver-wf-module/0.2.5.Final/
Until now I downloaded the already-built jars and wars and install them. So i have poor knowledge of maven and even more not have enough time to learn maven.
If I am going to wrong direction, please don't hesitate correct my question.
Below is the pom.xml you asked.

 
Knute Snortum
Sheriff
Posts: 3724
90
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I now don't think this is a Maven problem, I think it is a JBoss/Wildfly problem, so I changed the primary forum.  I don't know JBoss/WildFly so I may not be able to contribute much.

Until now I downloaded the already-built jars and wars and install them.

Why don't you do that now?  cassandra-driver-wf-module-0.2.5.Final-module.zip contains the jar file cassandra-driver-core-2.2.0-rc2.jar.  Why are you using Maven?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!