Error: Plugin execution not covered by lifecycle configuration maven error - eclipse

I have a flex project that I need to convert into a maven project. I am using m2e for Eclipse and at the bottom of this post is the POM.xml file that I have created.
My issue is that I cannot seem to run a mvn clean install on this POM. In Eclipse there is an error highlighting the first "plugin" line that says:
-Plugin execution not covered by lifecycle configuration:
org.sonatype.flexmojos:flexmojos-maven-plugin:3.7.1:test-compile
(execution: default-test-compile, phase: test-compile)
and
-Plugin execution not covered by lifecycle configuration:
org.sonatype.flexmojos:flexmojos-maven-plugin:3.7.1:compile-swf
(execution: default-compile-swf, phase: compile)
Beyond that, if I do run the mvn clean install I get a different error:
Failed to execute goal org.sonatype.flexmojos:flexmojos-maven-plugin:
3.7.1:compile-swf (default-compile-swf) on project flex: Failure to find
com.adobe.flex.framework:framework:rb.swc:en_US:3.2.0.3958 in
nexusserver/nexus/content/groups/public was cached in the local repository,
resolution will not be reattempted until the update interval of nexus has
elapsed or updates are forced
I am looking at the nexus server and I see:
-com\adobe\flex\framework\framework\3.2.0.3958
Inside there are a bunch of zips and stuff, and the file: framework-3.2.0.3958.rb.swc
So I'm not sure what actually the problem is. I'm still a bit of a maven novice and I've never actually used flex before so I think I am just a little overwhelmed at the moment. Does anyone have any ideas how to fix at least one of the issues? Thank you for your time.
edit: Even worse, the file is located in my local repository so I have no idea why it isn't seeing it.
--
POM.xml
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated from the following command: mvn archetype:generate -DarchetypeRepository=http://repository.sonatype.org/content/groups/public
-DarchetypeGroupId=org.sonatype.flexmojos -DarchetypeArtifactId=flexmojos-archetypes-application
-DarchetypeVersion=3.7.1 -->
<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.company.ref</groupId>
<artifactId>flex</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>swf</packaging>
<name>flex</name>
<build>
<plugins>
<plugin>
<groupId>org.sonatype.flexmojos</groupId>
<artifactId>flexmojos-maven-plugin</artifactId>
<version>3.7.1</version>
<extensions>true</extensions>
<configuration>
<locales>
<locale>en_US</locale>
</locales>
</configuration>
</plugin>
</plugins>
<sourceDirectory>src/main/flex</sourceDirectory>
<testSourceDirectory>src/test/flex</testSourceDirectory>
<pluginManagement>
<plugins>
<!--This plugin's configuration is used to store Eclipse m2e settings
only. It has no influence on the Maven build itself. -->
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.codehaus.mojo</groupId>
<artifactId>aspectj-maven-plugin</artifactId>
<versionRange>[1.0,)</versionRange>
<goals>
<goal>test-compile</goal>
<goal>compile</goal>
</goals>
</pluginExecutionFilter>
<action>
<execute />
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
<dependencies>
<dependency>
<groupId>com.adobe.flex.framework</groupId>
<artifactId>flex-framework</artifactId>
<version>3.2.0.3958</version>
<type>pom</type>
</dependency>
</dependencies>
<profiles>
<profile><!--https://docs.sonatype.org/pages/viewpage.action?pageId=2949459 -->
<id>m2e</id>
<activation>
<property>
<name>m2e.version</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.maven.ide.eclipse</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>0.9.9-SNAPSHOT</version>
<configuration>
<mappingId>customizable</mappingId>
<configurators>
<configurator
id='org.maven.ide.eclipse.configuration.flex.configurator' />
</configurators>
<mojoExecutions>
<mojoExecution>org.apache.maven.plugins:maven-resources-plugin::</mojoExecution>
</mojoExecutions>
</configuration>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.4</version>
</plugin>
</plugins>
</pluginManagement>
</build>
</profile>
</profiles>
This is the full error I get:
[INFO] Apache License - Version 2.0 (NO WARRANTY) - See COPYRIGHT file
[WARNING] Source file was not defined, flexmojos will guess one.
[WARNING] Not defined if locales should be merged or not
[WARNING] Unable to find license.jar on classpath. Check wiki for instructions about how to add it:
URL
Downloading: nexusURL/nexus/content/groups/public/com/adobe/flex/framework/framework/3.2.0.3958/framework-3.2.0.3958-en_US.rb.swc
[INFO] Unable to find resource 'com.adobe.flex.framework:framework:rb.swc:en_US:3.2.0.3958' in repository central (central)
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Unable to download the artifact from any repository
Try downloading the file manually from the project website.
Then, install it using the command:
mvn install:install-file -DgroupId=com.adobe.flex.framework -DartifactId=framework -Dversion=3.2.0.3958 -Dclassifier=en_US -Dpackaging=rb.swc -Dfile=/path/to/file
Alternatively, if you host your own repository you can deploy the file there:
mvn deploy:deploy-file -DgroupId=com.adobe.flex.framework -DartifactId=framework -Dversion=3.2.0.3958 -Dclassifier=en_US -Dpackaging=rb.swc -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
com.adobe.flex.framework:framework:rb.swc:3.2.0.3958
from the specified remote repositories: central
Update 3:This is my new POM:
<?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.company.table</groupId>
<artifactId>flex</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>swf</packaging>
<name>flex</name>
<repositories>
<repository>
<id>flex-mojos-repository</id>
<url>https://repository.sonatype.org/content/groups/flexgroup</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>flex-mojos-repository</id>
<url>https://repository.sonatype.org/content/groups/flexgroup</url>
</pluginRepository>
</pluginRepositories>
<build>
<plugins>
<plugin>
<groupId>org.sonatype.flexmojos</groupId>
<artifactId>flexmojos-maven-plugin</artifactId>
<version>3.7.1</version>
<extensions>true</extensions>
</plugin>
</plugins>
<sourceDirectory>src/main/flex</sourceDirectory>
<testSourceDirectory>src/test/flex</testSourceDirectory>
</build>
<dependencies>
<dependency>
<groupId>com.adobe.flex.framework</groupId>
<artifactId>flex-framework</artifactId>
<version>3.2.0.3958</version>
<type>pom</type>
</dependency>
</dependencies>

