Error getting POM for 'org.codehaus.mojo:jasperreports-maven-plugin' from the repository - maven-2

I am trying to deploy OSGI bundle to Jboss 7.1.1.Final. Everytime I compile and deploy project it gives me following error.
I have checked in M2, only 1.0-beta-2 version is present as we can see similar thing mentioned in repository too http://mvnrepository.com/artifact/org.codehaus.mojo/jasperreports-maven-plugin/1.0-beta-2
There is no version defined in POM, not sure from where it is trying to pull this version.
Command
mvn jboss-as:deploy -Pdomain -DskipTests -Dusername=manish -Dpassword=password -Dhost=x.x.x.x -Dport=9999 -X
POM Configuration
<repository>
<id>jboss-public-repository</id>
<name>JBoss Repository</name>
<url>https://repository.jboss.org/nexus/content/groups/public</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>jasperreports</id>
<url>http://jasperreports.sourceforge.net/maven2</url>
</repository>
</repositories>
...
<plugins>
<!-- Jasper Plugins -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jasperreports-maven-plugin</artifactId>
<configuration>
<outputDirectory>${project.build.directory}/jasper</outputDirectory>
</configuration>
<executions>
<execution>
<goals>
<goal>compile-reports</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>net.sf.jasperreports</groupId>
<artifactId>jasperreports</artifactId>
<version>4.7.0</version>
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-all</artifactId>
<version>1.7.5</version>
</dependency>
</dependencies>
</plugin>
Error
Caused by: org.apache.maven.project.ProjectBuildingException: Error getting POM for 'org.codehaus.mojo:jasperreports-maven-plugin' from the repository: Failed to resolve artifact, possibly due to a repository list that is not appropriately equipped for this artifact's metadata.
org.codehaus.mojo:jasperreports-maven-plugin:pom:1.0-beta-3-SNAPSHOT
from the specified remote repositories:
central (http://repo1.maven.org/maven2),
jboss-public-repository (https://repository.jboss.org/nexus/content/groups/public)
for project org.codehaus.mojo:jasperreports-maven-plugin
at org.apache.maven.project.DefaultMavenProjectBuilder.findModelFromRepository(DefaultMavenProjectBuilder.java:592)
at org.apache.maven.project.DefaultMavenProjectBuilder.buildFromRepository(DefaultMavenProjectBuilder.java:251)
at org.apache.maven.project.artifact.MavenMetadataSource.retrieveRelocatedProject(MavenMetadataSource.java:163)
... 22 more

The jasperreport plugin is available via Maven central but not as a SNAPSHOT version. The question is if you need to use the SNAPSHOT version or the release version which can be found here.

Related

Trying to deploy a Mule4 Policy on Exchange goal deploy-file not found

I am trying to deploy a custom policy to Exchange, but it results in:
[INFO] Scanning for projects...
[INFO]
[INFO] -----< 7de36ab5-1c25-4cd4-89e8-ec315f34b341:message-header-policy >-----
[INFO] Building message-header-policy 1.0.3
[INFO] ----------------------------[ mule-policy ]-----------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.446 s
[INFO] Finished at: 2018-10-16T15:01:04+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Could not find goal 'deploy-file' in plugin org.mule.tools.maven:mule-maven-plugin:3.1.6 among available goals clean, compile, deploy, generate-resources, generate-sources, generate-test-resources, generate-test-sources, initialize, package, process-classes, process-resources, process-sources, site, test-compile, undeploy, validate -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[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 read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoNotFoundException
My pom file is:
http://maven.apache.org/maven-v4_0_0.xsd">
4.0.0
<groupId>organizationid</groupId>
<artifactId>message-header-policy</artifactId>
<version>1.0.3</version>
<packaging>mule-policy</packaging>
<name>message-header-policy</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<app.runtime>4.1.3</app.runtime>
<exchange.url>https://maven.eu1.anypoint.mulesoft.com/api/v1/organizations/organizationid/maven</exchange.url>
<mule.maven.plugin.version>3.1.6</mule.maven.plugin.version>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.mule.tools.maven</groupId>
<artifactId>mule-maven-plugin</artifactId>
<version>${mule.maven.plugin.version}</version>
<executions>
<execution>
<id>upload-template</id>
<phase>deploy</phase>
<goals>
<goal>deploy-file</goal>
</goals>
<configuration>
<repositoryId>Repository</repositoryId>
<url>${exchange.url}</url>
<file>${project.basedir}/${project.artifactId}.yaml</file>
<generatePom>false</generatePom>
<artifactId>${project.artifactId}</artifactId>
<groupId>${project.groupId}</groupId>
<version>${project.version}</version>
<packaging>yaml</packaging>
<classifier>mule-policy</classifier>
</configuration>
</execution>
</executions>
<extensions>true</extensions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.mule.connectors</groupId>
<artifactId>mule-http-connector</artifactId>
<version>1.3.1</version>
<classifier>mule-plugin</classifier>
</dependency>
<dependency>
<groupId>org.mule.connectors</groupId>
<artifactId>mule-sockets-connector</artifactId>
<version>1.1.1</version>
<classifier>mule-plugin</classifier>
</dependency>
<dependency>
<groupId>com.mulesoft.anypoint</groupId>
<artifactId>mule-http-policy-transform-extension</artifactId>
<version>1.1.0</version>
<classifier>mule-plugin</classifier>
</dependency>
</dependencies>
<repositories>
<repository>
<id>anypoint-exchange</id>
<name>Anypoint Exchange</name>
<url>https://maven.eu1.anypoint.mulesoft.com/api/v1/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>
<distributionManagement>
<repository>
<id>Repository</id>
<name>Corporate Repository</name>
<url>${exchange.url}</url>
<layout>default</layout>
</repository>
</distributionManagement>
organizationid is the GUID from our organisation ....
I have based this on the documentation found on this page:
https://docs.mulesoft.com/api-manager/2.x/policy-scope-size-concept
You need to add your Exchange credentials in maven settings.xml
<servers>
<server>
<id>Repository</id>
<username>myusername</username>
<password>mypassword</password>
</server>
Hope it helps

Build local eclipse plugins using tycho pointing to local p2 repository

I am creating some Eclipse plugin and features that require third-party plugins and features. In order to include these dependencies into my project, I created a p2 layout repository.
Note: My p2 artifacts are not Maven project... However, I am using Maven style building. Here is the pom.xml for the p2 repository
<properties>
<tycho-version>0.18.0</tycho-version>
</properties>
<repositories>
<repository>
<id>eclipse-platform-m6</id>
<layout>p2</layout>
<url>http://download.eclipse.org/eclipse/updates/3.8</url>
</repository>
</repositories>
<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho.extras</groupId>
<artifactId>tycho-p2-extras-plugin</artifactId>
<version>${tycho-version}</version>
<executions>
<execution>
<phase>prepare-package</phase>
<goals>
<goal>publish-features-and-bundles</goal>
</goals>
<configuration>
<compress>false</compress>
<artifactRepositoryLocation>/mypath/target/repository</artifactRepositoryLocation>
<metadataRepositoryLocation>/mypath/target/repository</metadataRepositoryLocation>
<sourceLocation>/mypath/src</sourceLocation>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-p2-repository-plugin</artifactId>
<version>${tycho-version}</version>
<configuration>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>verify-repository</goal>
<goal>archive-repository</goal>
</goals>
<configuration>
<compress>false</compress>
<includeAllDependencies>true</includeAllDependencies>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-p2-publisher-plugin</artifactId>
<version>${tycho-version}</version>
<configuration>
<publishArtifacts>true</publishArtifacts>
</configuration>
</plugin>
<plugin><!-- enable the Tycho build extension -->
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-maven-plugin</artifactId>
<version>${tycho-version}</version>
<extensions>true</extensions>
</plugin>
</plugins>
</build>
The above builds successfully, and creates (and verifies) a p2 repository. I get following structure in my target/ directory of the project
- Project
..
..
- target
- p2agent
- org.eclipse.equinox.p2.core
- org.eclipse.equinox.p2.engine
- repository
- features
- plugins
artifacts.xml
content.xml
<projectname>-<version>.zip <!-- This contains same things as repository directory here -->
Now, I use Tycho for building my plugins and features and refer the p2 repository I created above. I have following project structure for my plugins and features
- bundle.parent
- bundle.mainplugin
- bundle.mainplugin.test.fragment
- bundle.mainplugin.feature
Here is my bundle.parent pom.xml
<repositories>
<repository>
<id>eclipse-platform-m6</id>
<layout>p2</layout>
<url>http://download.eclipse.org/eclipse/updates/3.8</url>
</repository>
<repository>
<id>third-party-eclipse-plugins</id>
<layout>p2</layout>
<url>file:///.../target/repository</url>
</repository>
</repositories>
<modules>
<module>../bundle.mainplugin</module>
<module>../bundle.mainplugin.test.fragment</module>
<module>../bundle.mainplugin.feature</module>
</modules>
<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-maven-plugin</artifactId>
<version>${tycho-version}</version>
<extensions>true</extensions>
</plugin>
</plugins>
</build>
Finally, I run goals mvn clean install on the parent pom.xml. Unfortunately, mvn-compile throws compilation issues when classes in my plugin extend some of the classes in plugins. (The classes are also required at run-time). Here is the error:
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:0.18.0:compile (default-compile
) on project <Project Name>: Compilation failure
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:213)
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.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: copied.org.apache.maven.plugin.CompilationFailureException: Compilation failure
at copied.org.apache.maven.plugin.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:442)
at org.eclipse.tycho.compiler.AbstractOsgiCompilerMojo.execute(AbstractOsgiCompilerMojo.java:239)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 19 more
My Question:
From the compiler errors, I believe Tycho is somehow not making these third-party artifacts available to my classes for which there is a compiler error. Is there a way to determine if my plugin classes exist in the Tycho classpath?
UPDATE
Checked availability of third-party bundles that I want to be available in Tycho reactor from this location
java -jar /home/.../eclipse-3.8.2/plugins/org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar -debug -consolelog -application org.eclipse.equinox.p2.director -repository file:///home/../target/repository -list
All third-party bundles showed up successfully.
Sebastian Zarnekow's answer gave me a hint.
Error while building an xtext project with ant: Generation of the Grammar classes fails
As you can infer from the error message, maven fails to create language models from injection. The reason is explained in the link above:
Xtext uses the platform:/resource URI scheme of EMF.
The solution is you need to give EMFGenerator a new declaration of where the model directory should be. In **.mwe2 file, replace the following code
fragment = ecore.EMFGeneratorFragment auto-inject {}
with
fragment = ecore.EMFGeneratorFragment auto-inject {
javaModelDirectory = "/${projectName}/src-gen"
}
should do the trick.
for anyone who also runs into this problem, you can also try using:
${project.basedir}
So, say you have the following directories:
- projects:
- main-project
- local-repository
In the parent pom (i.e.: main-project/pom.xml) reference the local-repository, using a relative path, in the following way:
<url>file:${project.basedir}/target/repository</url>
Just replace :
<url>file:///.../target/repository</url>
by :
<url>file:<projectname>/deploy/target/repository</url>
(if your parent pom.xml is your root folder)

Maven: compiling with all dependencies in one Jar

in pom of a project, i have added dependency with scope compile . which is a jar file which contains some class file and jar's as well. my current java file needs internal jars of dependent jar to compile.
But maven compile goal returning compilation error . :banghead:
All the jar's needed to compile are in the single jar file which is added in dependency.............................
Please help me!
my pom:
<project>
<!-- ... -->
<dependencies>
<dependency>
<groupId>eagle</groupId>
<artifactId>zkui</artifactId>
<version>360LTS</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
</dependencies>
<build>
<sourceDirectory>./src/main/java</sourceDirectory>
<outputDirectory>./target/classes</outputDirectory>
<finalName>${project.groupId}-${project.artifactId}</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</plugins>
</build>
</project>
error:
package org.zkoss.zk.ui does not exist
this package org.zkoss.zk.ui is in jar
file zkex.jar which is in dependency
jar eagle:zkui:360LTS jar file
Please Help ME!!!! :jumpingjoy:
Advance Thanks
Well I guess you could
use dependency:unpack to unpack the jars to target/lib or so (before compile)
deactivate compiler:compile by excluding everything
<excludes>
<exclude>**/*.java</exclude>
</exclude>
use antrun:run with the ant javac task to compile the sources, something like this (bind the execution to phase compile):
<target>
<javac srcdir="${project.build.sourceDirectory}"
destdir="${project.build.outputDirectory}">
<classpath>
<pathelement path="${maven.compile.classpath}"/>
<fileset dir="${project.build.directory}/lib">
<include name="**/*.jar"/>
</fileset>
</classpath>
</javac>
</target>
However, while that would help you compile your application, it would not help you run or deploy your application.
You can use the element to do this:
<dependencies>
<dependency>
<groupId>groep.does.not.matter</groupId>
<artifactId>neither-does-artifactId</artifactId>
<version>and.nor-does-version</version>
<type>jar</type>
<scope>system</scope>
<systemPath>${project.baseDir}/lib/jarname.jar</systemPath>
</dependency>
</dependencies>
where the jar you need to reference (and have in your classpath) is lib/jarname.jar, and the lib directory is in the root of your project.
I believe you're actually not using the proper dependencies. ZK actually have Maven repositories as described here.
You need to check which dependencies you need. For example for zkex, you would need something like:
<dependency>
<groupId>org.zkoss.zk</groupId>
<artifactId>zkex</artifactId>
<version>${zk.version}</version>
</dependency>
You will also need to add the ZK Maven repositories:
<repositories>
<repository>
<id>zk repository</id>
<url>http://mavensync.zkoss.org/maven2</url>
</repository>
<!-- If Using ZK EE or ZK PE Respository (not evaluation version), you need to add login info into ~/.m2/settings.xml -->
<repository>
<id>ZK PE Evaluation</id>
<url>http://mavensync.zkoss.org/zk/pe-eval</url>
</repository>
<repository>
<id>ZK EE Evaluation</id>
<url>http://mavensync.zkoss.org/zk/ee-eval</url>
</repository>
</repositories>
Good luck! :-)

