Maven cannot deploy parent pom

I just started building apps with Maven. One of my approaches is to create a multi-module web application. Working with Eclipse makes it easy to create such an application. So far, everything is working fine. The point at which I fail is deployment. I use Wildfly as my application server and the presentation tier deployment works well. But when I want to deploy from the parent project, I get this message:

Failed to execute goal org.wildfly.plugins:wildfly-maven-plugin:1.0.1.Final:deploy (default-cli) on project build: Error executing FORCE_DEPLOY: C:\Users\*****\Desktop\workspace\mvnexbook-examples-1.0\ch-multi\target\parent-0.8-SNAPSHOT.maven-project (No such file or directory) 

This is very confusing. Is deployment deployed from previously installed files in the .m2 / repository folder? Do I need a destination directory in the parent folder?

My parent pom file

 <?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.sonatype.mavenbook.multi</groupId> <artifactId>simple-parent</artifactId> <version>0.8-SNAPSHOT</version> </parent> <artifactId>simple-webapp</artifactId> <packaging>war</packaging> <name>Multi Chapter Simple Web Application Project</name> <dependencies> <dependency> <groupId>org.apache.geronimo.specs</groupId> <artifactId>geronimo-servlet_2.4_spec</artifactId> <version>1.1.1</version> </dependency> <dependency> <groupId>org.sonatype.mavenbook.multi</groupId> <artifactId>simple-weather</artifactId> <version>${project.version}</version> </dependency> </dependencies> <build> <finalName>simple-webapp</finalName> <plugins> <plugin> <groupId>org.wildfly.plugins</groupId> <artifactId>wildfly-maven-plugin</artifactId> </plugin> </plugins> </build> </project> 

EDIT . I just tried it with the pier. Works great. Why doesn't he work with Wildfly?

EDIT2 . I use an example of a simple parent project from a sonata book.

+8
maven jboss wildfly multi-module
source share
2 answers

In the parent POM, you need to add <skip>true</skip> to the configuration. Then set this parameter to false for your WAR POM.

Parent POM

 <plugin> <groupId>org.wildfly.plugins</groupId> <artifactId>wildfly-maven-plugin</artifactId> <version>1.0.1.Final</version> <configuration> <skip>true</skip> </configuration> </plugin> 

WAR POM

 <plugin> <groupId>org.wildfly.plugins</groupId> <artifactId>wildfly-maven-plugin</artifactId> <configuration> <skip>false</skip> </configuration> </plugin> 
+17
source share

Your EAR application is probably not in the parent folder of the project creation. It is probably in the APP module assembly project. If you look here: you will see that there is a default targetDir for building the directory of the current project. You can specify a different value. The file_name parameter points to the file name. It defaults to $ {project.build.finalName}. $ {Project.packaging}, and in your case it does not have a meaningful extension.

You might want to try something like

  <configuration> <targetDir>path</targetDir> <filename>filename</filename> </configuration> 

for your plugin. Of course you can use a relative path. You can also try to run the plugin from the APP project.

+1
source share

All Articles