Related

Could not understand about Maven pom file using Eclipse

I am very new to Maven and i am creating my first maven project of maven-archetype-quickstart
Then it generates the error message ::
But in my project explorer :
I am unable to understand that why it is creating a proper maven project every time it shows a red warning mark into my project and as well as in my pom.xml file.
> 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.akash</groupId>
<artifactId>feind</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>feind</name>
<!-- FIXME change it to the project's website -->
<url>http://www.example.com</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
<plugins>
<!-- clean lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#clean_Lifecycle -->
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>3.1.0</version>
</plugin>
<!-- default lifecycle, jar packaging: see https://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging -->
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.0.2</version>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.1</version>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>3.0.2</version>
</plugin>
<plugin>
<artifactId>maven-install-plugin</artifactId>
<version>2.5.2</version>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
</plugin>
<!-- site lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#site_Lifecycle -->
<plugin>
<artifactId>maven-site-plugin</artifactId>
<version>3.7.1</version>
</plugin>
<plugin>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>3.0.0</version>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
settings.xml
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<!-- Change username in below line -->
<localRepository>/Users/COACH/.m2/repository</localRepository>
<interactiveMode>true</interactiveMode>
<offline>false</offline>
<pluginGroups>
<!-- pluginGroup
| Specifies a further group identifier to use for plugin lookup.
<pluginGroup>com.your.plugins</pluginGroup>
-->
</pluginGroups>
<proxies>
<!--
<proxy>
<id>optional</id>
<active>true</active>
<protocol>http</protocol>
<username>proxyuser</username>
<password>proxypass</password>
<host>proxy.host.net</host>
<port>80</port>
<nonProxyHosts>local.net|some.host.com</nonProxyHosts>
</proxy>
-->
</proxies>
<servers>
<!--
<server>
<id>deploymentRepo</id>
<username>crunchify</username>
<password>crunchify</password>
</server>
-->
</servers>
<mirrors>
<!--
<mirror>
<id>mirrorId</id>
<mirrorOf>repositoryId</mirrorOf>
<name>mirror description</name>
<url>http://my.repository.com/repo/path</url>
</mirror>
-->
</mirrors>
<profiles>
</profiles>
</settings>
I am fail to understand that why this happening every time to me and my .m2\repository folder is also empty . Please suggest me some steps to fix it and properly run a maven project.
Since i am not behind any proxy so i don't need to worry about the settings.xml file i just deleted .m2 folder and just simply try to create a maven project again
and maven itself downloads the required dependencies automatically.
Hence problem is resolved.
As reputable sources go:
apache/maven PR 38 illustrates you should not define any M2_HOME (not with recent maven versions)
apache-maven/src/bin/mvn shows that, if MAVEN_HOME is not defined, it defaults to where maven is installed.
By deleting your ~/.m2 folder, you have forced Eclipse (through m2e, included in any Eclipse 4.5 or newer), to revert back to a default m2 folder.
It also uses, per FAQ, the default <maven home>/conf/settings.xml

