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

Maven archetype JavaFX by .fxml description

parent a1f27367
No related branches found
No related tags found
No related merge requests found
Showing
with 271 additions and 0 deletions
/target/
/.settings/
/.classpath
/.project
install:
mvn clean install
rsync -av --delete -e ssh ~/.m2/repository/de/hdm-stuttgart/mi root@maven.mi.hdm-stuttgart.de:/var/www/Archetypes/de/hdm-stuttgart
clean:
rm -rf ~/.m2/repository/de/hdm-stuttgart/mi/mi-maven-archetype-javafxml
#end
Final success via http://maven.apache.org/archetype/maven-archetype-plugin/examples/create-with-property-file.html
Create Project from local repository using:
mvn archetype:generate -DarchetypeCatalog=local -DarchetypeGroupId=de.hdm-stuttgart.mi \
-DarchetypeArtifactId=mi-maven-archetype-javaxml -DarchetypeVersion=1.0 \
-DgroupId=qq -DartifactId=ww -DinteractiveMode=false
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>de.hdm-stuttgart.mi</groupId>
<artifactId>mi-maven-archetype-javafxml</artifactId>
<version>1.0</version>
<packaging>jar</packaging>
<name>JavaFXml Basic Archetype</name>
<description>
The JavaFX Basic Archetype provides core functionality for assembling JavaFX applications.
This archetype is derived from https://github.com/zonski/javafx-basic-archetype
</description>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<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">
<fileSets>
<fileSet filtered="true" packaged="true" encoding="UTF-8">
<directory>src/main/java</directory>
<includes>
<include>**/*.java</include>
</includes>
</fileSet>
<fileSet filtered="true" encoding="UTF-8">
<directory>src/main/resources</directory>
<includes>
<include>log4j2.xml</include>
<include>fxml/hello.fxml</include>
<include>styles/styles.css</include>
</includes>
</fileSet>
<fileSet filtered="false" encoding="UTF-8">
<directory>src/main/resources</directory>
<includes>
<include>images/background.jpg</include>
</includes>
</fileSet>
<fileSet filtered="true" packaged="true" encoding="UTF-8">
<directory>src/test/java</directory>
<includes>
<include>**/*.java</include>
</includes>
</fileSet>
<fileSet filtered="false" packaged="false" encoding="UTF-8">
<directory/>
<includes>
<include>.gitignore</include>
</includes>
</fileSet>
</fileSets>
</archetype-descriptor>
/target/
/.settings/
.classpath
.project
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>${groupId}</groupId>
<artifactId>${artifactId}</artifactId>
<version>${version}</version>
<packaging>jar</packaging>
<name>${artifactId}</name>
<!--Fixme: Add a sensible project related domain here -->
<url>http://somedomain.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.1</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.1</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.10.1</version>
<configuration/>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.3</version>
<configuration>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<manifestEntries>
<Main-Class>${package}.App</Main-Class>
</manifestEntries>
</transformer>
</transformers>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.geometry.*?>
<?import javafx.scene.control.*?>
<?import java.lang.*?>
<?import javafx.scene.layout.*?>
<GridPane fx:controller="${package}.HelloController"
hgap="5.0" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity"
prefHeight="402.0" prefWidth="600.0" styleClass="main-panel" stylesheets="@../styles/styles.css" vgap="5.0"
xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" >
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" maxWidth="319.0" minWidth="10.0" prefWidth="279.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="470.0" minWidth="10.0" prefWidth="321.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<Label text="First name:" />
<Label text="Last name:" GridPane.rowIndex="1" />
<Button mnemonicParsing="false" onAction="#sayHello" text="Say hello" GridPane.rowIndex="2" />
<TextField fx:id="firstNameField" GridPane.columnIndex="1" />
<TextField fx:id="lastNameField" GridPane.columnIndex="1" GridPane.rowIndex="1" />
<Label fx:id="helloLabel" styleClass="hello-message" text=" " GridPane.columnIndex="1" GridPane.rowIndex="2" />
</children>
<padding>
<Insets bottom="20.0" left="20.0" right="20.0" top="20.0" />
</padding>
</GridPane>
<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
<Appenders>
<File name="A1" fileName="A1.log" append="false">
<PatternLayout pattern="%t %-5p %c{2} - %m%n"/>
</File>
<Console name="STDOUT" target="SYSTEM_OUT">
<PatternLayout pattern="%d %-5p [%t] %C{2} (%F:%L) - %m%n"/>
</Console>
</Appenders>
<Loggers>
<!-- You my want to define class or package level per-logger rules -->
<Logger name="${package}.App" level="debug">
<AppenderRef ref="A1"/>
</Logger>
<Root level="debug">
<AppenderRef ref="STDOUT"/>
</Root>
</Loggers>
</Configuration>
\ No newline at end of file
/* Application wide styles */
.label {
-fx-font-size: 12px;
-fx-font-weight: bold;
-fx-text-fill: #333333;
-fx-effect: dropshadow( gaussian , rgba(255,255,255,0.5) , 0,0,0,1 );
}
.button {
-fx-text-fill: white;
-fx-font-family: "Arial Narrow";
-fx-font-weight: bold;
-fx-background-color: linear-gradient(#61a2b1, #2A5058);
-fx-effect: dropshadow( three-pass-box , rgba(0,0,0,0.6) , 5, 0.0 , 0 , 1 );
}
.button:hover{
-fx-background-color: #395bae;
}
/* Component specific styles */
.main-panel {
-fx-background-image: url("../images/background.jpg");
}
.hello-message {
-fx-text-fill: #AA0000;
-fx-font-weight: bold;
-fx-effect: dropshadow( gaussian , rgba(255,255,255,0.5) , 0,0,0,1 );
}
package $package;
import org.junit.Assert;
import org.junit.Test;
/**
* Unit test for simple App.
*/
public class AppTest {
/**
* Dummy test method
*/
@Test
public void testApp() {
Assert.assertTrue( true );
}
}
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