Maven javadoc plugin won't use my stylesheet - css

I'm trying to run the javadoc:javadoc goal for Maven for my Java 1.7 project. I'd like to specify my customized stylesheet in /src/main/java/stylesheet.css to use when running the goal, but the default javadoc stylesheet is used instead.
I've tried adding the following to my pom.xml file, as the https://maven.apache.org/plugins/maven-javadoc-plugin/examples/stylesheet-configuration.html documentation on the Apache Maven site suggests:
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.10.3</version>
<configuration>
<stylesheetfile>src/main/java/stylesheet.css</stylesheetfile>
</configuration>
</plugin>
</plugins>
</reporting>
But this doesn't get the desired result when I run the maven javadoc:javadoc goal. Any suggestions?
Update: I've tried with
<configuration>
<stylesheetfile>theme-irvine.css</stylesheetfile>
</configuration>
And with
<configuration>
<stylesheetfile>${basedir}/src/main/java/theme-irvine.css</stylesheetfile>
</configuration>
in my pom.xml file, and neither of those worked, either.

Related

how to config "--enable-preview" when using javafx:jlink in javafx-maven-plugin

I use this plugin in my javafx project: https://github.com/openjfx/javafx-maven-plugin ,
<plugin>
<groupId>org.openjfx</groupId>
<artifactId>javafx-maven-plugin</artifactId>
<version>0.0.4</version>
<configuration>
...
<launcher>launcher</launcher>
<mainClass>xxx/com.xxx.Main</mainClass>
</configuration>
</plugin>
I use java 14 preview features in my code, and use javafx:jlink command to generate Runtime image, but when I run Runtime image, error:
java.lang.UnsupportedClassVersionError: Preview features are not enabled for com/xxx/Main (class file version 58.65535). Try running with '--enable-preview'.
how to config --enable-preview when using javafx:jlink in javafx-maven-plugin
Change your javafx-maven-plugin's configuration
<configuration>
...
<launcher>launcher</launcher>
<mainClass>xxx/com.xxx.Main</mainClass>
<options>
<option>--enable-preview</option>
</options>
</configuration>
Note : Options are also added to jlink image script

Javafx application doesnt work after install

I'm creating new JavaFX application. I have done it, now i need to build exe file. After build I have installed it, then i launch the program and nothing. There is no application window, it was showing only in task manager...
Project have no errors, just some warrnings. I'am using http connections in it, maybe i need to declare permissions or something? Where can i do it if it's a problem?
I've tried to generate new build.xml, include newest sdk/jre, installed new version of java in my computer.
Java cannot build an exe file by itself. Every client who needs to run the application needs an appropriate JRE installed to run the application. Therefore you would need some software that packages the jar and the JRE into an exe file to install it or packages the jar and JRE into one single exe file which executes your program.
It has nothing to do with your http connections or build.xml.
However your app will run when you call it via the command line java -jar YOUR_APP.jar
If you just want to run your program by double clicking the jar file (and not build an exe), you can take a look at the following paragraphs.
For Maven
If you are building your project with Maven you can try the following POM settings to have your program be executable from the jar file (double click the jar file to start the JavaFX application):
[...]
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>com.zenjava</groupId>
<artifactId>javafx-maven-plugin</artifactId>
<version>8.1.4</version>
<configuration>
<mainClass>PATH TO YOUR MAIN CLASS (e.g. com.foo.Main)</mainClass>
<allPermissions>true</allPermissions>
</configuration>
<executions>
<execution>
<id>create-jfxjar</id>
<phase>package</phase>
<goals>
<goal>build-jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<archive>
<manifest>
<mainClass>PATH TO YOUR MAIN CLASS (e.g. com.foo.Main)</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
[...]
I recommend you exporting it as an jar file because it can be excecuted on linux, too and it fixes your problem because it can contain all the data you need just like fxmls!
Just export your project as an runnable jar and this window will appear!
Click here! I don't have enough reputation (but it works ;) )
And now you are finished!

Project files created with the maven-eclipse-plugin are not supported in M2Eclipse

We have a really simple Tycho project:
<properties>
<tycho-version>0.26.0</tycho-version>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.build.timestamp.format>yyyyMMdd_HHmmss</maven.build.timestamp.format>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-maven-plugin</artifactId>
<extensions>true</extensions>
<version>${tycho-version}</version>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<version>${tycho-version}</version>
<!-- snipped because probably not relevant -->
</plugin>
</plugins>
</build>
When we execute the maven goal eclipse:eclipse, we get the following weird comment in the .project files of features and products:
NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse.
(A nonsense exception, because we execute it on the command line, there is no M2Eclipse involved at all.)
We could probably live with that, but the .classpath files look like that:
<classpathentry kind="lib" path="C:/Users/WileCoyote/.m2/repository/p2/osgi/bundle/com.itextpdf/5.5.3/com.itextpdf-5.5.3.jar"/>
<classpathentry kind="lib" path="C:/Users/WileCoyote/.m2/repository/p2/osgi/bundle/org.acme.config/2.0.2.v201506191015/org.acme.config-2.0.2.v201506191015.jar"/>
<!-- etc. -->
And so if imported in another user's workspace, these projects don't work anymore.
Here is an explanation on how to fix the problem, but that's really a no-brainer (remove the broken class path entries from the class path, because features and products don't need them anyway).
What I really want to know is why it happens at all? What is the problem? How do I fix it?

Thucydides not respecting browser specified in pom.xml for project built from thucydides-jbehave-archetype

