User Tools

Site Tools


start:maven:totalnewbieintro

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
start:maven:totalnewbieintro [2016/08/12 15:05]
fiisch
start:maven:totalnewbieintro [2016/08/12 15:14] (current)
fiisch [Conclusion]
Line 7: Line 7:
                        -DinteractiveMode=false                        -DinteractiveMode=false
 </code> </code>
-Oh God, whyyyy!? So let'fiddle with it...+Oh God, whyyyy!? Let'find out! :-D
  
 ==== Empty project structure ==== ==== Empty project structure ====
Line 49: Line 49:
   * **-DartifactId=my-app** - Root directory of your project. There is a //pom.xml// and //src// and //test// directories. There also appears //target// directory after you compile your application.   * **-DartifactId=my-app** - Root directory of your project. There is a //pom.xml// and //src// and //test// directories. There also appears //target// directory after you compile your application.
   * **-DarchetypeArtifactId=maven-archetype-quickstart** - This option specifies which //artifact// (= base setting) of the //generate// //archetype// will Maven use.   * **-DarchetypeArtifactId=maven-archetype-quickstart** - This option specifies which //artifact// (= base setting) of the //generate// //archetype// will Maven use.
-  * **-DinteractiveMode=false** - This is to not scare off beginners, see [[https://brainfart.fiisch.cz/doku.php?id=start:maven:totalnewbieintro#interactive_mode_and_problem_of_too_many_choices|this]] section.+  * **-DinteractiveMode=false** - This is because nobody wants to scare beginners off at the beginning of the tutorial. I will write about it in [[https://brainfart.fiisch.cz/doku.php?id=start:maven:totalnewbieintro#interactive_mode_and_problem_of_too_many_choices|later section]] of this post.
  
 ==== Creating empty project by hand ==== ==== Creating empty project by hand ====
Line 100: Line 100:
 </code> </code>
  
-And that's it. We managed to setup empty project without using the archetype.+And that's it, no black magic necessary. We managed to setup empty project without using the archetype.
 <note info> Please note that this project (and also its //pom.xml//) is emptier than the generated one. It is because I skipped Hello world app and whole tests thing. Also in the //pom.xml// I left out project //name//, //url//, //description// and whole lot of other sections to keep it truly minimal.</note> <note info> Please note that this project (and also its //pom.xml//) is emptier than the generated one. It is because I skipped Hello world app and whole tests thing. Also in the //pom.xml// I left out project //name//, //url//, //description// and whole lot of other sections to keep it truly minimal.</note>
  
Line 196: Line 196:
 </properties> </properties>
 </code> </code>
-Interactive mode fills it in by itself and according to [[https://maven.apache.org/general.html#encoding-warning|this]] the property configures plain-text processing modules to use specific encoding.+Interactive mode fills it in by itself and according to [[https://maven.apache.org/general.html#encoding-warning|this]] the property configures plain text processing modules to use specific encoding.
  
 ==== Conclusion ==== ==== Conclusion ====
Line 203: Line 203:
 Also, from discussion with some of my colleagues, we got to the realization that none of us actually use project generation through Maven and that we do things by hand. The only thing we agreed upon is that specific project structure generation is useful when somebody else tells you which //archetypeArtifactId// to use. Also, from discussion with some of my colleagues, we got to the realization that none of us actually use project generation through Maven and that we do things by hand. The only thing we agreed upon is that specific project structure generation is useful when somebody else tells you which //archetypeArtifactId// to use.
  
-Although it is very good idea to provide templating capabilities to Maven, it failed to restrict which templates are in core Maven installation - which lead to 1641 templates (in the time of writing). Solution to this may be pretty simple: Maven, as we see later, allows you to configure additional repositories for JAR libraries. It shouldn't be hard to extend this also on internal Maven components like project templates and with core Maven provide only, say, JAR and J2EE thingies (WAR/EAR packagings and such), leaving third-party projects to be explicitly allowed through JAR library with template or standalone repository.+Although it is very good idea to provide templating capabilities to Maven, it failed to restrict which templates are in core Maven installation - which lead to 1641 templates (at the time of writing). Solution to this may be pretty simple: Maven, as we see later, allows you to configure additional repositories for JAR libraries. It shouldn't be hard to extend this also on internal Maven components like project templates and with core Maven provide only, say, JAR and J2EE thingies (WAR/EAR packagings and such), leaving third-party projects to be explicitly allowed through JAR library with template or standalone repository.
start/maven/totalnewbieintro.1471014320.txt.gz · Last modified: 2016/08/12 15:05 by fiisch