diff --git a/Doc/Sd1/Ref/Fig/NewProjectMavenIntellij/s100_startscreen.png b/Doc/Sd1/Ref/Fig/NewProjectMavenIntellij/s100_startscreen.png new file mode 100644 index 0000000000000000000000000000000000000000..76ea36099505dc28d6abcea9105aa41a0ae29567 Binary files /dev/null and b/Doc/Sd1/Ref/Fig/NewProjectMavenIntellij/s100_startscreen.png differ diff --git a/Doc/Sd1/Ref/Fig/NewProjectMavenIntellij/s200_selectMavenArchetype.png b/Doc/Sd1/Ref/Fig/NewProjectMavenIntellij/s200_selectMavenArchetype.png new file mode 100644 index 0000000000000000000000000000000000000000..c5b872f5e54f1584b5b21fea528665ef57afd458 Binary files /dev/null and b/Doc/Sd1/Ref/Fig/NewProjectMavenIntellij/s200_selectMavenArchetype.png differ diff --git a/Doc/Sd1/Ref/Fig/NewProjectMavenIntellij/s300_groupArtifactID.png b/Doc/Sd1/Ref/Fig/NewProjectMavenIntellij/s300_groupArtifactID.png new file mode 100644 index 0000000000000000000000000000000000000000..c0739161caaccb32181a3783997e4894c83deffd Binary files /dev/null and b/Doc/Sd1/Ref/Fig/NewProjectMavenIntellij/s300_groupArtifactID.png differ diff --git a/Doc/Sd1/Ref/Fig/NewProjectMavenIntellij/s400_projectRoot.png b/Doc/Sd1/Ref/Fig/NewProjectMavenIntellij/s400_projectRoot.png new file mode 100644 index 0000000000000000000000000000000000000000..cad9fb325412215c78025d75c77bb8c63772a14e Binary files /dev/null and b/Doc/Sd1/Ref/Fig/NewProjectMavenIntellij/s400_projectRoot.png differ diff --git a/Doc/Sd1/Ref/Fig/NewProjectMavenIntellij/s500_ImportMaven.png b/Doc/Sd1/Ref/Fig/NewProjectMavenIntellij/s500_ImportMaven.png new file mode 100644 index 0000000000000000000000000000000000000000..22cfc9bada0d29d1fbeb99b7847228ef83d9669e Binary files /dev/null and b/Doc/Sd1/Ref/Fig/NewProjectMavenIntellij/s500_ImportMaven.png differ diff --git a/Doc/Sd1/Ref/Fig/intelliJIDEALicenseActivation.png b/Doc/Sd1/Ref/Fig/intelliJIDEALicenseActivation.png new file mode 100644 index 0000000000000000000000000000000000000000..ff19695d27b59eccff2b85f20101141cd54cba3d Binary files /dev/null and b/Doc/Sd1/Ref/Fig/intelliJIDEALicenseActivation.png differ diff --git a/Doc/Sd1/gettingStarted.xml b/Doc/Sd1/gettingStarted.xml index c1be265b9f63455ee8267fb219287acd4d88e71e..3dd892fee1247af45cf579080b3bf9b0fad407b7 100644 --- a/Doc/Sd1/gettingStarted.xml +++ b/Doc/Sd1/gettingStarted.xml @@ -420,7 +420,7 @@ <caution> <para>We want to avoid thematic clashes with respect to exercise presentations whenever possible. Its no fun listening to the same - exercise's solution eight times in succession.</para> + exercises solution eight times in a row.</para> <para>Thus ask your supervisor for approval beforehand preparing an exercise presentation.</para> @@ -429,6 +429,29 @@ </itemizedlist> </section> + <section xml:id="sd1SectToolsOfTheTrade1"> + <title>Tools of the trade, part 1</title> + + <para>Programming exercises are being supported by the <productname + xlink:href="https://www.jetbrains.com/idea">IntelliJ IDEA</productname> + <xref linkend="glo_IDE"/> being licensed to all HdM affiliates. When + starting the beast for and activating the <option>License server</option> + option you will see the following dialog:</para> + + <mediaobject> + <imageobject> + <imagedata fileref="Ref/Fig/intelliJIDEALicenseActivation.png"/> + </imageobject> + </mediaobject> + + <para>The license server URL <uri + xlink:href="http://jetbrains.mi.hdm-stuttgart.de:11111">http://jetbrains.mi.hdm-stuttgart.de:11111</uri> + should appear automatically: If not chances are you do work outside the + HdM network (e.g. at home) thus requiring a <link + xlink:href="https://wiki.mi.hdm-stuttgart.de/wiki/VPN#OpenVPN_Konfigurationsdatei">MI + VPN connection</link> to be activated.</para> + </section> + <section xml:id="sd1CodeSnippets"> <title>Play!</title> @@ -700,4 +723,224 @@ loop # 12</programlisting> </qandaset> </section> </section> + + <section xml:id="sd1SectToolsOfTheTrade2"> + <title>Tools of the trade, part 2</title> + + <para>So far you've created plain <productname + xlink:href="https://www.jetbrains.com/idea">IntelliJ IDEA</productname> + <xref linkend="glo_Java"/> projects. For various reasons to be explained + later the <xref linkend="glo_IDE"/> also supports the <xref + linkend="glo_Maven"/> build software which among other features offers + automated testing to be discussed later. Meanwhile <xref + linkend="glo_Maven"/> allows to open your projects on different platforms + (Linux, Windows, Mac-OS): Thus you benefit from seamlessly working on your + exercises both at HdM or using your private Hardware at home.</para> + + <para><xref linkend="glo_Maven"/> is based on so called archetypes being + blueprints for projects. Since the MI departments provides enhanced + versions of some publicly available archetypes these supplements must be + configured in the <productname + xlink:href="https://www.jetbrains.com/idea">IntelliJ IDEA</productname> + <xref linkend="glo_IDE"/>.</para> + + <orderedlist> + <listitem> + <para>Follow the steps installing the <link + xlink:href="https://plugins.jetbrains.com/plugin/7965-maven-archetype-catalogs">Maven + Archetype Catalogs</link> plugin.</para> + </listitem> + + <listitem> + <para>Due to a change in the <xref linkend="glo_Maven"/> software + create (or modify) the file <filename>~/.m2/settings.xml</filename> + below your home directory to contain:</para> + + <programlisting language="xml"><settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd"> + + <profiles> + <profile> + <id>dev</id> + + <repositories> + + <repository> + <id>archetype</id> + <url>https://maven.mi.hdm-stuttgart.de/Archetypes</url> + <releases><enabled>true</enabled></releases> + <snapshots><enabled>true</enabled></snapshots> + </repository> + </repositories> + </profile> + </profiles> + + <activeProfiles> + <activeProfile>dev</activeProfile> + </activeProfiles> + +</settings></programlisting> + + <para>As you see this configuration contains the MI server's root URI + <uri + xlink:href="https://maven.mi.hdm-stuttgart.de/Archetypes">https://maven.mi.hdm-stuttgart.de/Archetypes</uri> + of supplementary archetypes.</para> + </listitem> + + <listitem> + <para>Test your configuration by creating a dummy project using the + command line (copy and paste to a shell window):</para> + + <programlisting language="bash">mvn -DinteractiveMode=false \ +-DgroupId=de.hdm_stuttgart.mi.sd1 \ +-DartifactId=test -Dversion=1.0 -DarchetypeGroupId=de.hdm-stuttgart.mi \ +-DarchetypeArtifactId=mi-maven-archetype-quickstart -DarchetypeVersion=1.1 \ +-DarchetypeRepository=https://maven.mi.hdm-stuttgart.de/Archetypes \ +org.apache.maven.plugins:maven-archetype-plugin:RELEASE:generate</programlisting> + + <para>This should result in the following output:</para> + + <programlisting language="bash">goik@hopc tmp> mvn -DinteractiveMode=false \ +-DgroupId=de.hdm_stuttgart.mi.sd1 \ +-DartifactId=test -Dversion=1.0 -DarchetypeGroupId=de.hdm-stuttgart.mi \ +-DarchetypeArtifactId=mi-maven-archetype-quickstart -DarchetypeVersion=1.1 \ +-DarchetypeRepository=https://maven.mi.hdm-stuttgart.de/Archetypes \ +org.apache.maven.plugins:maven-archetype-plugin:RELEASE:generate +[INFO] Scanning for projects... +[INFO] +[INFO] ------------------------------------------------------------------------ +[INFO] Building Maven Stub Project (No POM) 1 +... +[INFO] Parameter: version, Value: 1.0 +[INFO] Parameter: groupId, Value: de.hdm_stuttgart.mi.sd1 +[INFO] Parameter: artifactId, Value: test +[INFO] Project created from Archetype in dir: /ma/goik/tmp/test +[INFO] ------------------------------------------------------------------------ +[INFO] BUILD SUCCESS +[INFO] ------------------------------------------------------------------------ +[INFO] Total time: 1.380 s +[INFO] Finished at: 2017-06-02T12:49:05+02:00 +[INFO] Final Memory: 16M/164M</programlisting> + + <para>This creates a dummy project folder named + <filename>test</filename>.</para> + </listitem> + </orderedlist> + + <para>You are now prepared to create <xref linkend="glo_Maven"/> from + inside the <productname + xlink:href="https://www.jetbrains.com/idea">IntelliJ IDEA</productname> + <xref linkend="glo_IDE"/>.</para> + + <section xml:id="sd1FirstJavaProject"> + <title>Your first project</title> + + <para>Our <productname + xlink:href="https://www.jetbrains.com/idea">IntelliJ IDEA</productname> + <xref linkend="glo_IDE"/> supports the <xref linkend="glo_Maven"/> build + software to be discussed in greater detail later. For the time being + suffice it to say you'll benefit e.g. by transparently working on your + exercises both using HdM or private hardware of your choice.</para> + + <para>Create your first <xref linkend="glo_Maven"/> based project + by:</para> + + <orderedlist> + <listitem> + <para>Click <option>Create New Project</option></para> + + <mediaobject> + <imageobject> + <imagedata fileref="Ref/Fig/NewProjectMavenIntellij/s100_startscreen.png"/> + </imageobject> + </mediaobject> + </listitem> + + <listitem> + <para>Choose a Maven archetype</para> + + <mediaobject> + <imageobject> + <imagedata fileref="Ref/Fig/NewProjectMavenIntellij/s200_selectMavenArchetype.png"/> + </imageobject> + </mediaobject> + </listitem> + + <listitem> + <para>Define your project's group and artifact ID. In order to avoid + name clashes in projects maven requires:</para> + + <glosslist> + <glossentry> + <glossterm>GroupID</glossterm> + + <glossdef> + <para>Typically your organisation's (e.g. company) domain name + to avoid name clashes.</para> + </glossdef> + </glossentry> + + <glossentry> + <glossterm>AtifactID</glossterm> + + <glossdef> + <para>Your project's name within organisation e.g. + <code>musicarchiver</code>.</para> + </glossdef> + </glossentry> + + <glossentry> + <glossterm>Version</glossterm> + + <glossdef> + <para>Your project's version. Remember: With respect to + professional software development you may want to ship (and + sell!) different versions to your customers.</para> + </glossdef> + </glossentry> + </glosslist> + + <mediaobject> + <imageobject> + <imagedata fileref="Ref/Fig/NewProjectMavenIntellij/s300_groupArtifactID.png"/> + </imageobject> + </mediaobject> + </listitem> + + <listitem> + <para>Choose your project root</para> + + <tip> + <para>Create your project inside a cloud folder being synchronized + to e.g. the <link + xlink:href="https://cloud.mi.hdm-stuttgart.de">MI cloud</link>. + This way you'll be able to work seamlessly on different devices of + your choice.</para> + </tip> + + <para>Hit finish and wait for your project being created.</para> + + <mediaobject> + <imageobject> + <imagedata fileref="Ref/Fig/NewProjectMavenIntellij/s400_projectRoot.png"/> + </imageobject> + </mediaobject> + </listitem> + + <listitem> + <para>Enable auto import</para> + + <para>Whenever you see these options hit <option>Enable + Auto-import</option></para> + + <mediaobject> + <imageobject> + <imagedata fileref="Ref/Fig/NewProjectMavenIntellij/s500_ImportMaven.png"/> + </imageobject> + </mediaobject> + </listitem> + </orderedlist> + </section> + </section> </chapter>