I have a project built from the thucydides-jbehave-archetype
I'm trying to follow these steps to change the browser that Thucydides is running with when I run my projectL http://thucydides.info/docs/thucydides/_running_thucydides_in_different_browsers.html
In the pom.xml I had this (which is from the thucydides archetype):
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.11</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
and per the instructions, I have changed this to:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.11</version>
<!--
<configuration>
<skip>true</skip>
</configuration>
-->
<configuration>
<systemPropertyVariables>
<webdriver.driver>${webdriver.driver}</webdriver.driver>
</systemPropertyVariables>
</configuration>
</plugin>
and I also changed the value in my properties section:
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<thucydides.version>0.9.205</thucydides.version>
<thucydides.jbehave.version>0.9.205</thucydides.jbehave.version>
<!-- I have tried chrome too -->
<webdriver.driver>safari</webdriver.driver>
</properties>
but my tests are still running with the default browser (firefox). What am I doing wrong here?
I've had the same problem with systemPropertyVariables and I've decided don't use pom.xml for this.
You need to create class *TestSuite and to extend it from class ThucydidesJUnitStories.
In constructor you just set properties which you need.
import net.thucydides.core.ThucydidesSystemProperty;
import net.thucydides.jbehave.ThucydidesJUnitStories;
public class PremiumTestSuite extends ThucydidesJUnitStories {
public PremiumTestSuite() {
System.setProperty("webdriver.chrome.driver", System.getProperty("user.home") + "/chromedriver");
getSystemConfiguration().setIfUndefined("webdriver.driver", "chrome");
getSystemConfiguration().setIfUndefined(ThucydidesSystemProperty.THUCYDIDES_STORE_HTML_SOURCE.getPropertyName(), "true");
getSystemConfiguration().setIfUndefined(ThucydidesSystemProperty.THUCYDIDES_TAKE_SCREENSHOTS.getPropertyName(), "FOR_FAILURES");
}
}
I hope it will help you :)

How to set custom icon for javafx native package icon on Windows

I am trying to chance the icon of the exe file while creating native bundling of javafx packaging.
I tried adding icon into pom.xml but till it wont work out for me as it gives default icon
Using Intellij IDEA IDE which contain an Pom.xml creating an package by command = mvn jfx:build-native
Here is my pom.xml:
<build>
<plugins>
<plugin>
<groupId>com.zenjava</groupId>
<artifactId>javafx-maven-plugin</artifactId>
<version>1.5</version>
<configuration>
<mainClass>com.demoApp.testapp.testApplication</mainClass>
<!-- only required if signing the jar file -->
<keyStoreAlias>example-user</keyStoreAlias>
<keyStorePassword>example-password</keyStorePassword>
<permissions>
<permission>all-permissions</permission>
</permissions>
<icon>${basedir}/src/main/resources/images/logoIcon.ico</icon>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
I have added an icon path into pom.xml ${basedir}/src/main/resources/images/logoIcon.ico
that will run while native package execute but it wont work out for me
Is any other way to do it ?
Please suggest.
i tried fx tags in pom.xml using ant,here is my changes in pom.xml
<properties>
<javafx.tools.ant.jar>${env.JAVA_HOME}\lib\ant-javafx.jar</javafx.tools.ant.jar> </properties>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<id>create-launcher-jar</id>
<phase>package</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target xmlns:fx="javafx:com.sun.javafx.tools.ant">
<taskdef
uri="javafx:com.sun.javafx.tools.ant"
resource="com/sun/javafx/tools/ant/antlib.xml"
classpath="${javafx.tools.ant.jar}"/>
<fx:application id="fxApp"
name="${project.name}"
mainClass="com.precisionhawk.flightplanner.FlightPlannerApp"/>
<fx:jar destfile="${project.build.directory}/${project.build.finalName}-launcher">
<fx:application refid="fxApp"/>
<fx:fileset dir="${project.build.directory}/classes"/>
</fx:jar>
<attachartifact file="${project.build.directory}/${project.build.finalName}-launcher.jar"
classifier="launcher"/>
<fx:deploy>
<fx:info>
<fx:icon href="${basedir}/src/main/deploy/logoIcon.ico"></fx:icon>
</fx:info>
</fx:deploy>
</target>
</configuration>
</execution>
</executions>
</plugin>
but it wont work out..
I just struggled with the same issue using Zonsky's great javafx-maven-plugin. As of version 1.5, which you also were using, the src/main/deploy directory will be added to the classpath. The icon you want to use could be added there and it will be available on the classpath for the native builder!
I added src/main/deploy/package/windows/myapp.ico there and it finally worked :)
For you:
Create src/main/deploy/package/windows/ folder
Add icon with name ${project.build.finalName}.ico
Run mvn jfx:build-native
I haven't played with it extensively - just got it to work and wanted to share. So if you want to use icon with different name, I don't know how. Not yet at least. The <icon>...</icon> section in the config section seems to be for webstart, so I haven't been using it.
Hope you get it to work!
You need to look at the logging while building a native app. That will tell you where the installer looks for the icon files and with wich name. For the default Windows native app it looks in ./package/windows/'appname'.ico
Can't remember where 'appname' comes from, but just look at the logging while building, it will tell you. (I use the Ant targets called from my pom btw)
you can do this:
`<plugin>
<groupId>com.zenjava</groupId>
<artifactId>javafx-maven-plugin</artifactId>
<version>8.8.3</version>
<configuration>
<vendor>YourCompany</vendor>
<mainClass>com.alan344.MapperGenApplication</mainClass>
<appName>mybatis-friend</appName>
<bundleArguments>
<icon>${project.basedir}/src/main/resources/image/icon.ico</icon>
</bundleArguments>
</configuration>
</plugin>`

Resources