Skip to content
Snippets Groups Projects
Commit 0e7bbce7 authored by Juuso Rytilahti's avatar Juuso Rytilahti
Browse files

Updated the log messages to fit to the project name in images

parent 0a9a466d
No related branches found
No related tags found
No related merge requests found
......@@ -47,20 +47,20 @@ Maven prints something like this:
```
[INFO] Scanning for projects...
[INFO]
[INFO] ----------------------< fi.utu.tko2116:MavenExample >----------------------
[INFO] Building MavenEsim 1.0-SNAPSHOT
[INFO] ----------------------< fi.utu:Example >----------------------
[INFO] Building Example 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ MavenEsim ---
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ Example ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.,[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ MavenEsim ---
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ Example ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to /home/john/MavenExample/target/classes
[INFO] Compiling 1 source file to /home/john/Example/target/classes
[INFO] ------------------------------------------------------------------------
......@@ -86,15 +86,15 @@ As long as everything is just `INFO`, everything is fine. `WARNING` should be no
[INFO]
[INFO] ----------------------< fi.utu.tko2116:MavenExample >----------------------
[INFO] ----------------------< fi.utu:Example >----------------------
[INFO] Building MavenExample 1.0-SNAPSHOT
[INFO] Building Example 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ MavenExample ---
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ Example ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
......@@ -102,11 +102,11 @@ As long as everything is just `INFO`, everything is fine. `WARNING` should be no
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ MavenExample ---
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ Example ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to /home/john/MavenExample/target/classes
[INFO] Compiling 1 source file to /home/john/Example/target/classes
[INFO] -------------------------------------------------------------
......@@ -114,7 +114,7 @@ As long as everything is just `INFO`, everything is fine. `WARNING` should be no
[INFO] -------------------------------------------------------------
[ERROR] /home/john/MavenExample/src/main/java/fi/utu/tko2116/Main.java:[5,43] ';' expected
[ERROR] /home/john/Example/src/main/java/fi/utu/tko2116/Main.java:[5,43] ';' expected
[INFO] 1 error
......@@ -132,9 +132,9 @@ As long as everything is just `INFO`, everything is fine. `WARNING` should be no
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project MavenExample: Compilation failure
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project Example: Compilation failure
[ERROR] /home/john/MavenExample/src/main/java/fi/utu/tko2116/Main.java:[5,43] ';' expected
[ERROR] /home/john/Example/src/main/java/fi/utu/tko2116/Main.java:[5,43] ';' expected
[ERROR]
......@@ -142,7 +142,7 @@ As long as everything is just `INFO`, everything is fine. `WARNING` should be no
[ERROR]
[ERROR] To see the full stack trace of the errors, re-[ERROR] /home/john/MavenExample/src/main/java/fi/utu/tko2116/Main.java:[5,43] ';' expectedrun Maven with the -e switch.
[ERROR] To see the full stack trace of the errors, re-[ERROR] /home/john/Example/src/main/java/fi/utu/tko2116/Main.java:[5,43] ';' expectedrun Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
......@@ -158,7 +158,7 @@ Process finished with exit code 1
Finding the Java error from this can be quite tricky, but it can be found in two places:
`[ERROR] /home/john/MavenExample/src/main/java/fi/utu/tko2116/Main.java:[5,43] ';' expected`
`[ERROR] /home/john/Example/src/main/java/fi/utu/tko2116/Main.java:[5,43] ';' expected`
So the error is on line 5 and character 43 on that line: a semicolon is missing.,Still, Java programs can and should be developed using the "play button", but remember that mvn is a command-line tool that also works without IntelliJ. Of course, mvn doesn't compile anything itself, but uses a Java compiler.
......@@ -172,7 +172,7 @@ Of course, again, `jar` packaging is handled by a command-line tool, but we will
You can now execute this package from the command line, with the command
`java -jar MavenExample-1.0-SNAPSHOT.jar` ... or you could, if you had defined that the project has a main method.
`java -jar Example-1.0-SNAPSHOT.jar` ... or you could, if you had defined that the project has a main method.
Maven is often used to create various libraries. In this case, there is no main method, but the program only contains classes intended for others to use. As we are now creating an example application, we need to define a `plugin`, a kind of extension, which ensures that the definition concerning the main method is recorded in the package.
......@@ -194,7 +194,7 @@ This definition can be found in the `plugins/build.xml` file, from this reposito
</project>
```
If you now run `mvn package` again and then `java -jar MavenExample-1.0-SNAPSHOT.jar` the program works.
If you now run `mvn package` again and then `java -jar Example-1.0-SNAPSHOT.jar` the program works.
Next, let's look at the last section, downloading dependencies: [dependencies.md](https://gitlab.utu.fi/TKO_2116/week-3/-/blob/main/dependencies.md).
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment