Solved

adding a .class file to the Maven build

Posted on 2011-03-11
4
357 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
Comment Utility
1. Bundle in a jar
2. Version it
3. deploy to repository.
0
 

Author Comment

by:ronyosi
Comment Utility
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
Comment Utility
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.
Comment Utility
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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
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…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…

762 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

14 Experts available now in Live!

Get 1:1 Help Now