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

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>

Related

How to pass repositories/distributionManagement configuration into pom.xml using command line

I attempt to build a CI/CD pipeline that:
runs Swagger codegen that generates a Maven project of the client library.
runs mvn deploy to deploy the client lib to the remote repository.
However, the autogenerated pom.xml does not have the configuration of <repositories> and <distributionManagement>.
I am looking for a Maven-native solution to programmatically add <repositories> and <distributionManagement> configuration to this auto-generated pom.xml.
Autogenerated pom.xml that only lives in the lifecycle of a CI/CD build
<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>
...
<url>https://github.com/swagger-api/swagger-codegen</url>
<description>Swagger Java</description>
<scm>
<connection>scm:git:git#github.com:swagger-api/swagger-codegen.git</connection>
<developerConnection>scm:git:git#github.com:swagger-api/swagger-codegen.git</developerConnection>
<url>https://github.com/swagger-api/swagger-codegen</url>
</scm>
<licenses>
<license>
<name>Unlicense</name>
<url>http://unlicense.org</url>
<distribution>repo</distribution>
</license>
</licenses>
<developers>
<developer>
<name>Swagger</name>
<email>apiteam#swagger.io</email>
<organization>Swagger</organization>
<organizationUrl>http://swagger.io</organizationUrl>
</developer>
</developers>
<build>
...
</build>
<profiles>
...
</profiles>
<dependencies>
...
</dependencies>
<properties>
...
</properties>
</project>
The snippet I want to add into pom.xml:
<repositories>
<repository>
<id>...</id>
<url>...</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<distributionManagement>
<repository>
<id>...</id>
<url>...</url>
</repository>
</distributionManagement>
I was able to achieve this by passing a command-line argument to mvn deploy:
mvn deploy -DaltDeploymentRepository=ID:default:URL
ID is the id of the server in your settings.xml
URL is the URL of the deployment endpoint as you would use in distributionManagement/url part of your pom.xml.

Configuration of plugin build for Jenkins

On the Jenkins "Plugin tutorial" page it is written that to build a plugin you need to edit the Maven settings (Setting Up Environment section).
Is it possible not to change the Maven settings but edit pom-file or do something like this instead of it?
Thanks!
Modifying pom.xml is fine too. e.g,
<?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>
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<!-- Baseline Jenkins version you use to build and test the plugin. Users
must have this version or newer to run. -->
<version>1.589</version>
<relativePath />
</parent>
<groupId>com.xxx.xxx</groupId>
<artifactId>foo</artifactId>
<version>1.0.0</version>
<packaging>hpi</packaging>
<name>bar</name>
<description>xxx xxx xxx xxx xxx</description>
<licenses>
<license>
<name>MIT License</name>
<url>http://opensource.org/licenses/MIT</url>
</license>
</licenses>
<repositories>
<repository>
<id>repo.jenkins-ci.org</id>
<url>http://repo.jenkins-ci.org/public/</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>repo.jenkins-ci.org</id>
<url>http://repo.jenkins-ci.org/public/</url>
</pluginRepository>
</pluginRepositories>
<dependencies>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.3.1</version>
</dependency>
</dependencies>

Failed to execute goal on project sip-servlets-core-api

