I am working on an application with both English and Japanese language support. When I run the app from IntelliJ IDEA on my Mac, both languages display without problem. However, after installing on my iPhone and doing mvn -Pios gluonFX:nativerun from the ide (with the phone connected to my computer) the app runs fine, but the Japanese characters just appear as boxes or a series of horizontal lines.
There are no errors during the build, package, or install, that I can identify. I have set the property file encoding to UTF-8 in IntelliJ. I have tried changing the fonts from System to Hiragino sans.
If there is anything else that would be relevant to solving the problem, please let me know and I will edit the question.
Any help would be greatly appreciated.
Sion
screen shot of view showing garbled characters
Here is a section of the presenter for this view:
#FXML
void engToggleClick(){
config.setCurrentLocale(Locale.ENGLISH);
DrawerManager.buildDrawer(AppManager.getInstance());
updateLanguage();
}
#FXML
void jaToggleClick(){
config.setCurrentLocale(Locale.JAPANESE);
DrawerManager.buildDrawer(AppManager.getInstance());
updateLanguage();
}
private void updateLanguage(){
langs = ResourceBundle.getBundle("lang", config.getCurrentLocale());
AppManager.getInstance().getAppBar().setTitleText(langs.getString("settingsappbar.text"));
langSetLabel.setText(langs.getString("langsetlabel.text"));
viewModeSetLabel.setText(langs.getString("viewmodelabel.text"));
lightModeToggleBtn.setText(langs.getString("lightmodeset.text"));
darkModeToggleBtn.setText(langs.getString("darkmodeset.text"));
}
Here is the fxml for the view shown in the screen shot:
<?xml version="1.0" encoding="UTF-8"?>
<?import com.gluonhq.charm.glisten.control.Icon?>
<?import com.gluonhq.charm.glisten.control.ToggleButtonGroup?>
<?import com.gluonhq.charm.glisten.mvc.View?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.ToggleButton?>
<?import javafx.scene.layout.BorderPane?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.text.Font?>
<View fx:id="settings" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="600.0" prefWidth="350.0" stylesheets="#settings.css" xmlns="http://javafx.com/javafx/18" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.maplesunbook.views.SettingsPresenter">
<center>
<VBox alignment="CENTER" prefHeight="200.0" prefWidth="100.0" BorderPane.alignment="CENTER">
<children>
<Label fx:id="langSetLabel" text="%langsetlabel.text">
<font>
<Font name="HiraMinProN-W3" size="18.0" />
</font>
<padding>
<Insets bottom="10.0" />
</padding>
</Label>
<HBox alignment="CENTER" prefHeight="100.0" prefWidth="200.0">
<children>
<ToggleButtonGroup selectionType="SINGLE">
<toggles>
<ToggleButton fx:id="engToggleBtn" onAction="#engToggleClick" text="ENG | 英語">
<graphic>
<Icon content="LANGUAGE" />
</graphic>
<font>
<Font name="HiraMinProN-W3" size="13.0" />
</font>
</ToggleButton>
<ToggleButton fx:id="jaToggleBtn" onAction="#jaToggleClick" selected="true" text="JA | 日本語">
<graphic>
<Icon content="LANGUAGE" />
</graphic>
<font>
<Font name="Hiragino Sans CNS W3" size="13.0" />
</font>
</ToggleButton>
</toggles>
</ToggleButtonGroup>
</children>
</HBox>
<Label fx:id="viewModeSetLabel" layoutX="130.0" layoutY="196.0" text="%viewmodelabel.text">
<font>
<Font name="Hiragino Sans CNS W3" size="18.0" />
</font>
<padding>
<Insets bottom="10.0" />
</padding>
</Label>
<HBox alignment="CENTER" layoutX="10.0" layoutY="274.0" prefHeight="100.0" prefWidth="200.0">
<children>
<ToggleButtonGroup selectionType="SINGLE">
<toggles>
<ToggleButton fx:id="lightModeToggleBtn" onAction="#lightToggleClick" text="%lightmodeset.text">
<graphic>
<Icon content="BRIGHTNESS_HIGH" />
</graphic>
</ToggleButton>
<ToggleButton fx:id="darkModeToggleBtn" onAction="#darkToggleClick" selected="true" text="%darkmodeset.text">
<graphic>
<Icon content="BRIGHTNESS_1" />
</graphic>
</ToggleButton>
</toggles>
</ToggleButtonGroup>
</children>
</HBox>
</children>
</VBox>
</center>
</View>
Here is the pom.xml:
<?xml version="1.0" encoding="UTF-8"?>
<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>com.maplesunbook</groupId>
<artifactId>Gluon-DateCon</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Gluon-DateCon</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.release>11</maven.compiler.release>
<javafx.version>19</javafx.version>
<attach.version>4.0.16</attach.version>
<gluonfx.plugin.version>1.0.16</gluonfx.plugin.version>
<javafx.plugin.version>0.0.8</javafx.plugin.version>
<mainClassName>com.maplesunbook.GluonApplication</mainClassName>
</properties>
<dependencies>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-controls</artifactId>
<version>${javafx.version}</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-fxml</artifactId>
<version>${javafx.version}</version>
</dependency>
<dependency>
<groupId>com.gluonhq</groupId>
<artifactId>charm-glisten</artifactId>
<version>6.2.2</version>
</dependency>
<dependency>
<groupId>com.gluonhq.attach</groupId>
<artifactId>display</artifactId>
<version>${attach.version}</version>
</dependency>
<dependency>
<groupId>com.gluonhq.attach</groupId>
<artifactId>lifecycle</artifactId>
<version>${attach.version}</version>
</dependency>
<dependency>
<groupId>com.gluonhq.attach</groupId>
<artifactId>statusbar</artifactId>
<version>${attach.version}</version>
</dependency>
<dependency>
<groupId>com.gluonhq.attach</groupId>
<artifactId>storage</artifactId>
<version>${attach.version}</version>
</dependency>
<dependency>
<groupId>com.gluonhq.attach</groupId>
<artifactId>util</artifactId>
<version>${attach.version}</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>Gluon</id>
<url>https://nexus.gluonhq.com/nexus/content/repositories/releases</url>
</repository>
</repositories>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
</plugin>
<plugin>
<groupId>org.openjfx</groupId>
<artifactId>javafx-maven-plugin</artifactId>
<version>${javafx.plugin.version}</version>
<configuration>
<mainClass>${mainClassName}</mainClass>
</configuration>
</plugin>
<plugin>
<groupId>com.gluonhq</groupId>
<artifactId>gluonfx-maven-plugin</artifactId>
<version>${gluonfx.plugin.version}</version>
<configuration>
<!--suppress UnresolvedMavenProperty -->
<target>${gluonfx.target}</target>
<attachList>
<list>display</list>
<list>lifecycle</list>
<list>statusbar</list>
<list>storage</list>
</attachList>
<reflectionList>
<list>com.maplesunbook.views.ConverterPresenter</list>
<list>com.maplesunbook.views.SettingsPresenter</list>
<list>javafx.scene.control.DatePicker</list>
</reflectionList>
<bundlesList>
<list>lang_en</list>
<list>lang_ja</list>
</bundlesList>
<graalvmHome>/Library/Java/JavaVirtualMachines/graalvm-svm-java17-darwin-gluon-22.1.0.1-Final/Contents/Home</graalvmHome>
<mainClass>${mainClassName}</mainClass>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>ios</id>
<properties>
<gluonfx.target>ios</gluonfx.target>
</properties>
</profile>
<profile>
<id>android</id>
<properties>
<gluonfx.target>android</gluonfx.target>
</properties>
</profile>
</profiles>
</project>
Related
I am not sure whether I have integrated my application correctly with log4j2 but my objective is very clear. I want to capture each and every tiny logging information in my log file. The logging information includes the spring framework loading + apache tiles loading + my app loading and runtime logging.
Although I am able to capture org.springframework logging details but unable to do so for org.apache.tiles. However, I do capture all the logging information in my console.
It's not like that didn't capture anything at all from tiles logging, I do capture but it's ver few logging information. The amount of logging information I can see in the console is not even little close in the log file.
Here is my log4j2.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xml>
<Configuration monitorInterval="60">
<Properties>
<Property name="filename">D://log/</Property>
</Properties>
<Appenders>
<Console name="STDOUT" target="SYSTEM_OUT">
<PatternLayout
pattern="[%-5level] %d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %c{1} - %msg%n" />
</Console>
<File name="LOGFILE" fileName="${filename}/SpringWebJsp.log">
<PatternLayout
pattern="[%-5level] %d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %c{1} - %msg%n" />
</File>
</Appenders>
<Loggers>
<Logger name="com.jio.tiny" level="info" additivity="true">
<AppenderRef ref="LOGFILE" level="info" />
</Logger>
<Logger name="org.springframework" level="info" additivity="true">
<appender-ref ref="LOGFILE" level="info" />
</Logger>
<Logger name="org.apache.tiles" level="debug" additivity="true">
<appender-ref ref="LOGFILE" level="debug" />
</Logger>
<!--<Logger name="org.springframework.security" level="debug" additivity="true">
<appender-ref ref="LOGFILE" level="debug" />
</Logger> -->
<!-- <Logger name="org.thymeleaf" level="info" additivity="true">
<appender-ref ref="LOGFILE" level="info" />
</Logger> -->
<!-- <Logger name="org.hibernate" level="info" additivity="true">
<appender-ref ref="LOGFILE" level="info" />
</Logger> -->
<Root level="debug">
<AppenderRef ref="STDOUT" />
</Root>
</Loggers>
</Configuration>
my pom.xml
<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.jio.tiny</groupId>
<artifactId>SpringWebJsp</artifactId>
<packaging>war</packaging>
<version>0.0.1-SNAPSHOT</version>
<name>SpringWebJsp Maven Webapp</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<apachetiles.version>3.0.5</apachetiles.version>
<apache.logger.version>2.8.2</apache.logger.version>
</properties>
<repositories>
<repository>
<id>io.spring.repo.maven.release</id>
<url>http://repo.spring.io/release/</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-framework-bom</artifactId>
<version>4.1.9.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
</dependency>
<!-- Apache Tiles -->
<dependency>
<groupId>org.apache.tiles</groupId>
<artifactId>tiles-core</artifactId>
<version>${apachetiles.version}</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
</exclusion>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.tiles</groupId>
<artifactId>tiles-api</artifactId>
<version>${apachetiles.version}</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.tiles</groupId>
<artifactId>tiles-servlet</artifactId>
<version>${apachetiles.version}</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.tiles</groupId>
<artifactId>tiles-jsp</artifactId>
<version>${apachetiles.version}</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- Apache Log4j2 -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>${apache.logger.version}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>${apache.logger.version}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-jcl</artifactId>
<version>${apache.logger.version}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<version>${apache.logger.version}</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- <dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.7.6</version>
</dependency> -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-ext</artifactId>
<version>1.7.24</version>
</dependency>
<!-- Servlet+JSP+JSTL -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>javax.servlet.jsp-api</artifactId>
<version>2.3.1</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
</dependencies>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<!-- <version>3.2</version> -->
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.4</version>
<configuration>
<warSourceDirectory>src/main/webapp</warSourceDirectory>
<warName>SpringWebJsp</warName>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<configuration>
<outputDirectory>
D://log/jars/
</outputDirectory>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<finalName>SpringWebJsp</finalName>
</build>
</project>
logging for tiles captured in console
[DEBUG] 2017-07-04 22:02:57.504 [tomcat-http--2] sax - setDocumentLocator(com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser$LocatorProxy#261c3a65)
[DEBUG] 2017-07-04 22:02:57.504 [tomcat-http--2] sax - startDocument()
[DEBUG] 2017-07-04 22:02:57.504 [tomcat-http--2] sax - resolveEntity('-//Apache Software Foundation//DTD Tiles Configuration 3.0//EN', 'http://tiles.apache.org/dtds/tiles-config_3_0.dtd')
[DEBUG] 2017-07-04 22:02:57.504 [tomcat-http--2] Digester - Resolving to alternate DTD 'jar:file:/D:/sts-bundle/pivotal-tc-server-developer-3.2.4.SR1/base-instance/wtpwebapps/SpringWebJsp/WEB-INF/lib/tiles-core-3.0.5.jar!/org/apache/tiles/resources/tiles-config_3_0.dtd'
[DEBUG] 2017-07-04 22:02:57.506 [tomcat-http--2] sax - startElement(,tiles-definitions,tiles-definitions)
[DEBUG] 2017-07-04 22:02:57.506 [tomcat-http--2] Digester - Pushing body text ''
[DEBUG] 2017-07-04 22:02:57.506 [tomcat-http--2] Digester - New match='tiles-definitions'
[DEBUG] 2017-07-04 22:02:57.506 [tomcat-http--2] Digester - No rules found matching 'tiles-definitions'.
[DEBUG] 2017-07-04 22:02:57.507 [tomcat-http--2] sax - ignorableWhitespace(
)
[DEBUG] 2017-07-04 22:02:57.507 [tomcat-http--2] sax - ignorableWhitespace(
)
.
.
Similar piles of log continue
.
.
[DEBUG] 2017-07-04 22:02:57.540 [tomcat-http--2] BaseLocaleUrlDefinitionDAO - File Resource file:/D:/sts-bundle/pivotal-tc-server-developer-3.2.4.SR1/base-instance/wtpwebapps/SpringWebJsp/WEB-INF/views/tiles/tiles_en.xml at file:/D:/sts-bundle/pivotal-tc-server-developer-3.2.4.SR1/base-instance/wtpwebapps/SpringWebJsp/WEB-INF/views/tiles/tiles_en.xml not found, continue
[DEBUG] 2017-07-04 22:02:57.540 [tomcat-http--2] BaseLocaleUrlDefinitionDAO - File Resource file:/D:/sts-bundle/pivotal-tc-server-developer-3.2.4.SR1/base-instance/wtpwebapps/SpringWebJsp/WEB-INF/views/tiles/tiles_en_US.xml at file:/D:/sts-bundle/pivotal-tc-server-developer-3.2.4.SR1/base-instance/wtpwebapps/SpringWebJsp/WEB-INF/views/tiles/tiles_en_US.xml not found, continue
[DEBUG] 2017-07-04 22:02:57.654 [tomcat-http--2] ResolvingLocaleUrlDefinitionDAO - Resolve definition for child name='home' extends='base-definition.
[DEBUG] 2017-07-04 22:02:57.654 [tomcat-http--2] ResolvingLocaleUrlDefinitionDAO - Resolve definition for child name='products' extends='base-definition.
[DEBUG] 2017-07-04 22:02:57.654 [tomcat-http--2] ResolvingLocaleUrlDefinitionDAO - Resolve definition for child name='contactus' extends='base-definition.
[DEBUG] 2017-07-04 22:02:57.661 [tomcat-http--2] BasicTilesContainer - Render request received for definition 'home'
The amount of logging that my log file able to capture is just the last six lines of the above log details.
I wonder if the behavior is ok!
The amount of logging information in the console is not even little
close in the log file. Is this behavior ok?
Yes.
According to your configuration file, you are writing logs of only 3 packages (com.jio.tiny, org.springframework and org.apache.tiles) in log file. But every log (with level debug or higher) are being written in console, including logs of mentioned 3 packages. So it is expected that console may have more logs than file.
Is it possible to set the console and log file to have same logs? How?
Remove extra Logger definitions from Loggers section and refer file appender along with console appender. So, to have same logs in console and log file, your Loggers section can be as follows:
<Loggers>
<Root level="debug">
<AppenderRef ref="STDOUT" />
<AppenderRef ref="LOGFILE" />
</Root>
</Loggers>
I am using camel-blueprint and facing issues with hibernate component.
This example works fine in Spring but not in blueprint JBoss Fuse 6.3 V
The provided example is in spring and works fine but any example in blueprint will be helpful
http://camel.apache.org/hibernate-example.html
Error:
org.osgi.service.blueprint.container.ComponentDefinitionException: Error setting property: PropertyDescriptor Caused by: java.lang.Exception: Unable to convert value org.springframework.orm.hibernate4.LocalSessionFactoryBean#46797063 to type org.hibernate.SessionFactory
at org.apache.aries.blueprint.container.AggregateConverter.convert(AggregateConverter.java:184)
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0 https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd http://camel.apache.org/schema/blueprint http://camel.apache.org/schema/blueprint/camel-blueprint.xsd">
<bean class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close" id="dataSource">
<property name="url"
value="jdbc:sqlserver://x:1433;DatabaseName=x" />
<property name="driverClassName" value="com.microsoft.sqlserver.jdbc.SQLServerDriver" />
<property name="username" value="" />
<property name="password" value="" />
<property name="removeAbandoned" value="true" />
<property name="initialSize" value="20" />
<property name="maxActive" value="30" />
</bean>
<bean class="com.x.dto.ReferenceTable" id="refBean" />
<!-- <bean class="com.x.dao.ReferenceDAOImpl" id="MyBean">
<property name="sessionFactory" ref="mysessionFactory" />
</bean> -->
<!-- setup the Camel hibernate component -->
<bean class="org.apacheextras.camel.component.hibernate.HibernateComponent"
id="hibernate">
<property name="sessionFactory" ref="mysessionFactory" />
</bean>
<bean class="org.springframework.orm.hibernate4.LocalSessionFactoryBean"
id="mysessionFactory">
<property name="dataSource" ref="dataSource" />
<!-- here we define the hibernate mapping files we use -->
<property name="packagesToScan">
<list>
<value>com.x.dto</value>
</list>
</property>
<property name="annotatedClasses">
<list>
<value>com.x.dto.ReferenceTable</value>
</list>
</property>
<!-- and here we have additional hibernate options -->
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.SQLServerDialect</prop>
<prop key="hibernate.show_sql">true</prop>
</props>
</property>
</bean>
<camelContext id="_context1"
xmlns="http://camel.apache.org/schema/blueprint">
<route id="_route1">
<from id="from" uri="hibernate://com.x.dto.ReferenceTable?consumer.query=select x.data from com.x.dto.ReferenceTable x where x.id='id3'"/>
<!-- <bean id="_bean1" method="save(com.x.dto.ReferenceTable)" ref="MyBean"/>
<bean id="_bean2" method="getByID('id2')" ref="MyBean"/>
<convertBodyTo id="_convertBodyTo1" type="com.x.dto.ReferenceTable"/> -->
<to id="_to1" uri="log: ${body}"/>
</route>
</camelContext>
</blueprint>
Pom.xml file
<?xml version="1.0" encoding="UTF-8"?>
<project
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>com.mycompany</groupId>
<artifactId>camel-blueprint</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>bundle</packaging>
<name>Camel Blueprint Quickstart</name>
<description>Empty Camel Blueprint Example</description>
<licenses>
<license>
<name>Apache License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.html</url>
<distribution>repo</distribution>
</license>
</licenses>
<properties>
<camel.version>2.17.0.redhat-630187</camel.version>
<version.maven-bundle-plugin>3.2.0</version.maven-bundle-plugin>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<jboss.fuse.bom.version>6.3.0.redhat-187</jboss.fuse.bom.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.jboss.fuse.bom</groupId>
<artifactId>jboss-fuse-parent</artifactId>
<version>${jboss.fuse.bom.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-core</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-blueprint</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-test-blueprint</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>commons-dbcp</groupId>
<artifactId>commons-dbcp</artifactId>
</dependency>
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
<version>6.1.0.jre8</version>
</dependency>
<dependency>
<groupId>org.apache-extras.camel-extra</groupId>
<artifactId>camel-hibernate</artifactId>
<version>2.15.0</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
</dependency>
</dependencies>
<repositories>
<repository>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>fuse-public-repository</id>
<name>FuseSource Community Release Repository</name>
<url>https://repo.fusesource.com/nexus/content/groups/public</url>
</repository>
<repository>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>red-hat-ga-repository</id>
<name>Red Hat GA Repository</name>
<url>https://maven.repository.redhat.com/ga</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>fuse-public-repository</id>
<name>FuseSource Community Release Repository</name>
<url>https://repo.fusesource.com/nexus/content/groups/public</url>
</pluginRepository>
<pluginRepository>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>red-hat-ga-repository</id>
<name>Red Hat GA Repository</name>
<url>https://maven.repository.redhat.com/ga</url>
</pluginRepository>
</pluginRepositories>
<build>
<defaultGoal>install</defaultGoal>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>${version.maven-bundle-plugin}</version>
<extensions>true</extensions>
<configuration>
<instructions>
<Bundle-SymbolicName>keyvalue</Bundle-SymbolicName>
<Bundle-Name>Empty Camel Blueprint Example [keyvalue]</Bundle-Name>
</instructions>
</configuration>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.0.1</version>
<configuration>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.camel</groupId>
<artifactId>camel-maven-plugin</artifactId>
<version>${camel.version}</version>
<configuration>
<useBlueprint>true</useBlueprint>
</configuration>
</plugin>
</plugins>
</build>
</project>
Remember one thing. org.springframework.orm.hibernate4.LocalSessionFactoryBean is Spring's factory bean which, when used as <bean> gives you a kind of indirection - instead of using the class as bean directly, getObject() is called and the returned object is your <bean>.
Another thing is that Spring automatically calls afterPropertiesSet() for all beans (or factory beans) that implement InitializingBean.
So instead of:
<bean class="org.springframework.orm.hibernate4.LocalSessionFactoryBean"
id="mysessionFactory">
use:
<bean id="mysessionFactory" factory-ref="mysessionFactoryFactory"
factory-method="getObject" />
<bean class="org.springframework.orm.hibernate4.LocalSessionFactoryBean"
id="mysessionFactoryFactory" init-method="afterPropertiesSet">
...
There are very less info on the web for log4j2 with XMLLayout.
I have not found any links with simple examples (log4j2 + XMLLayout);
Can somebody post a simple example of the same ....
with regards
Karthik
Here is a minimal sample application that demonstrates use of XmlLayout.
pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>test</groupId>
<artifactId>test-log4j2</artifactId>
<packaging>jar</packaging>
<version>0.0.1-SNAPSHOT</version>
<name>Test Log4J 2</name>
<description>Test Log4J 2</description>
<properties>
<jackson.version>2.5.0</jackson.version>
<log4j.version>2.5</log4j.version>
</properties>
<build>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<archive>
<manifest>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
<mainClass>Main</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<finalName>${project.artifactId}</finalName>
<appendAssemblyId>false</appendAssemblyId>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>${log4j.version}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>${log4j.version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-xml</artifactId>
<version>${jackson.version}</version>
</dependency>
</dependencies>
</project>
src/main/java/Main.java
import org.apache.logging.log4j.LogManager;
public class Main {
public static void main(String[] args) {
LogManager.getLogger(Main.class).info("This is a test.");
}
}
src/main/resources/log4j2.properties
status = ERROR
name = PropertiesConfig
rootLogger.level = INFO
rootLogger.appenderRefs = CONSOLE
rootLogger.appenderRef.CONSOLE.ref = CONSOLE
appenders = CONSOLE
appender.CONSOLE.type = Console
appender.CONSOLE.name = CONSOLE
appender.CONSOLE.layout.type = XmlLayout
appender.CONSOLE.layout.complete = true
appender.CONSOLE.layout.compact = true
Demo
> mvn clean package
> java -jar target/test-log4j2.jar
<?xml version="1.0" encoding="UTF-8"?><Events xmlns="http://logging.apache.org/log4j/2.0/events"><Event xmlns="" xmlns="http://logging.apache.org/log4j/2.0/events" timeMillis="1451539702378" thread="main" level="INFO" loggerName="Main" endOfBatch="false" loggerFqcn="org.apache.logging.log4j.spi.AbstractLogger"><Message>This is a test.</Message></Event></Events>
The trickiest part was figuring out the Jackson dependency required. Without that, Log4J 2 experiences internal ClassNotFoundException errors and fails to initialize XmlLayout.
If you prefer XML-based configuration, then here is the equivalent XML configuration.
log4j2.xml
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="error" name="XMLConfig">
<Loggers>
<Root level="INFO">
<AppenderRef ref="CONSOLE"/>
</Root>
</Loggers>
<Appenders>
<Console name="CONSOLE">
<XMLLayout complete="true" compact="true"/>
</Console>
</Appenders>
</Configuration>
Being new to Maven, I'm trying to make an executable jar of my webapp with an embedded jetty. Unfortunately, I'm having many difficulties achieving this, and decided to follow a step-by-step progression: first using jetty-maven-plugin (OK, with a lot of pain), then using jetty-runner (KO, the matter of this SO question), and finally using embedded jetty (KO).
I've spent so much time doing this, having different exceptions depending on the jetty version and pulled so much hair out, that I finally decided to ask the community for some help.
I hope this question won't be marked as a duplicate of SO #12241989 (or any other similar), because I have the same kind of problem, but clearly not the same root cause since I'm using the same version of jetty-maven-plugin and jetty-runner.
Context
webapp uses JSF2 (mojarra 2.2.8) + CDI (weld) + Primefaces + Websockets
Configuration
1. Jetty plugin
excerpt from pom.xml
<properties>
<endorsed.dir>${project.build.directory}/endorsed</endorsed.dir>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.7</java.version>
<jetty.groupId>org.eclipse.jetty</jetty.groupId>
<jetty.version>9.0.4.v20130625</jetty.version>
<jetty.descriptor>${project.basedir}/src/main/webapp/WEB-INF/web.xml</jetty.descriptor>
<jetty.env>${project.basedir}/src/main/webapp/WEB-INF/jetty-env.xml</jetty.env>
<jetty.contextPath>/</jetty.contextPath>
<jetty.overrideDescriptor>${project.basedir}/src/main/webapp/WEB-INF/jetty-web-override.xml</jetty.overrideDescriptor>
<myfaces.version>2.2.5</myfaces.version>
<mojarra.version>2.2.8</mojarra.version>
</properties>
...
<plugin>
<groupId>${jetty.groupId}</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>${jetty.version}</version>
<configuration>
<webApp>
<contextPath>${jetty.contextPath}</contextPath>
<descriptor>${jetty.descriptor}</descriptor>
<jettyEnvXml>${jetty.env}</jettyEnvXml>
<overrideDescriptor>${jetty.overrideDescriptor}</overrideDescriptor>
</webApp>
<contextXml>
${project.basedir}/src/main/webapp/WEB-INF/jetty-context.xml
</contextXml>
</configuration>
</plugin>
jetty-context.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
<Set name="serverClasses">
<Array type="java.lang.String">
<Item>
-org.eclipse.jetty.servlet.ServletContextHandler.Decorator
</Item>
</Array>
</Set>
</Configure>
jetty-env.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">
<Configure id="webAppCtx" class="org.eclipse.jetty.webapp.WebAppContext">
<New id="appManager" class="org.eclipse.jetty.plus.jndi.Resource">
<Arg>
<Ref id="webAppCtx" />
</Arg>
<Arg>BeanManager</Arg>
<Arg>
<New class="javax.naming.Reference">
<Arg>javax.enterprise.inject.spi.BeanManager</Arg>
<Arg>org.jboss.weld.resources.ManagerObjectFactory</Arg>
<Arg />
</New>
</Arg>
</New>
</Configure>
jetty-web-override.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
version="3.0">
<!-- CDI-->
<listener>
<listener-class>org.jboss.weld.environment.servlet.Listener</listener-class>
</listener>
<resource-env-ref>
<resource-env-ref-name>BeanManager</resource-env-ref-name>
<resource-env-ref-type>javax.enterprise.inject.spi.BeanManager</resource-env-ref-type>
</resource-env-ref>
<!-- mojarra -->
<listener>
<listener-class>com.sun.faces.config.ConfigureListener</listener-class>
</listener>
With this configuration, the application runs correctly. sigh of relief
2. Jetty runner
I believe the easiest way to reproduce the above configuration with jetty runner is using a jetty context xml file that describes my webapp. So I ended up with the following context file :
context.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_0.dtd">
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
<Set name="contextPath">/</Set>
<Set name="war">target/myapp.war</Set>
<Set name="descriptor">src/main/webapp/WEB-INF/web.xml</Set>
<Set name="overrideDescriptor">src/main/webapp/WEB-INF/jetty-web-override.xml</Set>
<Set name="serverClasses">
<Array type="java.lang.String">
<Item>
-org.eclipse.jetty.servlet.ServletContextHandler.Decorator
</Item>
</Array>
</Set>
<New id="appManager" class="org.eclipse.jetty.plus.jndi.Resource">
<Arg>BeanManager</Arg>
<Arg>
<New class="javax.naming.Reference">
<Arg>javax.enterprise.inject.spi.BeanManager</Arg>
<Arg>org.jboss.weld.resources.ManagerObjectFactory</Arg>
<Arg />
</New>
</Arg>
</New>
</Configure>
Then when I run the jetty runner (with the same version):
java -jar jetty-runner-9.0.4.v20130625.jar context.xml
...everything seems OK, except the (annoying) fact that the startup listener of my app (annotated with Servlet 3.0 #WebListener) does not start.
And if I try to navigate to http://localhost:8080/, I get the following stack trace:
HTTP ERROR 500
Problem accessing /. Reason:
Server Error
Caused by:
javax.faces.view.facelets.TagAttributeException: /index.xhtml #119,66 src="/WEB-INF/include/#{applicationManager.layout}.xhtml" /index.xhtml #119,66 src="/WEB-INF/include/#{appli
cationManager.layout}.xhtml": java.lang.NullPointerException
at com.sun.faces.facelets.tag.TagAttributeImpl.getObject(TagAttributeImpl.java:358)
at com.sun.faces.facelets.tag.TagAttributeImpl.getValue(TagAttributeImpl.java:322)
at com.sun.faces.facelets.tag.ui.IncludeHandler.apply(IncludeHandler.java:112)
at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:137)
at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:203)
at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120)
at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:137)
at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:203)
at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120)
at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:95)
at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:137)
at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:203)
at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120)
at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:95)
at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:137)
at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:203)
at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120)
at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:95)
at com.sun.faces.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:93)
at com.sun.faces.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:87)
at com.sun.faces.facelets.impl.DefaultFacelet.apply(DefaultFacelet.java:161)
at com.sun.faces.application.view.FaceletViewHandlingStrategy.buildView(FaceletViewHandlingStrategy.java:990)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:99)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:219)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:647)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:698)
...
Caused by: javax.el.ELException: /index.xhtml #119,66 src="/WEB-INF/include/#{applicationManager.layout}.xhtml": java.lang.NullPointerException
at com.sun.faces.facelets.el.TagValueExpression.getValue(TagValueExpression.java:114)
at com.sun.faces.facelets.tag.TagAttributeImpl.getObject(TagAttributeImpl.java:356)
... 60 more
Caused by: javax.el.ELException: java.lang.NullPointerException
at javax.el.BeanELResolver.getValue(BeanELResolver.java:368)
If I try to enforce the listening of my StartupListener class by specifying in web.xml:
<listener>
<listener-class>fr.mygroup.myapp.listeners.StartupListener</listener-class>
</listener>
...I get the same error.
Anyway, the fact that my StartupListener is not listened is clearly not the cause of the error but a consequence. But I can't figure out what's wrong with my jetty-runner configuration.
I desperately feel like it's a long way to go to an executable überjar of my webapp :(
Appendix
pom.xml
<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>fr.mygroupid</groupId>
<artifactId>myapp</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<properties>
<endorsed.dir>${project.build.directory}/endorsed</endorsed.dir>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.7</java.version>
<jetty.groupId>org.eclipse.jetty</jetty.groupId>
<jetty.version>9.0.4.v20130625</jetty.version>
<jetty.descriptor>${project.basedir}/src/main/webapp/WEB-INF/web.xml</jetty.descriptor>
<jetty.env>${project.basedir}/src/main/webapp/WEB-INF/jetty-env.xml</jetty.env>
<jetty.contextPath>/</jetty.contextPath>
<jetty.overrideDescriptor>${project.basedir}/src/main/webapp/WEB-INF/jetty-web-override.xml</jetty.overrideDescriptor>
<myfaces.version>2.2.5</myfaces.version>
<mojarra.version>2.2.8</mojarra.version>
</properties>
<build>
<plugins>
<plugin>
<groupId>${jetty.groupId}</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>${jetty.version}</version>
<configuration>
<webApp>
<contextPath>${jetty.contextPath}</contextPath>
<descriptor>${jetty.descriptor}</descriptor>
<jettyEnvXml>${jetty.env}</jettyEnvXml>
<overrideDescriptor>${jetty.overrideDescriptor}</overrideDescriptor>
</webApp>
<contextXml>
${project.basedir}/src/main/webapp/WEB-INF/jetty-context.xml
</contextXml>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
<compilerArguments>
<endorseddirs>${endorsed.dir}</endorseddirs>
</compilerArguments>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.3</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
</plugins>
<finalName>${project.artifactId}</finalName>
</build>
<repositories>
<repository>
<id>ebi-repo</id>
<name>The EBI internal repository</name>
<url>http://www.ebi.ac.uk/~maven/m2repo</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>prime-repo</id>
<name>PrimeFaces Maven Repository</name>
<url>http://repository.primefaces.org</url>
<layout>default</layout>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-api</artifactId>
<version>${mojarra.version}</version>
<scope>compile</scope>
<type>jar</type>
</dependency>
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-impl</artifactId>
<version>${mojarra.version}</version>
<scope>compile</scope>
<type>jar</type>
</dependency>
<dependency>
<groupId>org.jboss.weld.servlet</groupId>
<artifactId>weld-servlet</artifactId>
<version>2.1.2.Final</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>jsr250-api</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
</dependency>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-web-api</artifactId>
<version>6.0</version>
<scope>provided</scope>
</dependency>
<!-- Primefaces 5.1 -->
<dependency>
<groupId>org.primefaces</groupId>
<artifactId>primefaces</artifactId>
<version>5.1</version>
</dependency>
<!-- Primefaces Themes -->
<dependency>
<groupId>org.primefaces.themes</groupId>
<artifactId>all-themes</artifactId>
<version>1.0.10</version>
</dependency>
<!-- Biomodels API -->
<dependency>
<groupId>uk.ac.ebi.biomodels</groupId>
<artifactId>biomodels-wslib</artifactId>
<version>1.21</version>
</dependency>
<!-- Ganymed SSH -->
<dependency>
<groupId>ch.ethz.ganymed</groupId>
<artifactId>ganymed-ssh2</artifactId>
<version>262</version>
</dependency>
<!-- Atmosphere -->
<dependency>
<groupId>org.atmosphere</groupId>
<artifactId>atmosphere-runtime</artifactId>
<version>2.2.3</version>
</dependency>
<!-- Logback -->
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.1.2</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
<version>1.1.2</version>
</dependency>
<!-- slf4j -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.7</version>
</dependency>
<!-- GSON -->
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.2.4</version>
</dependency>
<!-- Apache commons -->
<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
<version>1.9.2</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.3.2</version>
</dependency>
</dependencies>
</project>
At the moment I am trying to get my ReportNG reports to generate in the "site" under the Project Reports section.
The ReportNG folder is made and the index.html with the file is produced in my directory on my computer and the tests run and output the correct results.
I just want to create ReportNG reports under the Project Reports section.
For reference, I just started using Maven as a part of my job last week.
Please let me know what anything that I can do to fix this whether it is to get a new plugin, or a new dependency or what I need to edit.
Also if you know of any resources for understanding Maven I would highly appreciate it.
<?xml version="1.0" encoding="UTF-8"?>
<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.Test.app</groupId>
<artifactId>mavenTestNG</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<dependencies>
<!-- tag::joda[] -->
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>2.2</version>
</dependency>
<!-- end::joda[] -->
<dependency>
<groupId>org.uncommons</groupId>
<artifactId>reportng</artifactId>
<version>1.1.2</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- tag::junit[] -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<!-- end::junit[] -->
<!-- tag::spring[] -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>4.0.6.RELEASE</version>
</dependency>
<!-- end::spring[] -->
<!-- tag::testng[] -->
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.8.7</version>
<scope>test</scope>
</dependency>
<!-- end::testng[] -->
<dependency>
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>
<version>3.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>velocity</groupId>
<artifactId>velocity</artifactId>
<version>1.4</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<properties>
<property>
<name>usedefaultlisteners</name>
<value>true</value>
</property>
<property>
<name>listener</name>
<value>org.uncommons.reportng.HTMLReporter, org.uncommons.reportng.JUnitXMLReporter</value>
</property>
</properties>
<workingDirectory>target/</workingDirectory>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<transformers>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>com.Test.app.HelloWorld</mainClass>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-report-plugin</artifactId>
<version>2.6</version>
<configuration>
<properties>
<property>
<name>usedefaultlisteners</name>
<value>true</value>
</property>
<property>
<name>listener</name>
<value>org.uncommons.reportng.HTMLReporter, org.uncommons.reportng.JUnitXMLReporter</value>
</property>
</properties>
<workingDirectory>target/</workingDirectory>
</configuration>
</plugin>
</plugins>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.6</version>
<configuration>
<!-- You can specify a specific testng.xml file here <suiteXmlFiles>
<suiteXmlFile>src/test/resources/testng-sample.xml</suiteXmlFile> </suiteXmlFiles> -->
<!-- Or dynamically with something like '-DsuiteXmlFile=src/test/resources/testng-sample.xml' -->
<suiteXmlFiles>
<suiteXmlFile>${suiteXmlFile}</suiteXmlFile>
</suiteXmlFiles>
<!-- Build with '-DskipTests=true' to bypass test execution # build
time Default: false -->
<skipTests>${skipTests}</skipTests>
<testFailureIgnore>true</testFailureIgnore>
</configuration>
</plugin>