google salve - maven

I tried to install google salve http://code.google.com/p/salve/ by adding following statements in the project's pom file:
However, when running mvn dependency:resolve it states "unable to find resource "salve:salve:jar:2.0" in repository salve
What's wrong?
<dependency>
<groupId>salve</groupId>
<artifactId>salve</artifactId>
<version>2.0</version>
</dependency>
<repository>
<id>salve</id>
<name>Google Maven Repository</name>
<url>http://salve.googlecode.com/svn/maven2/</url>
</repository>
The salve artifact you're mentioning is a pom (and indeed, there is no salve:salve:jar:2.0). If this is really the dependency you want to declare, you need to specify the type:
<project>
...
<repositories>
<repository>
<id>salve</id>
<name>Google Maven Repository</name>
<url>http://salve.googlecode.com/svn/maven2/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>salve</groupId>
<artifactId>salve</artifactId>
<version>2.0</version>
<type>pom</type>
</dependency>
...
</dependencies>
</project>
Honestly, I doubt you want the pom but I can't tell you which artifact you need.
Update: I guess you would have figured this out yourself but for salve-depend-guice, use the following dependency:
<dependency>
<groupId>salve</groupId>
<artifactId>salve-depend-guice</artifactId>
<version>2.0</version>
</dependency>
The dependencies of the above artifact will be downloaded transitively by Maven.