Could not resolve dependencies, Failure to find jar

I'm trying to run vaadin-charts-demo.
Similar issue to this:
Maven Could not resolve dependencies, artifacts could not be resolved
[INFO] <<< vaadin-maven-plugin:7.4.6:compile (default-cli) < process-resources # vaadin-charts-demo <<<
[WARNING] The POM for com.vaadin.demo:vaadin-charts-examples:jar:3.0-SNAPSHOT is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.414 s
[INFO] Finished at: 2015-07-09T20:57:33-05:00
[INFO] Final Memory: 12M/225M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project vaadin-charts-demo: Could not resolve dependencies for project com.vaadin.demo:vaadin-charts-demo:war:3.0-SNAPSHOT: Failure to find com.vaadin.demo:vaadin-charts-examples:jar:3.0-SNAPSHOT in https://maven.vaadin.com/vaadin-addons was cached in the local repository, resolution will not be reattempted until the update interval of vaadin-addons has elapsed or updates are forced -> [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/DependencyResolutionException
pom.xml content:
<?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">
<parent>
<groupId>com.vaadin.addon</groupId>
<artifactId>vaadin-charts-parent</artifactId>
<version>3.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>com.vaadin.demo</groupId>
<artifactId>vaadin-charts-demo</artifactId>
<packaging>war</packaging>
<name>Vaadin Charts Demo</name>
<dependencies>
<dependency>
<groupId>com.vaadin.addon</groupId>
<artifactId>vaadin-charts</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.vaadin.demo</groupId>
<artifactId>vaadin-charts-examples</artifactId>
<version>${project.version}</version>
</dependency>
<!-- Vaadin -->
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-server</artifactId>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-themes</artifactId>
</dependency>
<dependency>
<groupId>org.reflections</groupId>
<artifactId>reflections</artifactId>
<version>0.9.8</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.4</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.4</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-webapp</artifactId>
<version>8.1.13.v20130916</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.vaadin.addons</groupId>
<artifactId>googleanalyticstracker</artifactId>
<version>2.1.0</version>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-maven-plugin</artifactId>
<version>7.6.0.alpha2</version>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
<includes>
<include>**/config.properties</include>
</includes>
</resource>
<resource>
<directory>src/main/resources</directory>
<filtering>false</filtering>
<excludes>
<exclude>**/config.properties</exclude>
</excludes>
</resource>
</resources>
<plugins>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.4</version>
<configuration>
<packagingExcludes>**/gwt-unitCache/*,**/widgetsets/WEB-INF/**/*</packagingExcludes>
</configuration>
</plugin>
<!-- As we are doing "inplace" GWT compilation, ensure the widgetset -->
<!-- directory is cleaned properly -->
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>2.4.1</version>
<configuration>
<filesets>
<fileset>
<directory>src/main/webapp/VAADIN/widgetsets</directory>
</fileset>
</filesets>
</configuration>
</plugin>
<plugin>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-maven-plugin</artifactId>
<configuration>
<extraJvmArgs>-Xmx512M -Xss1024k</extraJvmArgs>
<!-- We are doing "inplace" but into subdir VAADIN/widgetsets.
This way compatible with Vaadin eclipse plugin. -->
<webappDirectory>${basedir}/src/main/webapp/VAADIN/widgetsets
</webappDirectory>
<hostedWebapp>${basedir}/target/ignore/VAADIN/widgetsets
</hostedWebapp>
<noServer>true</noServer>
<!-- Remove draftCompile when project is ready -->
<draftCompile>false</draftCompile>
<compileReport>true</compileReport>
<!-- <style>PRETTY</style> -->
<strict>true</strict>
<runTarget>http://localhost:8080/</runTarget>
</configuration>
<executions>
<execution>
<goals>
<goal>resources</goal>
<goal>update-widgetset</goal>
</goals>
</execution>
<execution>
<id>compile-widgetset-on-compile</id>
<phase>compile</phase>
<goals>
<goal>compile</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
Tried googling vaadin-chart-examples and chart-demos maven, repository, etc., but haven't found a solution. How can this be resolved?
[[edit]]
The project is imported from here:
https://github.com/vaadin/charts/tree/7a55e8dab5b9941a05603c2624a576866e86045d
Following these instructions:
https://github.com/vaadin/charts/blob/7a55e8dab5b9941a05603c2624a576866e86045d/DevInstructions.md
After install, couldn't compile widgets
The instructions are for Luna, I'm using Mars, not sure how that affects things.
Did you try adding this repository for Vaadin add-ons:
<repository>
<id>vaadin-addons</id>
<url>http://maven.vaadin.com/vaadin-addons</url>
</repository>
If you built just vaadin-charts-demo so far build vaadin-charts-parent before, as well.
The parent includes vaadin-charts-examples as <module>. So, if you don't build parent (or examples explicitely) at least once, none of the modules' artifacts is available in your Eclipse workspace and your local Maven repo to be resolved from there.
Remember, Aggregation and Inheritance are different types of POM Relationships.
For resolving dependencies from your Eclipse workspace see <Your Eclipse Maven project> → Properties → Maven → [✔] Resolve dependencies from Workspace projects.

