Solved

adding a .class file to the Maven build

Posted on 2011-03-11
4
358 Views
Last Modified: 2012-05-11
Hello!

I have a maven project where most of the files are java files and I have no problem adding those to the build. I also have a .class file (and don't have the java source), which I need to include in the "classes" directory, How can I do this?

Thanks,
Ron
0
Comment
Question by:ronyosi
  • 2
  • 2
4 Comments
 
LVL 13

Accepted Solution

by:
George K. earned 500 total points
ID: 35109232
1. Bundle in a jar
2. Version it
3. deploy to repository.
0
 

Author Comment

by:ronyosi
ID: 35109427
Hi, thanks for help :)

I have already tried this using jar cf filename1 filename2, It does not work. It also seems that it does not create the folders for the packaging as I need. Could you provide instructions?
The only file that I have is in the package com/folder1/folder2/theClassFile.class

Thanks,
Ron
0
 

Author Closing Comment

by:ronyosi
ID: 35109730
Hi! Thank you for the advice. Turns out that saying
jar cf file.jar file.java
you can aslo say
jar cf file.jar filedirectory

Which is what I needed. Just one final question what do you mean by versioning it?

Thanks!
ron
0
 
LVL 13

Expert Comment

by:George K.
ID: 35112037
With Maven projects including a lot of  modules with dependencies versioning is important.
Maven release-plugin helps you keep updated versions - which is also part of the release processing.

This  plugin is very useful although not widely known.
Check this here : http://mojo.codehaus.org/versions-maven-plugin/
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
backtracking recursion  code 19 54
C# SQL BULK INSERT CLASS 5 46
Post xml via PHP Soap Client 3 38
tomcat not starting 6 31
Browsing the questions asked to the Experts of this forum, you will be amazed to see how many times people are headaching about monster regular expressions (regex) to select that specific part of some HTML or XML file they want to extract. The examp…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now