0

I want to use maven to compile single file from project, but it must be done from command prompt and i can't find proper option. All i can find is messing with pom files, but its not a solution in my case. Can anyone give me a hand with it?

Thomas
  • 43,637
  • 12
  • 109
  • 140
Loki
  • 615
  • 9
  • 12
  • Why do you need to compile just one especific file in a project? Is it some need of just update this file? – Jorge Campos Dec 16 '13 at 10:29
  • 1
    Do you know what Maven is? I don't think that you can compile a file using maven. You can define dependencies etc. with maven but for compiling you need to use an actual compiler (such as the java compiler)... – mvieghofer Dec 16 '13 at 10:29
  • It's for project at university, leading proffesor told me it is possible and i should do that, but of course i must find on my own how to do so. And as i have little experience in java its quite a trouble for me. @mvieghofer Well i actually compiled whole project to jar file with maven, but its not what i need – Loki Dec 16 '13 at 11:03
  • @payeli i saw that one. unfortunately the best answer is about pom file. i want to do that by command prompt only – Loki Dec 16 '13 at 11:49
  • Please check my previous comment for duplication, you may find the the original question's answer, however, you should be aware that includes and excludes are now deprecated from Maven, so we can't compile single files in latest versions – Infinite Recursion Dec 16 '13 at 11:49
  • 1
    @Loki: Ok, then it's not possible, someone had asked about command prompt [here](http://stackoverflow.com/questions/1969150/how-to-compile-a-single-file-with-maven) – Infinite Recursion Dec 16 '13 at 11:51
  • Oh that one i didn't see. Thanks. So now i must talk to proffesor and convince him that it will not work ;/ – Loki Dec 16 '13 at 11:59
  • @Loki the pom.xml is your configuration of the maven project, you define the dependencies, plugins, etc. there. You can also define a maven-compiler-plugin there which is then used to compile your project. You can configure this plugin as you need it to compile your project. In your case the `Compiling only selected files in Maven` link of payeli would be what you need... Though, maven is a dependency management tool for your projects and is not a compiler! you can define a compiler plugin that is used to compile your projects. – mvieghofer Dec 16 '13 at 12:06
  • @mvieghofer point is that im not compiling my own project, and thats on of the reasons why i cant use pom files. anyways i completly forget that i can just extract needed class file from jar file – Loki Dec 17 '13 at 01:37

0 Answers0