Maven local repo not updated with latest dependency

My project has a pom.xml which I did deploy to a remote repository inside my company
<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>ProjectMav</groupId>
<artifactId>ProjectMav</artifactId>
<version>1.0</version>
<distributionManagement>
<repository>
<id>man-release</id>
<name>mav release repo</name>
<url>http://xxxxxx.net/repositories/mav-release/</url>
</repository>
<snapshotRepository>
<id>mav-snapshots</id>
<name>mav snapshots repo</name>
<url>http://xxxxxx.net/repositories/mav-snapshots/</url>
</snapshotRepository>
</distributionManagement>
<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
After I do a 'mvn deploy' I did browse the remote repository and I see the project there
I have another project that is dependent on the above mentioned 'ProjectMav' and it's POM.xml is as follows
<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>mavtest</groupId>
<artifactId>mavtest-suite</artifactId>
<version>1.0</version>
<dependencies>
<dependency>
<groupId>ProjectMav</groupId>
<artifactId>ProjectMav</artifactId>
<version>1.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
<repositories>
<repository>
<id>mav-release</id>
<name>mav release repo</name>
<url>http://xxxxxx.net/repositories/mav-release/</url>
</repository>
</repositories>
<build>
<testSourceDirectory>src/com/mav/</testSourceDirectory>
<resources>
<resource>
<directory>/resources</directory>
<excludes>
<exclude>**/*.java</exclude>
</excludes>
</resource>
</resources>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
Now from eclipse if I do a Maven>update project it does not get the latest version of my 'ProjectMav' to my local repository.
But if I clear all the files in my local repo and do a maven update it gets my project
Any idea what's going on?
I believe the issue is that the maven eclipse plugin's update doesn't actually do a mvn install which is what you need if you want to override the 1.0 deployed version. The way the mvn eclipse plugin orders classpath dependencies (which you can clearly see in the package explorer is to put the dependency jars first and then the resolved upstream projects after the jars). This seems to work fine for SNAPSHOT projects as the plugin knows to use your project and not the jars but for release jars it gets confused (or at least I have noticed it to).
That being said you should avoid this issue altogether by changing the version of your local one to:
<version>1.1-SNAPSHOT</version>
Then in your downstream projects that depend on ProjectMav you update their dependencies to 1.1-SNAPSHOT. The management of versions can be tricky so you might want to look into the maven release plugin and have it deal with version-ing of your project when you deploy.

How to deploy ear into WildFly 8.0 via eclipse IDE

I have installed the JBoss AS tools in my eclipse. Then I have created an WildFly 8.0 server. I have parent project pom.xml like below:
<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.company</groupId>
<artifactId>trx-server-parent</artifactId>
<version>1.0.0</version>
<packaging>pom</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java-version>1.7</java-version>
<javaee-api-version>7.0</javaee-api-version>
</properties>
<modules>
<module>trx-server-ear</module>
<module>trx-server-domain</module>
<module>trx-server-services</module>
<module>trx-server-web</module>
</modules>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>${javaee-api-version}</version>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<pluginManagement>
<plugins>
<!-- compiler plugin -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.2</version>
<configuration>
<source>${java-version}</source>
<target>${java-version}</target>
<encoding>${project.build.sourceEncoding}</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.5</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ejb-plugin</artifactId>
<version>2.4</version>
<configuration>
<ejbVersion>3.2</ejbVersion>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ear-plugin</artifactId>
<version>2.9.1</version>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
And ear project pom.xml is like:
<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>
<groupId>com.company</groupId>
<artifactId>trx-server-parent</artifactId>
<version>1.0.0</version>
</parent>
<artifactId>trx-server-ear</artifactId>
<packaging>ear</packaging>
<dependencies>
<dependency>
<groupId>com.company</groupId>
<artifactId>trx-server-web</artifactId>
<version>${project.version}</version>
<type>war</type>
</dependency>
<dependency>
<groupId>com.company</groupId>
<artifactId>trx-server-services</artifactId>
<version>${project.version}</version>
<type>ejb</type>
</dependency>
</dependencies>
<build>
<finalName>trx-server</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ear-plugin</artifactId>
<configuration>
<finalName>trx-server</finalName>
<version>7</version>
<defaultJavaBundleDir>lib/</defaultJavaBundleDir>
<modules>
<webModule>
<groupId>com.company</groupId>
<artifactId>trx-server-web</artifactId>
<contextRoot>/trx-server-web</contextRoot>
</webModule>
<ejbModule>
<groupId>com.company</groupId>
<artifactId>trx-server-services</artifactId>
</ejbModule>
</modules>
</configuration>
</plugin>
</plugins>
</build>
</project>
I defined the trx-server-domain module as jar file and packaged into the lib folder. When run mvn clean install on my parent pom.xml, I got an ear file named trx-server.ear. Then the trx-server.ear file structure is like:
-- trx-server
-- lib
-- trx-server-domain-1.0.0.jar
-- trx-server-services-1.0.0.jar
-- trx-server-web-1.0.0.war
I can deploy this ear file to WildFly server manually (via web management page). Everything is fine for that.
My problem is when I deploy some changes via Eclipse, I mean via the server adapter. The root web contextRoot is not what I defined in the ear project pom.xml file. And the trx-server-domain will be deploy as EJB which should be a jar file under lib folder.
I got a trx-server-ear.ear folder in the WildFly deployments directory which is not what I wanted. The structures of this folder is:
trx-server-ear.ear
-- trx-server-domain-1.0.0.jar
-- trx-server-services-1.0.0.jar
-- trx-server-web-1.0.0.war
No lib folder and all jar/war files are in same level.
The problem only exist when I deploy the ear in the Eclipse. Is there any other plungin I should install?
Anyone could give me example of how to configure the ear with multiple modules?

Can't override POM property on the command line while executing release:perform

Given this complete Maven POM file that is meant to be used as a root POM for packaged (JAR, WAR, etc) projects or non packaged projects (for example web pages) that still should be tagged with a new release tag ...
<?xml version="1.0" encoding="ISO-8859-1"?>
<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>
<name>Common Maven parent POM</name>
<description>Maven parent POM for common POM properties for any type of project</description>
<url>http://my.site.com</url>
<groupId>com.my.site</groupId>
<artifactId>mvn-common</artifactId>
<version>0.12-SNAPSHOT</version>
<packaging>pom</packaging>
<properties>
<eclipse.projectName>${project.name} ${project.version}</eclipse.projectName>
<mvn.local.repo.root>file:///C:/.m2</mvn.local.repo.root>
<scm.url.root>https://localhost/svn</scm.url.root>
<scm.url.project>workspace/tools/maven/pom/mvn-common</scm.url.project>
<scm.url.trunk>scm:svn:${scm.url.root}/${scm.url.project}/trunk</scm.url.trunk>
<scm.url.tag>${scm.url.root}/${scm.url.project}/tags</scm.url.tag>
<!-- Deploy makes only sense to packaged artifacts -->
<skip.deploy>true</skip.deploy>
</properties>
<scm><developerConnection>${scm.url.trunk}</developerConnection></scm>
<distributionManagement>
<repository>
<id>mvn.repo.releases</id>
<url>${mvn.local.repo.root}/releases</url>
</repository>
<snapshotRepository>
<id>mvn.repo.snapshots</id>
<url>${mvn.local.repo.root}/snapshots</url>
</snapshotRepository>
</distributionManagement>
<repositories>
<!-- These must also be defined in the local settings as <servers> -->
<repository>
<id>mvn.repo</id>
<url>${mvn.local.repo.root}/repo</url>
</repository>
<repository>
<id>mvn.repo.releases</id>
<url>${mvn.local.repo.root}/releases</url>
</repository>
<repository>
<id>mvn.repo.snapshots</id>
<url>${mvn.local.repo.root}/snapshots</url>
</repository>
</repositories>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.2.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.1</version>
<configuration>
<skip>${skip.deploy}</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.9</version>
<configuration>
<projectNameTemplate>${eclipse.projectName}</projectNameTemplate>
<downloadSources>true</downloadSources>
<downloadJavadocs>true</downloadJavadocs>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.4.2</version>
<configuration>
<tagBase>${scm.url.tag}</tagBase>
</configuration>
</plugin>
</plugins>
<extensions>
<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ftp</artifactId>
<version>2.5</version>
</extension>
</extensions>
</build>
</project>
... can I not get the property true overridden on the command line when I execute
mvn release:prepare && mvn -Dskip.deploy=false release:perform
The property is used to set the configuration value for the maven-deploy-plugin to skip deploy as default (which should be overridden in a sub POM for packaged projects) and I believe that it should be possible to override a user defined property like this but not a Maven property which would be maven.deploy.skip in this case.
The release works fine in that it properly creates a new tagged version of the POM in the SVN repository but I can't get the maven-deploy-plugin to recognise the value for the property set on the command line
[INFO] [INFO] --- maven-deploy-plugin:2.8.1:deploy (default-deploy) # mvn-common ---
[INFO] [INFO] Skipping artifact deployment
[INFO] [INFO] ------------------------------------------------------------------------
Am I overlooking something here? A bug somewhere here could be an explanation but I have not found any reported that applies when I have searched around. It would be great if someone could see anything that looks incorrect or give me at tip on what to try next.
I eventually found the answer myself in Properties lost during Maven release:perform where the answer explained that there is a forked process for release so to get the command line property recognised and have it to override the property set in the POM must it be passed through as
-Darguments=-D...
and the command I must use then looks like this
mvn release:prepare && mvn release:perform -Darguments=-Dskip.deploy=false
Thanks to myself for answering this question and thanks Stephen Connolly that answered the other thread. It is just sad that I didn't find that answer until know in all the noise that come up when I try to google for it.