This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
start:maven:totalnewbieintro [2016/08/12 14:48] fiisch [Interactive mode and problem of too many choices] |
start:maven:totalnewbieintro [2016/08/12 15:14] (current) fiisch [Conclusion] |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Total newbie introduction to Maven ====== | ====== Total newbie introduction to Maven ====== | ||
| - | <note warning> | + | Anybody who wanted to start with [[https:// |
| - | + | ||
| - | Anybody who wanted | + | |
| < | < | ||
| mvn archetype: | mvn archetype: | ||
| Line 9: | Line 7: | ||
| | | ||
| </ | </ | ||
| - | Oh God, whyyyy!? | + | Oh God, whyyyy!? |
| ==== Empty project structure ==== | ==== Empty project structure ==== | ||
| Line 51: | 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 // | * **-DarchetypeArtifactId=maven-archetype-quickstart** - This option specifies which // | ||
| - | * **-DinteractiveMode=false** - This is to not scare off beginners, see [[https:// | + | * **-DinteractiveMode=false** - This is because nobody wants to scare beginners |
| ==== Creating empty project by hand ==== | ==== Creating empty project by hand ==== | ||
| Line 102: | Line 100: | ||
| </ | </ | ||
| - | 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 // | <note info> Please note that this project (and also its // | ||
| Line 198: | Line 196: | ||
| </ | </ | ||
| </ | </ | ||
| - | Interactive mode fills it in by itself and according to [[https:// | + | Interactive mode fills it in by itself and according to [[https:// |
| ==== Conclusion ==== | ==== Conclusion ==== | ||
| + | I have shown three ways of creating basic Java project with Maven - interactive, | ||
| + | |||
| + | 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 // | ||
| + | |||
| + | 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' | ||