I am trying to make an SIP servlet, after a lot of research on Session Initiation Protocal(SIP) servlets I am now using mobicent's sip servlet project with TOMCAT...!
I am following this guide to get my goal, the issue is that when I am trying to run the command mvn clean install in the project directory, it starts download the dependencies but suddenly it encounters by an error
Here's the error log,
[ERROR] Failed to execute goal on project sip-servlets-core-api: Could not resol
ve dependencies for project org.mobicents.servlet.sip:sip-servlets-core-api:jar:
1.7.0-SNAPSHOT: Failed to collect dependencies at org.mobicents.javax.sip:mobice
nts-jain-sip-ext:jar:1.1-SNAPSHOT: Failed to read artifact descriptor for org.mo
bicents.javax.sip:mobicents-jain-sip-ext:jar:1.1-SNAPSHOT: Could not transfer ar
tifact org.mobicents.javax.sip:mobicents-jain-sip-ext:pom:1.1-SNAPSHOT from/to C
odehaus Snapshots (http://snapshots.repository.codehaus.org): snapshots.reposito
ry.codehaus.org: Unknown host snapshots.repository.codehaus.org -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal o
n project sip-servlets-core-api: Could not resolve dependencies for project org.
mobicents.servlet.sip:sip-servlets-core-api:jar:1.7.0-SNAPSHOT: Failed to collec
t dependencies at org.mobicents.javax.sip:mobicents-jain-sip-ext:jar:1.1-SNAPSHO
T
at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDe
pendencies(LifecycleDependencyResolver.java:221)
at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.resol
veProjectDependencies(LifecycleDependencyResolver.java:127)
at org.apache.maven.lifecycle.internal.MojoExecutor.ensureDependenciesAr
eResolved(MojoExecutor.java:257)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:200)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje
ct(LifecycleModuleBuilder.java:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje
ct(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThre
adedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(Lifecycl
eStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:862)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:286)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:197)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Laun
cher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.jav
a:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(La
uncher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:
356)
Caused by: org.apache.maven.project.DependencyResolutionException: Could not res
olve dependencies for project org.mobicents.servlet.sip:sip-servlets-core-api:ja
r:1.7.0-SNAPSHOT: Failed to collect dependencies at org.mobicents.javax.sip:mobi
cents-jain-sip-ext:jar:1.1-SNAPSHOT
at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve(D
efaultProjectDependenciesResolver.java:180)
at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDe
pendencies(LifecycleDependencyResolver.java:195)
... 23 more
Caused by: org.eclipse.aether.collection.DependencyCollectionException: Failed t
o collect dependencies at org.mobicents.javax.sip:mobicents-jain-sip-ext:jar:1.1
-SNAPSHOT
at org.eclipse.aether.internal.impl.DefaultDependencyCollector.collectDe
pendencies(DefaultDependencyCollector.java:291)
at org.eclipse.aether.internal.impl.DefaultRepositorySystem.collectDepen
dencies(DefaultRepositorySystem.java:316)
at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve(D
efaultProjectDependenciesResolver.java:172)
... 24 more
Caused by: org.eclipse.aether.resolution.ArtifactDescriptorException: Failed to
read artifact descriptor for org.mobicents.javax.sip:mobicents-jain-sip-ext:jar:
1.1-SNAPSHOT
at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.
loadPom(DefaultArtifactDescriptorReader.java:302)
at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.
readArtifactDescriptor(DefaultArtifactDescriptorReader.java:218)
at org.eclipse.aether.internal.impl.DefaultDependencyCollector.resolveCa
chedArtifactDescriptor(DefaultDependencyCollector.java:535)
at org.eclipse.aether.internal.impl.DefaultDependencyCollector.getArtifa
ctDescriptorResult(DefaultDependencyCollector.java:519)
at org.eclipse.aether.internal.impl.DefaultDependencyCollector.processDe
pendency(DefaultDependencyCollector.java:409)
at org.eclipse.aether.internal.impl.DefaultDependencyCollector.processDe
pendency(DefaultDependencyCollector.java:363)
at org.eclipse.aether.internal.impl.DefaultDependencyCollector.process(D
efaultDependencyCollector.java:351)
at org.eclipse.aether.internal.impl.DefaultDependencyCollector.collectDe
pendencies(DefaultDependencyCollector.java:254)
... 26 more
Caused by: org.eclipse.aether.resolution.ArtifactResolutionException: Could not
transfer artifact org.mobicents.javax.sip:mobicents-jain-sip-ext:pom:1.1-SNAPSHO
T from/to Codehaus Snapshots (http://snapshots.repository.codehaus.org): snapsho
ts.repository.codehaus.org
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(Defa
ultArtifactResolver.java:444)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtif
acts(DefaultArtifactResolver.java:246)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtif
act(DefaultArtifactResolver.java:223)
at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.
loadPom(DefaultArtifactDescriptorReader.java:287)
... 33 more
Caused by: org.eclipse.aether.transfer.ArtifactTransferException: Could not tran
sfer artifact org.mobicents.javax.sip:mobicents-jain-sip-ext:pom:1.1-SNAPSHOT fr
om/to Codehaus Snapshots (http://snapshots.repository.codehaus.org): snapshots.r
epository.codehaus.org
at org.eclipse.aether.connector.basic.ArtifactTransportListener.transfer
Failed(ArtifactTransportListener.java:43)
at org.eclipse.aether.connector.basic.BasicRepositoryConnector$TaskRunne
r.run(BasicRepositoryConnector.java:355)
at org.eclipse.aether.util.concurrency.RunnableErrorForwarder$1.run(Runn
ableErrorForwarder.java:67)
at org.eclipse.aether.connector.basic.BasicRepositoryConnector$DirectExe
cutor.execute(BasicRepositoryConnector.java:581)
at org.eclipse.aether.connector.basic.BasicRepositoryConnector.get(Basic
RepositoryConnector.java:249)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.performDownl
oads(DefaultArtifactResolver.java:520)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(Defa
ultArtifactResolver.java:421)
... 36 more
Caused by: org.apache.maven.wagon.TransferFailedException: snapshots.repository.
codehaus.org
at org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.fillInp
utData(AbstractHttpClientWagon.java:1066)
at org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.fillInp
utData(AbstractHttpClientWagon.java:960)
at org.apache.maven.wagon.StreamWagon.getInputStream(StreamWagon.java:11
6)
at org.apache.maven.wagon.StreamWagon.getIfNewer(StreamWagon.java:88)
at org.apache.maven.wagon.StreamWagon.get(StreamWagon.java:61)
at org.eclipse.aether.transport.wagon.WagonTransporter$GetTaskRunner.run
(WagonTransporter.java:560)
at org.eclipse.aether.transport.wagon.WagonTransporter.execute(WagonTran
sporter.java:427)
at org.eclipse.aether.transport.wagon.WagonTransporter.get(WagonTranspor
ter.java:404)
at org.eclipse.aether.connector.basic.BasicRepositoryConnector$GetTaskRu
nner.runTask(BasicRepositoryConnector.java:447)
at org.eclipse.aether.connector.basic.BasicRepositoryConnector$TaskRunne
r.run(BasicRepositoryConnector.java:350)
... 41 more
Caused by: java.net.UnknownHostException: snapshots.repository.codehaus.org
at java.net.InetAddress.getAllByName0(InetAddress.java:1252)
at java.net.InetAddress.getAllByName(InetAddress.java:1164)
at java.net.InetAddress.getAllByName(InetAddress.java:1098)
at org.apache.maven.wagon.providers.http.httpclient.impl.conn.SystemDefa
ultDnsResolver.resolve(SystemDefaultDnsResolver.java:44)
at org.apache.maven.wagon.providers.http.httpclient.impl.conn.HttpClient
ConnectionOperator.connect(HttpClientConnectionOperator.java:101)
at org.apache.maven.wagon.providers.http.httpclient.impl.conn.PoolingHtt
pClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:318)
at org.apache.maven.wagon.providers.http.httpclient.impl.execchain.MainC
lientExec.establishRoute(MainClientExec.java:363)
at org.apache.maven.wagon.providers.http.httpclient.impl.execchain.MainC
lientExec.execute(MainClientExec.java:219)
at org.apache.maven.wagon.providers.http.httpclient.impl.execchain.Proto
colExec.execute(ProtocolExec.java:195)
at org.apache.maven.wagon.providers.http.httpclient.impl.execchain.Retry
Exec.execute(RetryExec.java:86)
at org.apache.maven.wagon.providers.http.httpclient.impl.execchain.Redir
ectExec.execute(RedirectExec.java:108)
at org.apache.maven.wagon.providers.http.httpclient.impl.client.Internal
HttpClient.doExecute(InternalHttpClient.java:184)
at org.apache.maven.wagon.providers.http.httpclient.impl.client.Closeabl
eHttpClient.execute(CloseableHttpClient.java:82)
at org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.execute
(AbstractHttpClientWagon.java:832)
at org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.fillInp
utData(AbstractHttpClientWagon.java:983)
... 50 more
[ERROR]
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyReso
lutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :sip-servlets-core-api
And below is 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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>mobicents</artifactId>
<groupId>org.mobicents</groupId>
<version>1.27-SNAPSHOT</version>
</parent>
<groupId>org.mobicents.servlet.sip</groupId>
<artifactId>sip-servlets-bootstrap</artifactId>
<version>1.7.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Mobicents Sip Servlets</name>
<url>http://www.mobicents.org/products_sip_servlets.html</url>
<ciManagement>
<system>Hudson</system>
<url>https://hudson.jboss.org/hudson/job/MobicentsSipServlets/</url>
</ciManagement>
<developers>
<developer>
<id>jean.deruelle</id>
<name>Jean Deruelle</name>
<email>jean.deruelle#gmail.com</email>
<organization>JBoss/Red Hat</organization>
<organizationUrl>http://www.redhat.com/</organizationUrl>
<roles>
<role>Project Lead</role>
</roles>
<timezone>+1</timezone>
</developer>
<developer>
<id>vralev</id>
<name>Vladimir Ralev</name>
<email>vladimir.ralev#gmail.com</email>
<organization>JBoss/Red Hat</organization>
<organizationUrl>http://www.redhat.com/</organizationUrl>
<roles>
<role>Active Developer</role>
</roles>
<timezone>+1</timezone>
</developer>
<developer>
<id>baranowb</id>
<name>Bartosz Baranowski</name>
<email>baranowb#gmail.com</email>
<organization>JBoss/Red Hat</organization>
<organizationUrl>http://www.redhat.com/</organizationUrl>
<roles>
<role>Developer</role>
</roles>
<timezone>+1</timezone>
</developer>
<developer>
<id>mranga</id>
<name>Neo Ranga</name>
<email>mranga#dev.java.net</email>
<roles>
<role>Developer</role>
</roles>
<timezone>-5</timezone>
</developer>
</developers>
<licenses>
<license>
<name>GNU LESSER GENERAL PUBLIC LICENSE</name>
<url>http://www.gnu.org/licenses/lgpl.html</url>
<distribution>repo</distribution>
</license>
</licenses>
<scm>
<connection>scm:svn:https://mobicents.googlecode.com/svn/trunk/servers/sip-servlets</connection>
<developerConnection>scm:svn:https://mobicents.googlecode.com/svn/trunk/servers/sip-servlets</developerConnection>
<url>http://code.google.com/p/mobicents/source/browse/trunk/servers/sip-servlets</url>
</scm>
<modules>
<module>sip-servlets-bootstrap</module>
<module>sip-servlets-spec</module>
<module>sip-servlets-client</module>
<module>sip-servlets-jruby</module>
<module>sip-servlets-core-api</module>
<module>sip-servlets-impl</module>
<module>sip-servlets-application-router</module>
<module>sip-servlets-annotations</module>
</modules>
<properties>
<mobicents.tools.mavenplugin.eclipse.version>1.0.0.FINAL</mobicents.tools.mavenplugin.eclipse.version>
<mobicents.cluster.version>1.12</mobicents.cluster.version>
<mobicents.balancer.version>1.5-SNAPSHOT</mobicents.balancer.version>
<mobicents.jain.sip.ha.version>1.4.0-SNAPSHOT</mobicents.jain.sip.ha.version>
<mobicents.jain.sip.ext.version>1.1-SNAPSHOT</mobicents.jain.sip.ext.version>
</properties>
<dependencies>
<!-- test dependencies -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<configuration>
<allowTimestampedSnapshots>true</allowTimestampedSnapshots>
<preparationGoals>clean install</preparationGoals>
<tagBase>
https://mobicents.googlecode.com/svn/tags/servers/sip-servlets/
</tagBase>
</configuration>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<compilerArguments>
<g />
</compilerArguments>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>2.0-beta-6</version>
</plugin>
<plugin>
<artifactId>maven-eclipse-plugin</artifactId>
<groupId>org.mobicents.tools</groupId>
<version>${mobicents.tools.mavenplugin.eclipse.version}</version>
<inherited>false</inherited>
<executions />
<configuration>
<!--generateProjectsForModules>true</generateProjectsForModules-->
<resolveTransitiveDependencies>true</resolveTransitiveDependencies>
<eclipseProjectName>sip-servlets-bootstrap</eclipseProjectName>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>site</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.1</version>
<executions>
<execution>
<phase>site</phase>
<configuration>
<tasks>
<copy verbose="true" file="${project.build.directory}/site/index.html" tofile="${project.build.directory}/site/products_sip_servlets.html" />
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<configuration>
<autoVersionSubmodules>true</autoVersionSubmodules>
<tagBase>https://mobicents.googlecode.com/svn/tags/servers/sip-servlets
</tagBase>
<arguments>-Dmaven.test.skip</arguments>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>release</id>
<modules>
<module>sip-servlets-catalina</module>
<module>sip-servlets-tomcat-jboss4</module>
<module>sip-servlets-jboss5-metadata</module>
<module>sip-servlets-jruby</module>
<module>sip-servlets-jboss5-deployer</module>
<module>sip-servlets-jboss5-ha-server-cache</module>
<module>sip-servlets-jboss5</module>
<module>sip-servlets-management</module>
<module>sip-servlets-examples</module>
<module>sip-servlets-test-suite</module>
<module>docs</module>
</modules>
<properties>
<maven.test.skip>true</maven.test.skip>
</properties>
</profile>
<profile>
<id>tomcat</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<tomcat.version>6.0.35</tomcat.version>
</properties>
<modules>
<module>sip-servlets-catalina</module>
<module>sip-servlets-tomcat-jboss4</module>
</modules>
<dependencies>
<!-- j2ee dependencies -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>
</dependencies>
</profile>
<profile>
<id>jboss</id>
<modules>
<module>sip-servlets-catalina</module>
<module>sip-servlets-tomcat-jboss4</module>
</modules>
<properties>
<tomcat.version>6.0.35</tomcat.version>
</properties>
<dependencies>
<!-- j2ee dependencies -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>
</dependencies>
</profile>
<profile>
<id>jboss-5</id>
<modules>
<module>sip-servlets-catalina</module>
<module>sip-servlets-jboss5-metadata</module>
<module>sip-servlets-jboss5-deployer</module>
<module>sip-servlets-jboss5-ha-server-cache</module>
<module>sip-servlets-jboss5</module>
</modules>
<properties>
<tomcat.version>6.0.35</tomcat.version>
</properties>
<dependencies>
<!-- j2ee dependencies -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>
</dependencies>
</profile>
<profile>
<id>tomcat-distro</id>
<modules>
<module>sip-servlets-catalina</module>
<module>sip-servlets-tomcat-jboss4</module>
</modules>
<properties>
<tomcat.version>6.0.35</tomcat.version>
</properties>
<dependencies>
<!-- j2ee dependencies -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>
</dependencies>
</profile>
<profile>
<id>jboss-distro</id>
<modules>
<module>sip-servlets-catalina</module>
<module>sip-servlets-tomcat-jboss4</module>
</modules>
<properties>
<tomcat.version>6.0.35</tomcat.version>
</properties>
<dependencies>
<!-- j2ee dependencies -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>
</dependencies>
</profile>
<profile>
<id>jboss-5-distro</id>
<modules>
<module>sip-servlets-catalina</module>
<module>sip-servlets-jboss5-metadata</module>
<module>sip-servlets-jboss5-deployer</module>
<module>sip-servlets-jboss5-ha-server-cache</module>
<module>sip-servlets-jboss5</module>
</modules>
<properties>
<tomcat.version>6.0.35</tomcat.version>
</properties>
<dependencies>
<!-- j2ee dependencies -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>
</dependencies>
</profile>
<profile>
<id>tomcat-7</id>
<modules>
<module>sip-servlets-catalina-7</module>
<module>tomcat-7</module>
</modules>
<properties>
<tomcat.version>7.0.26</tomcat.version>
</properties>
<dependencies>
<!-- j2ee dependencies -->
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-web-api</artifactId>
<version>6.0</version>
<scope>provided</scope>
</dependency>
</dependencies>
</profile>
<profile>
<id>tomcat-7-distro</id>
<modules>
<module>sip-servlets-catalina-7</module>
<module>tomcat-7</module>
</modules>
<properties>
<tomcat.version>7.0.26</tomcat.version>
</properties>
<dependencies>
<!-- j2ee dependencies -->
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-web-api</artifactId>
<version>6.0</version>
<scope>provided</scope>
</dependency>
</dependencies>
</profile>
<profile>
<id>as7</id>
<modules>
<module>sip-servlets-as7</module>
</modules>
<properties>
<!-- keep in sync with jboss-as/pom.xml -->
<!-- <version.org.jboss.web>7.0.10.Final</version.org.jboss.web> -->
<version.org.jboss.spec.javax.servlet.jboss-servlet-api_3.0_spec>1.0.0.Final</version.org.jboss.spec.javax.servlet.jboss-servlet-api_3.0_spec>
</properties>
<dependencies>
<!-- j2ee dependencies -->
<dependency>
<groupId>org.jboss.spec.javax.servlet</groupId>
<artifactId>jboss-servlet-api_3.0_spec</artifactId>
<version>${version.org.jboss.spec.javax.servlet.jboss-servlet-api_3.0_spec}</version>
<scope>provided</scope>
</dependency>
</dependencies>
</profile>
<profile>
<id>docs</id>
<modules>
<module>docs</module>
</modules>
</profile>
</profiles>
<!-- repositories -->
<repositories>
<repository>
<id>jboss-public-repository-group</id>
<name>JBoss Public Maven Repository Group</name>
<url>https://repository.jboss.org/nexus/content/groups/public/</url>
<layout>default</layout>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</snapshots>
</repository>
<repository>
<id>jboss-3rd-party-repository-group</id>
<name>JBoss ThirdParty Releases Repository Group</name>
<url>https://repository.jboss.org/nexus/content/repositories/thirdparty-releases</url>
<layout>default</layout>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</snapshots>
</repository>
<repository>
<id>jboss-3rd-party-upload-repository-group</id>
<name>JBoss ThirdParty Upload Repository Group</name>
<url>https://repository.jboss.org/nexus/content/repositories/thirdparty-upload</url>
<layout>default</layout>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</snapshots>
</repository>
<repository>
<id>java.net-Public</id>
<name>Maven Java Net Snapshots and Releases</name>
<!--url>https://maven.java.net/content/groups/public/</url-->
<url>http://download.java.net/maven/2/</url>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</snapshots>
</repository>
<repository>
<id>JbossRepository</id>
<name>Jboss Repository</name>
<url>http://repository.jboss.org/</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
<releases>
<enabled>true</enabled>
</releases>
</repository>
<repository>
<id>backup.repository.jboss.org</id>
<name>JBoss Repository Backup</name>
<url>http://anonsvn.jboss.org/repos/repository.jboss.org/maven2/</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
<releases>
<enabled>true</enabled>
</releases>
</repository>
<!--repository>
<id>jboss-snapshots</id>
<name>JBoss Snapshot Repository</name>
<url>http://snapshots.jboss.org/maven2</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository-->
</repositories>
</project>
If you have a better way to work SIP server, please tell me. Your Suggestions and help is very very important...!
Thanks in Advance.... :)
Version 1.7.0 is very old, please use https://github.com/Mobicents/sip-servlets instead. why do you try to recompile the project instead of using the pre-built binaries at https://github.com/Mobicents/sip-servlets/releases ?

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>

Birt viewer to a Maven project for birt 4.3.1

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

Resources