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
Solved

adding a .class file to the Maven build

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

The New “Normal” in Modern Enterprise Operations

DevOps for the modern enterprise offers many benefits — increased agility, productivity, and more, but digital transformation isn’t easy, especially if you’re not addressing the right issues. Register for the webinar to dive into the “new normal” for enterprise modern ops.

Question has a verified solution.

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

Suggested Solutions

I had a project requirement for a displaying a user workbench .This workbench would consist multiple data grids .In each grid the user will be able to see a large number of data. These data grids should allow the user to 1. Sort 2. Export the …
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
The viewer will learn how to implement Singleton Design Pattern in Java.

860 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