Maven circular dependency?

If I add this to a POM will it create a circular dependency? I've tried it and that what seems to happen. There is something I'm not understanding here. Isn't the war file created at the end of the build.
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>mywebapp</artifactId>
<version>${project.version}</version>
<type>war</type>
<scope>provided</scope>
</dependency>
My directory structure is root/functest, root/mywebapp.
Effective POM
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'help'.
[INFO] org.grails: checking for updates from tapestry.javaforge
[WARNING] *** CHECKSUM FAILED - Checksum failed on download: local = 'ee0f52bc37051384f078f9706be9445b550ee4a6'; remote = 'a535436f42caf1ba0f9372328d2920372f30c842' - RETRYING
[WARNING] *** CHECKSUM FAILED - Checksum failed on download: local = 'ee0f52bc37051384f078f9706be9445b550ee4a6'; remote = 'a535436f42caf1ba0f9372328d2920372f30c842' - IGNORING
[INFO] org.apache.maven.plugins: checking for updates from tapestry.javaforge
[INFO] org.codehaus.mojo: checking for updates from tapestry.javaforge
[INFO] artifact org.apache.maven.plugins:maven-help-plugin: checking for updates from tapestry.javaforge
[INFO] ------------------------------------------------------------------------
[INFO] Building functional-tests
[INFO] task-segment: [help:effective-pom] (aggregator-style)
[INFO] ------------------------------------------------------------------------
[INFO] [help:effective-pom]
[INFO]
Effective POMs, after inheritance, interpolation, and profiles are applied:
<?xml version="1.0" encoding="UTF-8"?>
<!-- ====================================================================== -->
<!-- -->
<!-- Generated by Maven Help Plugin on 9/30/09 10:41 AM -->
<!-- See: http://maven.apache.org/plugins/maven-help-plugin/ -->
<!-- -->
<!-- ====================================================================== -->
<!-- ====================================================================== -->
<!-- -->
<!-- Effective POM for project 'com.mycompany:functest:pom:1.0-SNAPSHOT' -->
<!-- -->
<!-- ====================================================================== -->
<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>
<parent>
<artifactId>myapp</artifactId>
<groupId>com.mycompany</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<groupId>com.mycompany</groupId>
<artifactId>functest</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>functional-tests</name>
<url>http://www.mycompany.com/functest</url>
<organization>
<name>My Company Inc</name>
<url>http://www.mycompany.com</url>
</organization>
<developers>
<developer>
<id>john.doe</id>
<name>John Doe</name>
<email>john.doe#mycompany.com</email>
</developer>
</developers>
<build>
<sourceDirectory>C:\Documents and Settings\ric\AutoSmokeTest\steps\step7\functest\src\main\java</sourceDirectory>
<scriptSourceDirectory>src/main/scripts</scriptSourceDirectory>
<testSourceDirectory>C:\Documents and Settings\ric\AutoSmokeTest\steps\step7\functest\src\it</testSourceDirectory>
<outputDirectory>C:\Documents and Settings\ric\AutoSmokeTest\steps\step7\functest\target\classes</outputDirectory>
<testOutputDirectory>C:\Documents and Settings\ric\AutoSmokeTest\steps\step7\functest\target\test-classes</testOutputDirectory>
<resources>
<resource>
<mergeId>resource-0</mergeId>
<directory>C:\Documents and Settings\ric\AutoSmokeTest\steps\step7\functest\src\main\resources</directory>
</resource>
</resources>
<testResources>
<testResource>
<mergeId>resource-1</mergeId>
<directory>C:\Documents and Settings\ric\AutoSmokeTest\steps\step7\functest\src\test\resources</directory>
</testResource>
</testResources>
<directory>C:\Documents and Settings\ric\AutoSmokeTest\steps\step7\functest\target</directory>
<finalName>functest-1.0-SNAPSHOT</finalName>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.3</version>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2-beta-2</version>
</plugin>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>2.2</version>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.0.2</version>
</plugin>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.0</version>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.4</version>
</plugin>
<plugin>
<artifactId>maven-ear-plugin</artifactId>
<version>2.3.1</version>
</plugin>
<plugin>
<artifactId>maven-ejb-plugin</artifactId>
<version>2.1</version>
</plugin>
<plugin>
<artifactId>maven-install-plugin</artifactId>
<version>2.2</version>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>2.2</version>
</plugin>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.5</version>
</plugin>
<plugin>
<artifactId>maven-plugin-plugin</artifactId>
<version>2.4.3</version>
</plugin>
<plugin>
<artifactId>maven-rar-plugin</artifactId>
<version>2.2</version>
</plugin>
<plugin>
<artifactId>maven-release-plugin</artifactId>
<version>2.0-beta-8</version>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>2.3</version>
</plugin>
<plugin>
<artifactId>maven-site-plugin</artifactId>
<version>2.0-beta-7</version>
</plugin>
<plugin>
<artifactId>maven-source-plugin</artifactId>
<version>2.0.4</version>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.4.3</version>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.1-alpha-2</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.0.2</version>
<executions>
<execution>
<goals>
<goal>testCompile</goal>
</goals>
</execution>
</executions>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.4.3</version>
<executions>
<execution>
<phase>integration-test</phase>
<goals>
<goal>test</goal>
</goals>
</execution>
</executions>
<configuration>
<suiteXmlFiles>
<suiteXmlFile>src/it/testng.xml</suiteXmlFile>
</suiteXmlFiles>
<parallel>true</parallel>
<threadCount>10</threadCount>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<version>1.0.1-alpha-1</version>
<executions>
<execution>
<id>start-container</id>
<phase>pre-integration-test</phase>
<goals>
<goal>start</goal>
<goal>deploy</goal>
</goals>
<configuration>
<deployer>
<deployables>
<deployable>
<groupId>com.mycompany</groupId>
<artifactId>mywebapp</artifactId>
<type>war</type>
<pingURL>http://localhost:8080/mywebapp/index.html</pingURL>
<pingTimeout>300000</pingTimeout>
<properties>
<context>mywebapp</context>
</properties>
</deployable>
</deployables>
</deployer>
</configuration>
</execution>
<execution>
<id>stop-container</id>
<phase>post-integration-test</phase>
<goals>
<goal>stop</goal>
</goals>
</execution>
</executions>
<configuration>
<wait>false</wait>
<container>
<containerId>tomcat5x</containerId>
<zipUrlInstaller>
<url>http://www.apache.org/dist/tomcat/tomcat-5/v5.5.28/bin/apache-tomcat-5.5.28.zip</url>
<installDir>${installDir}</installDir>
</zipUrlInstaller>
<output>C:\Documents and Settings\ric\AutoSmokeTest\steps\step7\functest\target/tomcat5x.log</output>
<log>C:\Documents and Settings\ric\AutoSmokeTest\steps\step7\functest\target/cargo.log</log>
</container>
<configuration>
<home>C:\Documents and Settings\ric\AutoSmokeTest\steps\step7\functest\target/tomcat5x/container</home>
<properties>
<cargo.logging>high</cargo.logging>
<cargo.servlet.port>8080</cargo.servlet.port>
</properties>
</configuration>
</configuration>
</plugin>
<plugin>
<artifactId>maven-help-plugin</artifactId>
<version>2.1</version>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<releases>
<enabled>false</enabled>
</releases>
<snapshots />
<id>public-snapshots</id>
<url>http://public-snapshots</url>
</repository>
<repository>
<releases />
<snapshots />
<id>openqa-releases</id>
<url>http://nexus.openqa.org/content/repositories/releases</url>
</repository>
<repository>
<id>openqa</id>
<url>http://maven.openqa.org</url>
</repository>
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>Maven Repository Switchboard</name>
<url>http://repo1.maven.org/maven2</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<releases>
<enabled>false</enabled>
</releases>
<snapshots />
<id>public-snapshots</id>
<url>http://public-snapshots</url>
</pluginRepository>
<pluginRepository>
<releases />
<snapshots />
<id>openqa-plugin</id>
<url>http://nexus.openqa.org/content/repositories/releases</url>
</pluginRepository>
<pluginRepository>
<releases />
<snapshots />
<id>another-plugin</id>
<url>http://repo1.maven.org/maven2</url>
</pluginRepository>
<pluginRepository>
<releases />
<id>codehaus.snapshots</id>
<url>http://snapshots.repository.codehaus.org/</url>
</pluginRepository>
<pluginRepository>
<id>mortbay.repo</id>
<url>http://www.mortbay.org/maven2/snapshot</url>
</pluginRepository>
<pluginRepository>
<id>tapestry.javaforge</id>
<url>http://howardlewisship.com/repository</url>
</pluginRepository>
<pluginRepository>
<releases>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>Maven Plugin Repository</name>
<url>http://repo1.maven.org/maven2</url>
</pluginRepository>
</pluginRepositories>
<dependencies>
<dependency>
<groupId>com.mycompany</groupId>
<artifactId>mywebapp</artifactId>
<version>1.0-SNAPSHOT</version>
<type>war</type>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium.server</groupId>
<artifactId>selenium-server</artifactId>
<version>1.0.1</version>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium.client-drivers</groupId>
<artifactId>selenium-java-client-driver</artifactId>
<version>1.0.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>5.1</version>
<classifier>jdk15</classifier>
<scope>test</scope>
</dependency>
</dependencies>
<reporting>
<outputDirectory>C:\Documents and Settings\ric\AutoSmokeTest\steps\step7\functest\target/site</outputDirectory>
</reporting>
</project>
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3 seconds
[INFO] Finished at: Wed Sep 30 10:41:00 CEST 2009
[INFO] Final Memory: 7M/13M
[INFO] ------------------------------------------------------------------------
It will only create a cyclic dependency if mywebapp is dependent on functest (or transitively dependent on it). From the name I would guess that functest is a test component so no such dependency would exist.
As you've seen, it is valid to substitute properties into dependency declarations, Maven will fail the build if it does result in a cycle.
I guess your confusion around "Isn't the war file created at the end of the build." is because you expect the build to fail as functest is built before mywebapp? Remember that Maven has access to local and remote repositories, so the result of any previous build of mywebapp will be available in the repository. If this is the case, try deleting mywebapp from you local/remote repositories and I suspect you will see the build fail due to an unresolved dependency.
If I add this to a POM will it create a circular dependency?
If the pom you are referring to is the pom of the functest module, adding a dependency to the mywebapp module will create a circular dependency only if the mywebapp module already depends on the functest module (which should not be the case here) as stated by Rich in another answer.
I've tried it and that what seems to happen.
Are you sure? Is your multi-modules project well defined? Can you show us the parent pom? Can you provide the trace obtained when launching maven from the parent?
[...] Isn't the war file created at the end of the build?
Well... it depends on what you are doing.
If you are strictly following Automated Smoke Tests With Selenium, Cargo, TestNG and Maven, please note that the author is not really covering the multi-modules project setup (I'm not saying he's not doing it, I'm just saying he's not covering that part) but only the functional testing project setup. He always launch maven from the functest directory, never as a reactor from the parent pom, and the webapp deployed by cargo in the step 7 is treated like an "external" dependency.
Now, if you are developing your own webapp, building it prior to run functional tests on it really makes sense. Actually, this would be the "recommended" approach. In your case, be sure to declare mywebapp as a dependency of functest and to declare both projects as modules of the parent pom, i.e. something like that (if the parent pom is in a parent directory):
...
<modules>
<module>mywebapp</module>
<module>functest</module>
</modules>
...