Birt viewer to a Maven project for birt 4.3.1 - maven

Hi Iam new to birt and maven .Could any one help me how to convert a birt viewer as a maven project which needs be deployed in weblogic.Any suggestion or tutorial links will be a great help.
Thanks in Advance.

Create with this folder structure and create xml file named pom.xml .
Download the Birt runtime and you can find a birtviewer example (WebViewerExample).
.WebViewerExample(Root Folder)
.src
.main
.webapp
.WEB-INF
.lib
.web.xml
..(other files)
.new_report_1.rptdesign
...(other files)
.pom.xml
.target
.weblogic-maven-plugin.jar
Download BirtReportFramework and copy the jar files having names with 'org.eclipse.birt.report.data.oda' from birt-report-framework-4_3_1\eclipse\plugins to WebViewerExample\src\main\webapp\WEB-INF\lib
In command prompt got to Root folder here 'WebViewerExample' and run mvn clean install.
If you get maven error for missing or unable to download any jar files .No worries..you google the jar location in the maven website and download the jar manually and real trick is placing the jar at correct place inside your maven repository.
For Example if the error is like "[ERROR] Failed to execute goal org.apache.maven.plugins:maven-eclipse-plugin:2.9:eclipse"
Go to Maven repository whose path is like .m2\repository\org\apache\maven\plugins\maven-eclipse-plugin\2.9
Inside 2.9 folder place the maven-eclipse-plugin-2.9.jar and maven-eclipse-plugin-2.9.pom.
Also try to download and place the dependent jar and pom if the maven not get for you due to some problem..
My 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.webviewer</groupId>
<artifactId>WebViewerExample</artifactId>
<packaging>pom</packaging>
<name>Birt Viewer Maven Project</name>
<version>0.0.1-SNAPSHOT</version>
<properties>
<jdk.version>1.6</jdk.version>
<logback.version>1.0.13</logback.version>
<junit.version>4.10</junit.version>
<spring.version>3.0.5.RELEASE</spring.version>
</properties>
<repositories>
<repository>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>daily</updatePolicy>
<checksumPolicy>ignore</checksumPolicy>
</snapshots>
<id>sonatype-nexus-snapshots</id>
<name>Sonatype Nexus Snapshots</name>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</repository>
<repository>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
<updatePolicy>daily</updatePolicy>
<checksumPolicy>ignore</checksumPolicy>
</snapshots>
<id>sonatype-nexus-releases</id>
<name>Sonatype Nexus Snapshots</name>
<url>https://oss.sonatype.org/content/repositories/releases</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.eclipse.birt.runtime</groupId>
<artifactId>org.eclipse.birt.runtime</artifactId>
<version>4.3.1.v20130918-1142</version>
<!--<version>4.3.1</version> -->
</dependency>
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>1.0</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<!-- <packagingIncludes>/*.rptdesign</packagingIncludes>
<packagingIncludes>/*.jsp</packagingIncludes>
-->
<packagingExcludes>WEB-INF/lib/org.apache.xerces-2.9.0.jar</packagingExcludes>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.0</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>tomcat-maven-plugin</artifactId>
<version>1.1</version>
<configuration>
<url>http://localhost:8080/manager/text</url>
<server>Apache_Tomcat_7_x86</server>
<path>/birtviewer</path>
</configuration>
</plugin>
</plugins>
</build>
Thanks,
Winds

Related

maven - anypoint studio fails to load a maven module inside a mule project

I've created a custom Mule extension, and I wanted to test it by loading it into a mule demo project as a mule-plugin.
I'm using Anypoint Studio 7.9.0, I have Maven 3.6.3 installed.
I run mvn clean package to create the .jar of my custom mule extension, and then mvn clean install to install it into my local Maven repository.
When I go to {mule demo project} -> Manage Dependencies -> Manage Modules -> Add module from Maven and try to add my custom mule extension to the mule demo project in which I want to test it, I get this error: Failed to resolve module {groupID}:{module name}
Frankly, I'm stuck here for some time now, and cannot figure out what I'm missing.
Here's the pom.xml of my custom mule extension:
<modelVersion>4.0.0</modelVersion>
<groupId>com.mycompany</groupId>
<artifactId>custom-mule-extension</artifactId>
<version>0.1.1</version>
<packaging>mule-extension</packaging>
<name>Custom Mule Extension</name>
<parent>
<groupId>org.mule.extensions</groupId>
<artifactId>mule-modules-parent</artifactId>
<version>1.1.3</version>
</parent>
<dependencies>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.14.1</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.12.5</version>
</dependency>
</dependencies>
And this is the pom.xml of my mule demo application:
<modelVersion>4.0.0</modelVersion>
<groupId>com.mycompany</groupId>
<artifactId>elastic-demo</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>mule-application</packaging>
<name>elastic-demo</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<app.runtime>4.3.0-20210322</app.runtime>
<mule.maven.plugin.version>3.5.1</mule.maven.plugin.version>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>3.0.0</version>
</plugin>
<plugin>
<groupId>org.mule.tools.maven</groupId>
<artifactId>mule-maven-plugin</artifactId>
<version>${mule.maven.plugin.version}</version>
<extensions>true</extensions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.mule.connectors</groupId>
<artifactId>mule-sockets-connector</artifactId>
<version>1.2.2</version>
<classifier>mule-plugin</classifier>
</dependency>
<dependency>
<groupId>org.mule.connectors</groupId>
<artifactId>mule-http-connector</artifactId>
<version>1.5.25</version>
<classifier>mule-plugin</classifier>
</dependency>
<dependency>
<groupId>com.mycompany</groupId>
<artifactId>custom-mule-extension</artifactId>
<version>0.1.1</version>
<classifier>mule-plugin</classifier>
</dependency>
</dependencies>
<repositories>
<repository>
<id>anypoint-exchange-v2</id>
<name>Anypoint Exchange</name>
<url>https://maven.anypoint.mulesoft.com/api/v2/maven</url>
<layout>default</layout>
</repository>
<repository>
<id>mulesoft-releases</id>
<name>MuleSoft Releases Repository</name>
<url>https://repository.mulesoft.org/releases/</url>
<layout>default</layout>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>mulesoft-releases</id>
<name>MuleSoft Releases Repository</name>
<layout>default</layout>
<url>https://repository.mulesoft.org/releases/</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
The custom-mule-extension <dependency> element is the one that cannot be resolved. As you can see from the snippet above, I inserted the dependency directly into the pom.xml file after the "Add modules" way from Anypoint Studio UI failed. And here, I get the error that the module cannot be resolved.
One thing that bothers me is: when I launch the mvn clean install -DskipTests command, there is one [INFO] log that doesn't look good, and it's the one saying No primary artifact to install, installing attached artifacts instead.
The build goes fine, and the dependency pops up into my local maven repository, but then I cannot add it to the mule demo project.
Any help or advice would be much appreciated.
Thanks in advance.

Unable to validate pom.xml of a mule application in SonarQube

I am using SonarQube to validate artifactId, modelVersion etc in pom.xml file for a mule application.To validate these nodes, I have build some rules in SonarQube.but seems,POM rules are not working.Here is my pom xml and code rules.
<rule id ="2" name="Pom Model Version should be 4.0.0"
description="Pom Model Version should be 4.0.0"
severity="MAJOR" type="code_smell">
//*[local-name()='project']/*[local-name()='modelVersion']= '4.0.0'
</rule>
<rule id="3" name="Application Name is too long ok"
description="Application Name is too long, give a proper name"
severity="MAJOR" applies="application" type="code_smell">
string-length(//*[local-name()='project' ]/*[local-name()='artifactId'])>20
</rule>
<rule id ="4" name="Mule Runtime Version should be 4.2.0"
description="Mule Runtime Version should be 4.2.0"
severity="MAJOR" type="code_smell">
//*[local-name()='project']/*[local-name()='properties']/*[local-name()='app.runtime']= '4.2.0'
</rule>
<?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.mycompany</groupId>
<artifactId>security</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>mule-application</packaging>
<name>security-token-project</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<app.runtime>4.3.0-20201013</app.runtime>
<mule.maven.plugin.version>3.3.5</mule.maven.plugin.version>
<sonar.sources>/</sonar.sources>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>3.0.0</version>
</plugin>
<plugin>
<groupId>org.mule.tools.maven</groupId>
<artifactId>mule-maven-plugin</artifactId>
<version>${mule.maven.plugin.version}</version>
<extensions>true</extensions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.mule.connectors</groupId>
<artifactId>mule-http-connector</artifactId>
<version>1.5.22</version>
<classifier>mule-plugin</classifier>
</dependency>
<dependency>
<groupId>org.mule.connectors</groupId>
<artifactId>mule-sockets-connector</artifactId>
<version>1.2.0</version>
<classifier>mule-plugin</classifier>
</dependency>
</dependencies>
<repositories>
<repository>
<id>anypoint-exchange-v2</id>
<name>Anypoint Exchange</name>
<url>https://maven.anypoint.mulesoft.com/api/v2/maven</url>
<layout>default</layout>
</repository>
<repository>
<id>mulesoft-releases</id>
<name>MuleSoft Releases Repository</name>
<url>https://repository.mulesoft.org/releases/</url>
<layout>default</layout>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>mulesoft-releases</id>
<name>mulesoft release repository</name>
<layout>default</layout>
<url>https://repository.mulesoft.org/releases/</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</project>
My other rules to validate other xml files are working but above three rules are not working as expected.
<sonar.sources>/</sonar.sources>
<sonar.inclusions>**.xml</sonar.inclusions>
<sonar.exclusions>target/**.xml</sonar.exclusions>

Transitive dependencies not resolved with maven dependency and tycho pomConsider option

I try to create an eclipse plugin using OSGI dependencies from two repositories, one with maven dependencies, and one with p2 dependencies :
<repositories>
<repository>
<snapshots>
<enabled>true</enabled>
</snapshots>
<id>bintray-anrgenstar-genstar-packages</id>
<name>bintray</name>
<url>http://dl.bintray.com/anrgenstar/genstar-packages</url>
</repository>
</repositories>
<repository>
<id>gama</id>
<name>GAMA Snapshots</name>
<url>http://gama.unthinkingdepths.fr</url>
<layout>p2</layout>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
The project contain one parent pom.xml into ummisco.gaml.extensions.parent, which build the eclipse plugin ummisco.gaml.extensions.genstar :
(1) ummisco.gaml.extensions.parent
pom.xml
(2) ummisco.gaml.extensions.genstar
pom.xml
src/...
META-INF/MANIFEST.MF
(1) The ummisco.gaml.extensions.genstar parent pom.xml define the module <module>../ummisco.gaml.extensions.genstar</module> to build and call the Tycho maven plugin :
<modelVersion>4.0.0</modelVersion>
<groupId>ummisco.gaml.extensions</groupId>
<artifactId>ummisco.gaml.extensions.parent</artifactId>
<version>1.7.0-SNAPSHOT</version>
<packaging>pom</packaging>
<modules>
<module>../ummisco.gaml.extensions.genstar</module>
</modules>
<properties>
<p2-maven.version>1.2.0-SNAPSHOT</p2-maven.version>
<tycho.version>0.26.0</tycho.version>
<project.version>1.7.0-SNAPSHOT</project.version>
</properties>
<repositories>
<repository>
<id>sonatype-nexus-snapshots</id>
<name>Sonatype Nexus Snapshots</name>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>eclipse-mars</id>
<url>http://download.eclipse.org/releases/mars</url>
<layout>p2</layout>
</repository>
<repository>
<id>eclipse-elk</id>
<url>http://build.eclipse.org/modeling/elk/updates/nightly/</url>
<layout>p2</layout>
</repository>
<repository>
<id>eclipse-graphiti</id>
<url>http://download.eclipse.org/graphiti/updates/milestones/</url>
<layout>p2</layout>
</repository>
<repository>
<id>gama</id>
<name>GAMA Snapshots</name>
<url>http://gama.unthinkingdepths.fr</url>
<layout>p2</layout>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-maven-plugin</artifactId>
<version>${tycho.version}</version>
<extensions>true</extensions>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-p2-director-plugin</artifactId>
<version>${tycho.version}</version>
</plugin>
</plugins>
</build>
</project>
(2) The eclipse-plugin pom.xml of ummisco.gaml.extensions.genstar which need p2 and maven dependencies to work use the tycho <pomDependencies>consider</pomDependencies> option.
<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>ummisco.gaml.extensions.genstar</groupId>
<artifactId>ummisco.gaml.extensions.genstar</artifactId>
<packaging>eclipse-plugin</packaging>
<parent>
<groupId>ummisco.gaml.extensions</groupId>
<artifactId>ummisco.gaml.extensions.parent</artifactId>
<version>1.7.0-SNAPSHOT</version>
<relativePath>../ummisco.gaml.extensions.parent/</relativePath>
</parent>
<dependencies>
<dependency>
<groupId>genstar.core</groupId>
<artifactId>core</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>genstar.spll</groupId>
<artifactId>spll</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>genstar.spin</groupId>
<artifactId>spin</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>genstar.gospl</groupId>
<artifactId>gospl</artifactId>
<version>1.0</version>
</dependency>
</dependencies>
<repositories>
<repository>
<snapshots>
<enabled>true</enabled>
</snapshots>
<id>bintray-anrgenstar-genstar-packages</id>
<name>bintray</name>
<url>http://dl.bintray.com/anrgenstar/genstar-packages</url>
</repository>
</repositories>
<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<version>${tycho.version}</version>
<configuration>
<resolver>p2</resolver>
<pomDependencies>consider</pomDependencies>
</configuration>
</plugin>
</plugins>
</build>
</project>
The MANIFEST.MF for this eclipse-plugin is defined like that :
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Genstar
Bundle-SymbolicName: ummisco.gaml.extensions.genstar;singleton:=true
Bundle-Version: 1.7.0.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Require-Bundle: msi.gama.core, core, gspl, spin, spll,
javax.xml;bundle-version="1.3.4"
When i try to mvn clean install into ummisco.gaml.extensions.parent it seems that tycho download and recognize the dependencies defined in p2 (msi.gama.core for example), and defined in pom.xml (core, spll,gospl, spin OSGI bundle), but transitive dependencies of these bundles are not resolved.
[INFO] Fetching p2.index from http://gama.unthinkingdepths.fr/ (172B)
[INFO] Adding repository http://gama.unthinkingdepths.fr
[INFO] Resolving dependencies of MavenProject: ummisco.gaml.extensions.genstar:ummisco.gaml.extensions.genstar:1.7.0-SNAPSHOT # /home/reyman/Projets/genstar-gama-plugin/ummisco.gaml.extensions.genstar/pom.xml
[INFO] {osgi.os=linux, osgi.ws=gtk, org.eclipse.update.install.features=true, osgi.arch=x86_64}
[ERROR] Cannot resolve project dependencies:
[ERROR] Software being installed: ummisco.gaml.extensions.genstar 1.7.0.qualifier
[ERROR] Missing requirement: core 1.0.0 requires 'package org.math.R 0.0.0' but it could not be found
[ERROR] Cannot satisfy dependency: ummisco.gaml.extensions.genstar 1.7.0.qualifier depends on: bundle core 0.0.0
[ERROR]
I verify the transitive dependencies of the OSGI Bundle core 1.0.0 manifest (using mvn dependency:tree) and it seems correct, the manifest contain the declaration of dependencies in Import-Package, like org.math.R as you can see here :
Manifest-Version: 1.0
Bnd-LastModified: 1481896487741
Build-Jdk: 1.8.0_101
Built-By: reyman
Bundle-ManifestVersion: 2
Bundle-Name: core
Bundle-SymbolicName: core
Bundle-Version: 1.0
Created-By: Apache Maven Bundle Plugin
Export-Package: core.configuration;version="1.0.0";uses:="com.thoughtw
orks.xstream,core.metamodel,core.metamodel.pop,core.metamodel.pop.io"
,core.metamodel;version="1.0.0",core.metamodel.geo;version="1.0.0";us
es:="com.vividsolutions.jts.geom,core.metamodel",core.metamodel.geo.i
o;version="1.0.0";uses:="com.vividsolutions.jts.geom,core.metamodel.g
eo",core.metamodel.pop;version="1.0.0";uses:="com.vividsolutions.jts.
geom,core.metamodel,core.metamodel.geo,core.util.data",core.metamodel
.pop.io;version="1.0.0",core.util;version="1.0.0";uses:="org.apache.l
ogging.log4j",core.util.R;version="1.0.0";uses:="org.math.R",core.uti
l.data;version="1.0.0";uses:="core.util.excpetion",core.util.excpetio
n;version="1.0.0",core.util.random;version="1.0.0",core.util.random.r
oulette;version="1.0.0",core.util.stats;version="1.0.0"
Import-Package: com.thoughtworks.xstream;version="[1.4,2)",com.thought
works.xstream.converters;version="[1.4,2)",com.thoughtworks.xstream.c
onverters.extended;version="[1.4,2)",com.thoughtworks.xstream.io;vers
ion="[1.4,2)",com.thoughtworks.xstream.io.xml;version="[1.4,2)",com.t
houghtworks.xstream.mapper;version="[1.4,2)",com.vividsolutions.jts.g
eom,core.metamodel;version="[1.0,2)",core.metamodel.geo;version="[1.0
,2)",core.metamodel.pop;version="[1.0,2)",core.metamodel.pop.io;versi
on="[1.0,2)",core.util.data;version="[1.0,2)",core.util.excpetion;ver
sion="[1.0,2)",core.util.random;version="[1.0,2)",org.apache.logging.
log4j;version="[2.7,3)",org.math.R,org.rosuda.REngine,org.rosuda.REng
ine.Rserve
Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=1.8))"
Tool: Bnd-3.2.0.201605172007
I really don't understand why the transitive dependencies are not automaticly resolved by tycho using the pom.xml dependency ... If tycho recognized the core, spll, spin, etc. package in the eclipse-plugin MANIFEST, why the transitive dependencies of core, spll, spin, gospl OSGI bundle are not downloaded ?
Do you think there is a solution for this problem ?
UPDATE
Following this repository i try to make two project :
maven-bundle which bundle all dependencies into one big jar
tycho-bundle which take this maven-bundle in dependency
Intelij Idea found the different dependency class when i compile in GUI mode, but not my maven project when i run mvn install, it's really really weird... I don't understand where is the problem.
You can find the archive of the project here, you need to mvn clean install pom.xml into /maven-bundle/ folder, then mvn clean install pom.xml into tycho-bundle/ folder.

Error: Flex compiler and flex framework versions doesn't match. Compiler: 'X' - Framework: 'Y'

I'm trying to build a Flex project with Flexmojos 7.0.0 & mavenized Apache Flex SDK (groupId "org.apache...") with a dependency to an old library built with Flexmojos 5 and Adobe Flex SDK 4.6.b.23201 (groupId "com.adobe...").
The problem is that it gives following error:
ERROR] Failed to execute goal net.flexmojos.oss:flexmojos-maven-plugin:7.0.0:compile-swf (default-compile-swf) on project gestouch-examples: Execution default-compile-swf of goal net.flexmojos.oss:flexmojos-maven-plugin:7.0.0:compile-swf failed: Flex compiler and flex framework versions doesn't match. Compiler: '4.12.1.20140427' - Framework: '4.1.0.16076'.
[ERROR] You can use 'iKnowWhatImDoingPleaseBreakMyBuildIwontBlameFlexmojosForStopWorking' to disable this check. Please refer to Flexmojos maven doc.
[ERROR] If you prefer fixing it instead of ignoring, take a look at: https://docs.sonatype.org/display/FLEXMOJOS/How+to+set+Flex+SDK+version
Here's my POM:
<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>mygroup</groupId>
<artifactId>myartifact</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>swf</packaging>
<name>Flexmojos7 Test</name>
<properties>
<flexmojos.version>7.0.0</flexmojos.version>
<flex.version>4.12.1.20140427</flex.version>
<flex-sdk.version>${flex.version}</flex-sdk.version>
</properties>
<build>
<sourceDirectory>src/main/flex</sourceDirectory>
<plugins>
<plugin>
<groupId>net.flexmojos.oss</groupId>
<artifactId>flexmojos-maven-plugin</artifactId>
<version>${flexmojos.version}</version>
<extensions>true</extensions>
<configuration>
<sourceFile>Main.mxml</sourceFile>
<debug>true</debug>
<storepass/>
<skipTest>true</skipTest>
<skipTests>true</skipTests>
</configuration>
<dependencies>
<dependency>
<groupId>org.apache.flex</groupId>
<artifactId>compiler</artifactId>
<version>${flex.version}</version>
<type>pom</type>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.apache.flex.framework</groupId>
<artifactId>flex-framework</artifactId>
<version>${flex.version}</version>
<type>pom</type>
</dependency>
<!-- 3rd party libraries -->
<dependency>
<groupId>org.as3commons</groupId>
<artifactId>as3commons-logging</artifactId>
<version>2.7</version>
<type>swc</type>
</dependency>
</dependencies>
<repositories>
<repository>
<id>sonatype</id>
<url>https://oss.sonatype.org/content/repositories/releases</url>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</releases>
</repository>
<repository>
<!-- has as3commons -->
<id>yoolab.org-releases</id>
<url>http://dev.yoolab.org/maven/content/repositories/releases/</url>
<releases>
<enabled>true</enabled>
</releases>
</repository>
</repositories>
</project>
As you can see, as3commons-logging library is my dependency I mentioned. If you open it's POM you will see that it depends on
<groupId>com.adobe.flex.framework</groupId>
<artifactId>air-framework</artifactId>
and
<groupId>com.adobe.flex.framework</groupId>
<artifactId>common-framework</artifactId>
both with 4.1.0.16076 version.
I'm relatively new to Maven and I personally don't understand why it respects as3commons-logging POM when I specified in my POM dependency to as3commons-logging to be of type "swc".
But okay, after a weekend of research I found out how to solve this issue by specifying "excludes" for my dependency:
<dependency>
<groupId>org.as3commons</groupId>
<artifactId>as3commons-logging</artifactId>
<version>2.7</version>
<type>swc</type>
<exclusions>
<exclusion>
<groupId>com.adobe.flex.framework</groupId>
<artifactId>air-framework</artifactId>
</exclusion>
<exclusion>
<groupId>com.adobe.flex.framework</groupId>
<artifactId>common-framework</artifactId>
</exclusion>
</exclusions>
</dependency>
With this fix in my POM it finally compiles.
Now, my question is – is this the right fix? I mean conceptually. Because the whole thing seems not very clear for me.
Is that a price for switching from Adobe Flex to Apache Flex and all that?
Sorry for the late reply to your question.
Here the answer to your problem:
I noticed some problems with the way the old FDKs were published and refactored the structure to avoid these problems when generating the new FDKs. One thing I changed was to eliminate the flex-framework, air-framework and common-framework as they mixed up dependencies from Apache and Adobe. Now all you have is something similar to the common-framework pom. org.apache.flex:framework:{fdkVersion}:pom if you reference this instead of flex-framework and add a dependency to the playerglobal matching your minimum Flash version com.adobe.flash.framework:playerglobal:{flashVersion}:swc you should be ready to go.
And I would strongly suggest to switch to Flexmojos 7.0.1 (I released that a few days ago) as it contains a few fixes to annoying problems.
<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>mygroup</groupId>
<artifactId>myartifact</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>swf</packaging>
<name>Flexmojos7 Test</name>
<properties>
<flexmojos.version>7.0.1</flexmojos.version>
<flex.version>4.12.1.20140427</flex.version>
<flex-sdk.version>${flex.version}</flex-sdk.version>
<flashplayer.version>11.1</flashplayer.version>
</properties>
<build>
<sourceDirectory>src/main/flex</sourceDirectory>
<plugins>
<plugin>
<groupId>net.flexmojos.oss</groupId>
<artifactId>flexmojos-maven-plugin</artifactId>
<version>${flexmojos.version}</version>
<extensions>true</extensions>
<configuration>
<sourceFile>Main.mxml</sourceFile>
<debug>true</debug>
<storepass/>
<skipTest>true</skipTest>
<skipTests>true</skipTests>
</configuration>
<dependencies>
<dependency>
<groupId>org.apache.flex</groupId>
<artifactId>compiler</artifactId>
<version>${flex.version}</version>
<type>pom</type>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>com.adobe.flash.framework</groupId>
<artifactId>playerglobal</artifactId>
<version>${flashplayer.version}</version>
<type>swc</type>
</dependency>
<dependency>
<groupId>org.apache.flex</groupId>
<artifactId>framework</artifactId>
<version>${flex.version}</version>
<type>pom</type>
</dependency>
<!-- 3rd party libraries -->
<dependency>
<groupId>org.as3commons</groupId>
<artifactId>as3commons-logging</artifactId>
<version>2.7</version>
<type>swc</type>
<!--exclusions>
<exclude>
<groupId>....</groupId>
<artifactId>....</artifactId>
</exclude>
</exclusions-->
</dependency>
</dependencies>
<repositories>
<repository>
<id>sonatype</id>
<url>https://oss.sonatype.org/content/repositories/releases</url>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</releases>
</repository>
<repository>
<!-- has as3commons -->
<id>yoolab.org-releases</id>
<url>http://dev.yoolab.org/maven/content/repositories/releases/</url>
<releases>
<enabled>true</enabled>
</releases>
</repository>
</repositories>
</project>
Another problem could be that third party libs might reference artifacts in other versions. So probably as3commons-logging was compiled against the adobe flex version, so you definitely have to exclude this. You can see which dependencies are pulled in by issueing the following command:
mvn dependency:tree
It should output a dependency tree in which you can see which libs you have to exclude.
Hope this helps.
Chris
The problem is that flexmojos-maven-plugin 7.0.x version has been built using the Apache FDK 4.12.1.20140427
To build your project by flexmojos you need firstly deploy this FDK (4.12.1.20140427) in your maven repository by mavenizer (https://cwiki.apache.org/confluence/display/FLEX/Apache+Flex+SDK+Mavenizer).
If you have external repository (like Nexus server) you need to deploy this FDK into the repository. Then you need to explicitly declare this repository in POM file in the pluginRepositories section:
<!-- REPOS -->
<pluginRepositories>
<pluginRepository>
<id>flex-repository</id>
<url>http://path-to-your-repository/</url>
</pluginRepository>
</pluginRepositories>
<repositories>
<repository>
<id>flex-repository</id>
<url>http://path-to-your-repository/</url>
</repository>
</repositories>

no any "plugin descriptor" founded in my maven project

I am wanting to create UI with qt-jambi, but i have a problem.
i am using maven in eclipse, and create a maven project, and i downloaded and installed 3rd party qt-jambi jar files in my local repository from here:
http://old.qt-jambi.org/maven2/net/sf/qtjambi/
and below files:
(1) qtjambi-maven-plugin-linux32-4.5.2_01.jar
(2) qtjambi-platform-linux32-4.5.2_01.jar
i am using ubuntu 12.10(32bit) and Maven 3.0.4.
My maven repository(m2 home)path for qt-jambi is like below:
/home/mehdi/.m2/repository/net/sf/qtjambi/qtjambi/4.5.2_01/qtjambi-4.5.2_01.jar
/home/mehdi/.m2/repository/net/sf/qtjambi/qtjambi-maven-plugin-linux32/4.5.2_01/qtjambi-maven-plugin-linux32-4.5.2_01.jar
so i add this lines to my pom.xml: http://old.qt-jambi.org/users/maven-repository/
my pom.xml file is:
<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.iyasin</groupId>
<artifactId>iycTest</artifactId>
<version>2.0</version>
<packaging>jar</packaging>
<name>iycTest</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>net.sf.qtjambi</groupId>
<artifactId>qtjambi</artifactId>
<version>4.5.2_01</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>net.sf.qtjambi</groupId>
<artifactId>qtjambi-maven-plugin-linux32</artifactId>
<executions>
<execution>
<id>qtjambi</id>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
<configuration>
<sourcesDir>src/main/java</sourcesDir>
<noObsoleteTranslations>true</noObsoleteTranslations>
</configuration>
</plugin>
</plugins>
</build>
</project>
and when run mvn test or mvn compile return me below error:
Failed to parse plugin descriptor for net.sf.qtjambi:qtjambi-maven-plugin-linux32:4.5.2_01 (/home/mehdi/.m2/repository/net/sf/qtjambi/qtjambi-maven-plugin-linux32/4.5.2_01/qtjambi-maven-plugin-linux32-4.5.2_01.jar): No plugin descriptor found at META-INF/maven/plugin.xml -> [Help 1]
You need to add into the relevant part of your POM:
<pluginRepositories>
<pluginRepository>
<id>qtjambi-releases-before-2011</id>
<name>QtJambi (Releases Before 2011)</name>
<url>http://repository.qt-jambi.org/nexus/content/repositories/releases-before-2011</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
The above can be put into your settings.xml or project POM.
You should really run a local repository proxy (such as Nexus or Artifactory). Then setup your settings.xml to point to that local repository. Then configure it to cache central and qtjambi and other repositories you use. However that benefits of this are too long to go into here, best to research the topic with google.

Resources