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

Archetype corrections

parent 63f65f7a
No related branches found
No related tags found
No related merge requests found
# Modified Maven archetype
This archetype has been derived from https://github.com/openjfx/javafx-maven-archetypes /
https://mvnrepository.com/artifact/org.openjfx/javafx-archetype-fxml demonstrating JavaFX application assembly.
There is added java FXML https://docs.oracle.com/javafx/2/get_started/fxml_tutorial.htm support including both the Log4j
and Junit framework.
## Hosting
This archetype is being hosted at
https://maven.mi.hdm-stuttgart.de/nexus/#browse/browse:mi-maven:de%2Fhdm_stuttgart%2Fmi%2Fmi-maven-archetype-javafxml .
## Getting started
1. Follow https://freedocs.mi.hdm-stuttgart.de/sd1_sect_mavenCli.html#sd1_fig_mavenMiRepo to configure the above MI
Maven Nexus Maven repository server.
2. Create a project by executing:
```bash
mvn archetype:generate -DarchetypeCatalog=local -DarchetypeGroupId=de.hdm-stuttgart.mi \
-DarchetypeArtifactId=mi-maven-archetype-javafxml -DarchetypeVersion=21.0.1 \
-DgroupId=de.mi.hdm_stuttgart -DartifactId=hellojavafx -DinteractiveMode=false
```
3. Execute `mvn javafx:run`. You should see a GUI window popping up. Enter input and see corresponding log entries
in your underlying shell-
4. Optional: Working with IntelliJ IDEA follow
https://freedocs.mi.hdm-stuttgart.de/sd1_sect_idea.html#sd1_fig_mavenIdeaArchetypeCatalogPlugin to configure
the MI Maven Nexus Maven repository server in your IDE as well. You may add a `javafx:run` to your project's
run configurations.
......@@ -4,12 +4,12 @@
<groupId>de.hdm_stuttgart.mi</groupId>
<artifactId>mi-maven-archetype-javafxml</artifactId>
<version>20.1</version>
<version>21.0.1</version>
<packaging>maven-archetype</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<archetype.tools.version>3.1.2</archetype.tools.version>
<archetype.tools.version>3.2.1</archetype.tools.version>
</properties>
<name>JavaFXml basic archetype</name>
......@@ -50,7 +50,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.1.0</version>
<version>3.3.1</version>
<configuration>
<!-- Required so that .gitignore gets included in archetypes,
^see https://issues.apache.org/jira/browse/MRESOURCES-190 -->
......
......@@ -2,9 +2,16 @@
<archetype-descriptor xsi:schemaLocation="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0 http://maven.apache.org/xsd/archetype-descriptor-1.0.0.xsd" name="def"
xmlns="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<requiredProperties>
<requiredProperty key="javafx-module">
<defaultValue>gui</defaultValue>
</requiredProperty>
</requiredProperties>
<fileSets>
<fileSet filtered="true">
<fileSet filtered="true" >
<directory>src/main/java</directory>
<includes>
<include>module-info.java</include>
......@@ -55,6 +62,13 @@
</includes>
</fileSet>
<fileSet filtered="true" packaged="true">
<directory/>
<includes>
<include>pom.xml</include>
</includes>
</fileSet>
<fileSet filtered="false" packaged="false">
<directory/>
<includes>
......@@ -63,4 +77,4 @@
</fileSet>
</fileSets>
</archetype-descriptor>
\ No newline at end of file
</archetype-descriptor>
......@@ -10,7 +10,8 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<javafx.base.version>20</javafx.base.version>
<javafx.base.version>21.0.1</javafx.base.version>
<javafx.module.name>${javafx-module}</javafx.module.name>
</properties>
<name>${artifactId}</name>
......@@ -34,14 +35,14 @@
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.9.2</version>
<version>5.10.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.20.0</version>
<version>2.21.0</version>
</dependency>
</dependencies>
......@@ -53,9 +54,14 @@
<artifactId>javafx-maven-plugin</artifactId>
<version>0.0.8</version>
<configuration>
<mainClass>${groupId}.GuiDriver</mainClass>
<mainClass>${javafx.module.name}/${groupId}.GuiDriver</mainClass>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.11.0</version>
</plugin>
</plugins>
</build>
</project>
module gui {
module ${javafx-module} {
requires javafx.controls;
requires javafx.fxml;
requires org.apache.logging.log4j;
opens ${package} to javafx.fxml;
exports ${package};
}
\ No newline at end of file
}
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