Solved

adding a .class file to the Maven build

Posted on 2011-03-11
4
365 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

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

Suggested Solutions

Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
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…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
Suggested Courses

739 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