Skip to content
Snippets Groups Projects
Commit f774818f authored by Goik Martin's avatar Goik Martin
Browse files

Intellij Idea getting statrted hints

parent 5db43215
No related branches found
No related tags found
No related merge requests found
Doc/Sd1/Ref/Fig/NewProjectMavenIntellij/s100_startscreen.png

18.8 KiB

Doc/Sd1/Ref/Fig/NewProjectMavenIntellij/s200_selectMavenArchetype.png

45.5 KiB

Doc/Sd1/Ref/Fig/NewProjectMavenIntellij/s300_groupArtifactID.png

14 KiB

Doc/Sd1/Ref/Fig/NewProjectMavenIntellij/s400_projectRoot.png

20.9 KiB

Doc/Sd1/Ref/Fig/NewProjectMavenIntellij/s500_ImportMaven.png

2.99 KiB

Doc/Sd1/Ref/Fig/intelliJIDEALicenseActivation.png

16.3 KiB

......@@ -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">&lt;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"&gt;
&lt;profiles&gt;
&lt;profile&gt;
&lt;id&gt;dev&lt;/id&gt;
&lt;repositories&gt;
&lt;repository&gt;
&lt;id&gt;archetype&lt;/id&gt;
&lt;url&gt;https://maven.mi.hdm-stuttgart.de/Archetypes&lt;/url&gt;
&lt;releases&gt;&lt;enabled&gt;true&lt;/enabled&gt;&lt;/releases&gt;
&lt;snapshots&gt;&lt;enabled&gt;true&lt;/enabled&gt;&lt;/snapshots&gt;
&lt;/repository&gt;
&lt;/repositories&gt;
&lt;/profile&gt;
&lt;/profiles&gt;
&lt;activeProfiles&gt;
&lt;activeProfile&gt;dev&lt;/activeProfile&gt;
&lt;/activeProfiles&gt;
&lt;/settings&gt;</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&gt; 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>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment