Solved

adding a .class file to the Maven build

Posted on 2011-03-11
4
366 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

635 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