How to add jar libraries to Wildfly server in lib and lib/ext directories? - jar

I am trying to minimize my myapp.ear file to moving some libs to the server wildfly 10, but the easy only way I found was by including in standalone.xml deployments section, like the following example.
<deployments>
<deployment name="mysql-connector-java-5.0.8-bin.jar" runtime-name="mysql-connector-java-5.0.8-bin.jar">
<content sha1="7b9bfb6c4e4885660378a9c13330915c321f6cca"/>
</deployment>
</deployments>
and I could use the libraries on maven as the example
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>
Is there a easy way to add and load the libraries in ../lib or ../lib/ext?

Create a module.xml file like his for your driver :
<module xmlns="urn:jboss:module:1.5" name="com.mysql">
<resources>
<resource-root path="mysql-connector-java-5.0.8-bin.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.transaction.api"/>
</dependencies>
Execute :
.
/jboss-cli.sh -c --command="module add --module-xml=<path-to-file>/module.xml --resources=<path-to-file>/mysql-connector-java-5.0.8-bin.jar"

To define a new module in wildfly 10 we can use jboss-cli.sh among others.
Create module dependency
../wildflly/bin$ ./jboss-cli
[standalone#localhost:9990 /] module add
--name=org.mysql
--resources=<path-res>/mysql-connector-java-5.1.45-bin.jar
--dependencies=javax.api,javax.transaction.api
I used as < path-res > ../standalone/lib
Create datasource driver
[standalone#localhost:9990 /]/subsystem=datasources/jdbc-driver=
mysql:add(driver-module-name=org.mysql,
driver-name=mysql,
driver-class-name=com.mysql.jdbc.Driver)
Create database source (as example with default mysql port)
[standalone#localhost:9990 /] /subsystem=datasources/data-source=
MySQLDS:add(jndi-name=java:jboss/datasources/MySQLDS,
driver-name=mysql,
connection-url=jdbc:mysql://localhost:3306/schema,
user-name=root,
password=pass)

Related

jlink showing error while comparing hashes

I am currently trying to bundle a javaFx test application via maven and jlink into a runtime image. I am using bellsoft liberica 18.0.1 as a jdk and I am running on a IntelliJ IDE. I have used the IDE to setup the project initially (via the wizzard). If I hit javafx:run, everything fires up correctly, the application is displayed and all is fine.
However, running javafx:jlink produces the following error:
Error: Hash of javafx.base
(d775513043c11c457939b41e544cc7a83a4076454da4a0798bdc6922ec7d3f8f)
differs to expected hash
(eb1d4f72b292e9bf33005b36c4afeda11b66a8745b868bf0593d1cd4c2974681)
recorded in java.base java.lang.module.FindException: Hash of
javafx.base
(d775513043c11c457939b41e544cc7a83a4076454da4a0798bdc6922ec7d3f8f)
differs to expected hash
(eb1d4f72b292e9bf33005b36c4afeda11b66a8745b868bf0593d1cd4c2974681)
recorded in java.base
This appears odd, as I am unsure which hashes are compared at that point. I have tried executing jlink with --fail-never as well as --lax-checksums and ignoreSigningInformation, but nothing appears to help. I have also tried to check the sha-checksums from within my m2-Repository, but I can't nail it down that way either.
Any help to sort this out is much appreciated.
EDIT: Including the current 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 https://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion>
<groupId>com.test</groupId>
<artifactId>myapp</artifactId>
<version>1.0-SNAPSHOT</version>
<name>myappMavenModulebased</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<junit.version>5.9.1</junit.version>
</properties>
<dependencies>
<!-- https://mvnrepository.com/artifact/org.openjfx/javafx-base -->
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-base</artifactId>
<version>19</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-controls</artifactId>
<version>19</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-fxml</artifactId>
<version>19</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-web</artifactId>
<version>19</version>
</dependency>
<dependency>
<groupId>org.controlsfx</groupId>
<artifactId>controlsfx</artifactId>
<version>11.1.2</version>
</dependency>
<dependency>
<groupId>com.dlsc.formsfx</groupId>
<artifactId>formsfx-core</artifactId>
<version>11.5.0</version>
<exclusions>
<exclusion>
<groupId>org.openjfx</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>net.synedra</groupId>
<artifactId>validatorfx</artifactId>
<version>0.3.1</version>
<exclusions>
<exclusion>
<groupId>org.openjfx</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.kordamp.ikonli</groupId>
<artifactId>ikonli-javafx</artifactId>
<version>12.3.1</version>
</dependency>
<dependency>
<groupId>org.kordamp.bootstrapfx</groupId>
<artifactId>bootstrapfx-core</artifactId>
<version>0.4.0</version>
</dependency>
<dependency>
<groupId>eu.hansolo</groupId>
<artifactId>medusa</artifactId>
<version>16.0.1</version>
<exclusions>
<exclusion>
<groupId>org.openjfx</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<!-- Build an executable JAR -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<classpathPrefix>lib/</classpathPrefix>
<mainClass>com.test.myapp.AppLauncher</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.10.1</version>
<configuration>
<source>18</source>
<target>18</target>
</configuration>
</plugin>
<plugin>
<groupId>org.openjfx</groupId>
<artifactId>javafx-maven-plugin</artifactId>
<version>0.0.8</version>
<executions>
<execution>
<!-- Default configuration for running with: mvn clean javafx:run -->
<id>default-cli</id>
<configuration>
<mainClass>com.test.myapp/com.test.myapp.HelloApplication</mainClass>
<launcher>app</launcher>
<jlinkZipName>app</jlinkZipName>
<jlinkImageName>app</jlinkImageName>
<noManPages>true</noManPages>
<stripDebug>true</stripDebug>
<noHeaderFiles>true</noHeaderFiles>
<failNever>true</failNever>
<ignoreSigningInformation>true</ignoreSigningInformation>
<jlinkExecutable>/home/user/.jdks/bellsoft-jdk19.0.1/bin/jlink</jlinkExecutable>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
EDIT 2: I am providing the jlink-Tool in the pom.xml. My idea was that doing it this way, jlink would be able to create the runtime image based on the liberica-jdk. Is the problem that I am using openjfx-dependencies with the liberica-jlink-Tool?
What the problem is
The module hash mismatch when using jlink occurs because:
You use Liberica "Full JDK" which includes pre-built JavaFX modules in a jmod format AND
You also define JavaFX dependencies in your Maven project based on JavaFX modules in jar format.
This confuses the linker, resulting in the mismatched hash error.
The linker knows there are two copies of the same module with the same module version available on the module path, but they have different hashes, so it errors and exits.
It would be more useful if the error told you exactly where the two modules with differing hashes were found (you could create an enhancement request with the jlink tool in the JDK for that, referencing this post, if you wanted).
How to fix this
You can fix this by either:
Use a JDK distribution that does not include pre-built JavaFX modules (e.g. a standard OpenJDK download or a Liberica "Standard JDK" version) OR
Remove the JavaFX dependencies from your pom.xml file.
Getting some link debug info
To debug, in the pom.xml file configuration for the javafx-maven-plugin, add:
<jlinkVerbose>true</jlinkVerbose>
This will tell you where jlink sourced the modules from (when jlink works).
You can also run maven in debug mode (--debug command line switch for mvn). Maven will tell you a lot more information. For example, the actual full command line and option set used to invoke jlink.
Here is a debug line for linking using OpenJDK using maven jar dependencies for the JavaFX modules:
[DEBUG] Executing command line: [/Users/myusername/Library/Java/JavaVirtualMachines/openjdk-19.0.1/Contents/Home/bin/jlink, --module-path, /Users/myusername/dev/linktest/target/classes:/Users/myusername/.m2/repository/org/openjfx/javafx-base/19/javafx-base-19-mac.jar:/Users/myusername/.m2/repository/org/openjfx/javafx-controls/19/javafx-controls-19-mac.jar:/Users/myusername/.m2/repository/org/openjfx/javafx-fxml/19/javafx-fxml-19-mac.jar:/Users/myusername/.m2/repository/org/openjfx/javafx-graphics/19/javafx-graphics-19-mac.jar, --add-modules, com.example.linktest, --output, /Users/myusername/dev/linktest/target/app, --strip-debug, --compress, 0, --no-header-files, --no-man-pages, --verbose, --launcher, app=com.example.linktest/com.example.linktest.HelloApplication]
The command line text can be useful because you can copy it and link from the command line prompt rather than from within Maven (just for testing and verification purposes).
Linking using liberica "Full JDK" which includes JavaFX jmods
For your pom.xml with these changes:
jlinkExecutable in the javafx-maven-plugin configuration set to the jlink in my liberica location.
I don't think this is necessary if the JAVA_HOME environment variable is properly configured to match the liberica distribution and the mvn tool is invoked using the liberica distribution.
jlinkVerbose in the javafx-maven-plugin configuration set to true.
all JavaFX dependencies commented out.
project module and package name changed to com.example.linktest.
I just did that because that is what I used to create the project, as long as the name is consistent everywhere, it doesn't matter what it is.
And a minimal module-info.java to generate a basic JavaFX FXML application added. The linker will output:
[INFO] --- javafx-maven-plugin:0.0.8:jlink (default-cli) # myapp ---
com.example.linktest file:///Users/myusername/dev/linktest/target/classes/
java.base file:///Users/myusername/Library/Java/JavaVirtualMachines/liberica-19.0.1/jmods/java.base.jmod
java.datatransfer file:///Users/myusername/Library/Java/JavaVirtualMachines/liberica-19.0.1/jmods/java.datatransfer.jmod
java.desktop file:///Users/myusername/Library/Java/JavaVirtualMachines/liberica-19.0.1/jmods/java.desktop.jmod
java.prefs file:///Users/myusername/Library/Java/JavaVirtualMachines/liberica-19.0.1/jmods/java.prefs.jmod
java.scripting file:///Users/myusername/Library/Java/JavaVirtualMachines/liberica-19.0.1/jmods/java.scripting.jmod
java.xml file:///Users/myusername/Library/Java/JavaVirtualMachines/liberica-19.0.1/jmods/java.xml.jmod
javafx.base file:///Users/myusername/Library/Java/JavaVirtualMachines/liberica-19.0.1/jmods/javafx.base.jmod
javafx.controls file:///Users/myusername/Library/Java/JavaVirtualMachines/liberica-19.0.1/jmods/javafx.controls.jmod
javafx.fxml file:///Users/myusername/Library/Java/JavaVirtualMachines/liberica-19.0.1/jmods/javafx.fxml.jmod
javafx.graphics file:///Users/myusername/Library/Java/JavaVirtualMachines/liberica-19.0.1/jmods/javafx.graphics.jmod
jdk.unsupported file:///Users/myusername/Library/Java/JavaVirtualMachines/liberica-19.0.1/jmods/jdk.unsupported.jmod
All of the JavaFX dependencies are sourced from the liberica provided jmods, such as this:
liberica-19.0.1/jmods/javafx.base.jmod
Linking using OpenJDK and JavaFX maven jars
If instead you use a standard OpenJDK without pre-built JavaFX modules and JavaFX modules added as dependencies in the pom.xml, then the output is:
[INFO] --- javafx-maven-plugin:0.0.8:jlink (default-cli) # myapp ---
com.example.linktest file:///Users/myusername/dev/linktest/target/classes/
java.base file:///Users/myusername/Library/Java/JavaVirtualMachines/openjdk-19.0.1/Contents/Home/jmods/java.base.jmod
java.datatransfer file:///Users/myusername/Library/Java/JavaVirtualMachines/openjdk-19.0.1/Contents/Home/jmods/java.datatransfer.jmod
java.desktop file:///Users/myusername/Library/Java/JavaVirtualMachines/openjdk-19.0.1/Contents/Home/jmods/java.desktop.jmod
java.prefs file:///Users/myusername/Library/Java/JavaVirtualMachines/openjdk-19.0.1/Contents/Home/jmods/java.prefs.jmod
java.scripting file:///Users/myusername/Library/Java/JavaVirtualMachines/openjdk-19.0.1/Contents/Home/jmods/java.scripting.jmod
java.xml file:///Users/myusername/Library/Java/JavaVirtualMachines/openjdk-19.0.1/Contents/Home/jmods/java.xml.jmod
javafx.base file:///Users/myusername/.m2/repository/org/openjfx/javafx-base/19/javafx-base-19-mac.jar
javafx.controls file:///Users/myusername/.m2/repository/org/openjfx/javafx-controls/19/javafx-controls-19-mac.jar
javafx.fxml file:///Users/myusername/.m2/repository/org/openjfx/javafx-fxml/19/javafx-fxml-19-mac.jar
javafx.graphics file:///Users/myusername/.m2/repository/org/openjfx/javafx-graphics/19/javafx-graphics-19-mac.jar
jdk.unsupported file:///Users/myusername/Library/Java/JavaVirtualMachines/openjdk-19.0.1/Contents/Home/jmods/jdk.unsupported.jmod
The javafx modules are sourced as jars out of the .m2 repository rather than coming as mods from the JDK:
.m2/repository/org/openjfx/javafx-base/19/javafx-base-19-mac.jar
Either way, you end up with a packaged, linked, usable JavaFX application.

How do I get Alfresco to use the alfresco-simple-content-stores plugin?

I've been trying to include the alfresco-simple-content-stores library (https://github.com/Acosix/alfresco-simple-content-stores) with Alfresco Community Edition, and it doesn't appear to be working. I've followed the documentation as best as I can, but I think I must be missing a step because my configuration appears to be completely ignored and there is no indication that it is running. I've done the following:
First, following this documentation (https://docs.alfresco.com/community/tasks/amp-install.html) I tried installing the amp using Alfresco mmt. That failed with the following message:
10250001 An error was encountered during deployment of the AMP into the WAR: 10250000 The following modules must first be installed: [acosix-utility-core:1.0.3.1-*]
However, no such artifact seems to exist.
As I couldn't get past that speed bump, I went down the following path:
I generated a keystore and a master key, referenced below in step 4
I included the following dependency in my alfresco/war/pom.xml (1.0.1.TEST is my locally compiled version of alfresco-simple-content-stores)
<dependency>
<groupId>de.acosix.alfresco.simplecontentstores</groupId>
<artifactId>de.acosix.alfresco.simplecontentstores.repo</artifactId>
<version>1.0.1.TEST</version>
<type>amp</type>
</dependency>
I copied the artifact to the Tomcat directory in my Dockerfile
COPY ./war/target/de.acosix.alfresco.simplecontentstores.repo-1.0.1.TEST.amp ${TOMCAT_DIR}/amps
I defined the following properties in my alfresco-global.properties
simpleContentStores.enabled=true
simpleContentStores.customStores=myEncryptingStore,defaultTenantFileContentStore
simpleContentStores.rootStore=myEncryptingStore
simpleContentStores.customStore.myEncryptingStore.type=encryptingFacadeStore
simpleContentStores.customStore.myEncryptingStore.ref.backingStore=defaultTenantFileContentStore
simpleContentStores.customStore.myEncryptingStore.value.keyStorePath=classpath:../keystore/keystore.jks
simpleContentStores.customStore.myEncryptingStore.value.keyStorePassword=masterkeystore
simpleContentStores.customStore.myEncryptingStore.value.masterKeyAlias=ssl
simpleContentStores.customStore.myEncryptingStore.value.masterKeyPassword=alfkeystore
simpleContentStores.customStore.myEncryptingStore.value.masterKeyStoreId=alfkeystore
Despite all of this, files continue to be stored unencrypted and I see no indication that anything has failed. I doubt that this library would fail silently, so I'm left to assume that I've missed some step required to make Alfresco use this plugin.
Any ideas?
Edit:
In response to a comment, here is the abbreviated pom of my alfresco/war project:
<dependencies>
...
<dependency>
<groupId>de.acosix.alfresco.utility</groupId>
<artifactId>de.acosix.alfresco.utility.share</artifactId>
<version>1.0.2.1</version>
<type>amp</type>
</dependency>
<dependency>
<groupId>de.acosix.alfresco.utility</groupId>
<artifactId>de.acosix.alfresco.utility.repo</artifactId>
<version>1.0.2.1</version>
<type>amp</type>
</dependency>
<dependency>
<groupId>de.acosix.alfresco.simplecontentstores</groupId>
<artifactId>de.acosix.alfresco.simplecontentstores.repo</artifactId>
<version>1.0.1.PST</version>
<type>amp</type>
</dependency>
...
</dependencies>
<build>
...
<plugins>
...
<plugin>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<overlays>
<overlay />
<overlay>
<groupId>${alfresco.groupId}</groupId>
<artifactId>${alfresco.share.artifactId}</artifactId>
<type>war</type>
<excludes />
</overlay>
<!-- other AMPs -->
<overlay>
<groupId>de.acosix.alfresco.utility</groupId>
<artifactId>de.acosix.alfresco.utility.repo</artifactId>
<type>amp</type>
</overlay>
<overlay>
<groupId>de.acosix.alfresco.utility</groupId>
<artifactId>de.acosix.alfresco.utility.share</artifactId>
<type>amp</type>
</overlay>
<overlay>
<groupId>de.acosix.alfresco.simplecontentstores</groupId>
<artifactId>de.acosix.alfresco.simplecontentstores.repo</artifactId>
<type>amp</type>
</overlay>
</overlays>
</configuration>
</plugin>
...
</plugins>
...
</build>
Now with that pom configuration, the maven install output shows as follows (shortened to hide irrelevant path information):
[INFO] Processing overlay [ id de.acosix.alfresco.utility:de.acosix.alfresco.utility.repo]
[WARNING] Skip unpacking dependency file [.../.m2/repository/de/acosix/alfresco/utility/de.acosix.alfresco.utility.repo/1.0.2.1/de.acosix.alfresco.utility.repo-1.0.2.1.amp with unknown extension [amp]
[INFO] Processing overlay [ id de.acosix.alfresco.utility:de.acosix.alfresco.utility.share]
[WARNING] Skip unpacking dependency file [.../.m2/repository/de/acosix/alfresco/utility/de.acosix.alfresco.utility.share/1.0.2.1/de.acosix.alfresco.utility.share-1.0.2.1.amp with unknown extension [amp]
[INFO] Processing overlay [ id de.acosix.alfresco.simplecontentstores:de.acosix.alfresco.simplecontentstores.repo]
[WARNING] Skip unpacking dependency file [.../.m2/repository/de/acosix/alfresco/simplecontentstores/de.acosix.alfresco.simplecontentstores.repo/1.0.1.PST/de.acosix.alfresco.simplecontentstores.repo-1.0.1.PST.amp with unknown extension [amp]

class file for javax.servlet.ServletException not found [duplicate]

I'm trying to include Spring Security to my web project, i'm following this tutorial http://docs.spring.io/spring-security/site/docs/current/guides/html5//helloworld.html
I've done everything in the tutorial with the given maven project and works fine. But when i'm trying to include it to my project a compilation error appear. Specifically when i extends from AbstractSecurityWebApplicationInitializer appear the given error
Multiple markers at this line
The type javax.servlet.ServletContext cannot be resolved. It is indirectly referenced from required .class files
The type javax.servlet.ServletException cannot be resolved. It is indirectly referenced from required .class files
The 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>spring.primefaces</groupId>
<artifactId>primefaces.testwebapp</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<name>SpringPrimefacesWebApp</name>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.3</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<!-- JSF 2.2 core and implementation -->
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-api</artifactId>
<version>2.2.11</version>
</dependency>
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-impl</artifactId>
<version>2.2.11</version>
</dependency>
<!-- Prime Faces -->
<dependency>
<groupId>org.primefaces</groupId>
<artifactId>primefaces</artifactId>
<version>5.2</version>
</dependency>
<!-- Spring security -->
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-web</artifactId>
<version>4.0.1.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-config</artifactId>
<version>4.0.1.RELEASE</version>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-framework-bom</artifactId>
<version>4.1.6.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
Thanks for the help!
Using mvn clean install -U
Just add the javax.servlet API to the compile time dependencies. You don't need to include it in the build, it's already provided by the target servlet container.
Your current pom suggests that you're deploying to a barebones servlet container (Tomcat, Jetty, etc) instead of a full fledged Java EE application server (WildFly, TomEE, GlassFish, Liberty, etc), otherwise you'd have run into classloading-related trouble by providing JSF along with the webapp instead of using the container-provided one.
In that case, adding the below dependency should do for a Servlet 3.1 container like Tomcat 8:
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
<scope>provided</scope>
</dependency>
Or if you're actually targeting an older Servlet 3.0 container like Tomcat 7, change the <version> to 3.0.1 (note: there's no 3.0 due to a mistake on their side).
If you happen to actually deploy to a Java EE 7 application server like WildFly 8, use the below dependency instead. It covers the entire Java EE API, including javax.servlet (and javax.faces, so you'd then remove those individual JSF API/impl dependencies):
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>7.0</version>
<scope>provided</scope>
</dependency>
Also here, if you're targeting an older Java EE 6 application server like JBoss AS 7, change the <version> to 6.0.
See also:
How to properly configure Jakarta EE libraries in Maven pom.xml for Tomcat?
This worked for me: if above supplied solution doesnt work
Project > Properties > Java Build Path > Libraries > Add library from library tab > Choose server runtime > Next > choose Apache Tomcat v 7.0> Finish > Ok
another way if you working on eclipse ide please open the project folder select Properties and click maven shows the view 'Active Maven Profiles(comma separated)'please input "dev"..after refresh problem solved
try setting the updated parent, like this:
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.3.6.RELEASE</version>
<relativePath></relativePath>
</parent>
this solved for me.
What helped for me was deleting the repository in directory .m2
and after deleting run maven: package

How to build flex resource module in flexmojos4.x

I use flexmojos plugin to manage my flex app. At first, I use flexmojos3.8, the following is fragment to create seperate resource module. If my app support en_US, zh_Ch, I can get MainApp_en_US.swf and MainApp_zh_CN.swf. In my app, I can load proper resource module according to browser's language.
<plugin>
<groupId>org.sonatype.flexmojos</groupId>
<artifactId>flexmojos-maven-plugin</artifactId>
<dependencies>
<dependency>
<groupId>com.adobe.flex</groupId>
<artifactId>compiler</artifactId>
<version>${flex.sdk.version}</version>
<type>pom</type>
</dependency>
</dependencies>
<configuration>
<sourceFile>MainApp.mxml</sourceFile>
<resourceBundlePath>
src/main/flex/locale/{locale}
</resourceBundlePath>
<runtimeLocales>${locales}</runtimeLocales>
<mergeResourceBundle>false</mergeResourceBundle>
<runtimeLocaleOutputPath>
/{contextRoot}/MainApp_{locale}.{extension}
</runtimeLocaleOutputPath>
<rslUrls>
<url>/{contextRoot}/rsl/{artifactId}.{extension}</url>
</rslUrls>
</configuration>
</plugin>
But when I upgrade flexmojos 4.0-RC2, I find the changes are big. The config changes to
.....
MainApp.mxml
src/main/flex/locale/{locale}
<localesRuntime>
<locale>en_US</locale>
<locale>fr_FR</locale>
<locale>zh_CN</locale>
</localesRuntime>
//Output resource module to current pathe (/target)
<localesOutputPath>
/
</localesOutputPath>
//Define your resource moudle name pattern
<resourceBundleNames>
MainApp_{locale}
</resourceBundleNames>
.....
</configuration>
It works after lots of trying. The last config like above.

Can you use a SWF as a dependency for a Flex Mojos Maven build

I have a maven project with flex-mojos 3.1.0. Can I have a module with swf packaging and configure a dependency on it in another module? When I do, I get a compilation error.
project
| - module1:swf
| - module2:swf
module2/pom.xml:
<parent>
<groupId>com.mygroup</groupId>
<artifactId>project</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<dependencies>
<dependency>
<groupId>com.mygroup</groupId>
<artifactId>module1</artifactId>
<version>1.0-SNAPSHOT</version>
<type>swf</type>
</dependency>
</dependencies>
Seems to be impossible
If you need module-to-module dependency to ensure correct build order for your modules then you can simply create a parent pom for both modules and arange build order in it.

Resources