diff --git a/ws/Archetypes/mi-maven-archetype-javafxml/README.md b/ws/Archetypes/mi-maven-archetype-javafxml/README.md new file mode 100644 index 0000000000000000000000000000000000000000..f2a981581459627e97b3293c84d35f6d0a534292 --- /dev/null +++ b/ws/Archetypes/mi-maven-archetype-javafxml/README.md @@ -0,0 +1,29 @@ +# 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. + + + diff --git a/ws/Archetypes/mi-maven-archetype-javafxml/pom.xml b/ws/Archetypes/mi-maven-archetype-javafxml/pom.xml index 249d055eca676a8ddd3111cc1aaa45a03ccc9fc9..d1acfc8331e7a6df1ef691d5a58018a1b9d78bdd 100644 --- a/ws/Archetypes/mi-maven-archetype-javafxml/pom.xml +++ b/ws/Archetypes/mi-maven-archetype-javafxml/pom.xml @@ -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 --> diff --git a/ws/Archetypes/mi-maven-archetype-javafxml/src/main/resources/META-INF/maven/archetype-metadata.xml b/ws/Archetypes/mi-maven-archetype-javafxml/src/main/resources/META-INF/maven/archetype-metadata.xml index cb23adac91aa8794a01ea69b8c1e9eb7e3435436..a490f48a6481a2a318a7dea2ce46f057d0d13b43 100644 --- a/ws/Archetypes/mi-maven-archetype-javafxml/src/main/resources/META-INF/maven/archetype-metadata.xml +++ b/ws/Archetypes/mi-maven-archetype-javafxml/src/main/resources/META-INF/maven/archetype-metadata.xml @@ -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> diff --git a/ws/Archetypes/mi-maven-archetype-javafxml/src/main/resources/archetype-resources/pom.xml b/ws/Archetypes/mi-maven-archetype-javafxml/src/main/resources/archetype-resources/pom.xml index 7c5ca29d47f3f6a6179fa6bcdba49c5ac0a7fb72..6a18a13e92461319cc9f317107e5fdc8c8d1d13c 100644 --- a/ws/Archetypes/mi-maven-archetype-javafxml/src/main/resources/archetype-resources/pom.xml +++ b/ws/Archetypes/mi-maven-archetype-javafxml/src/main/resources/archetype-resources/pom.xml @@ -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> diff --git a/ws/Archetypes/mi-maven-archetype-javafxml/src/main/resources/archetype-resources/src/main/java/module-info.java b/ws/Archetypes/mi-maven-archetype-javafxml/src/main/resources/archetype-resources/src/main/java/module-info.java index bedd76c7ec579f716ebbe906792cf10f23a1d107..c5c45ba7acaeddec04c738762023ac5cfa2c54dd 100644 --- a/ws/Archetypes/mi-maven-archetype-javafxml/src/main/resources/archetype-resources/src/main/java/module-info.java +++ b/ws/Archetypes/mi-maven-archetype-javafxml/src/main/resources/archetype-resources/src/main/java/module-info.java @@ -1,8 +1,8 @@ -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 +}