0

I used for building and creating a jar file this command as l know

$ mvn -Pzinc package

and that also

$ mvn -f m2-pom.xml package

and it built successfully !

but i can't find a jar file ?

user2720864
  • 7,574
  • 4
  • 42
  • 57
  • Reading about maven a bit may help: http://maven.apache.org/guides/getting-started/ – Alexey Romanov Jan 13 '14 at 09:03
  • Where is the Storm part in your question? – Chiron Jan 13 '14 at 12:43
  • i downloaded storm-starter from github then wanted to mvn it but the result of maven got 2 files snapshot like SNAPSHOT-jar-with- dependencies.jar and this SNAPSHOT.jar and i don't know what's snapshot and i thought that jar file should be storm-starter.jar –  Jan 13 '14 at 13:33
  • You need to read the Maven guide @AlexeyRomanov mentioned. – Moritz Petersen Jan 13 '14 at 13:36
  • i read it now .but i can't understand why it couldn't create file.jar and created snapshot ? i can't got it! or is maven created file snapshot.jar only ? –  Jan 13 '14 at 13:46
  • Because that's what instructions in the m2-pom.xml file told Maven to do. – Alexey Romanov Jan 13 '14 at 13:54
  • Thanks . so you mean that i should edit in pom.xml to create file.jar and not snapshot ! but do you know how can i do that ? –  Jan 13 '14 at 23:56

1 Answers1

3

In your project's target directory you'll able to see the generated jar file.

Moritz Petersen
  • 11,897
  • 2
  • 35
  • 42
  • Thanks very much ! i found it. but it have two file SNAPSHOT-jar-with- dependencies and this SNAPSHOT do you know what's the difference between them ? –  Jan 13 '14 at 07:45
  • You could have a look yourself with `jar tf `... Hint: one JAR file contains the dependencies, the other doesn't. – Moritz Petersen Jan 13 '14 at 08:06
  • Thanks for helping . is the file must be ZIP File ? and why mvn didn't create file.jar i mean why it created file_snapshot.jar and file_snapshot-with dependencies.jar? –  Jan 13 '14 at 13:34
  • Ah... yes. A [JAR file is a ZIP file](http://en.wikipedia.org/wiki/JAR_%28file_format%29). – Moritz Petersen Jan 13 '14 at 13:35
  • i accepted your answer as i must have 15 reputation to vote up –  Jan 14 '14 at 09:48