-
Bug
-
Resolution: Not a Bug
-
Minor
-
None
-
None
-
None
The maven wildfly plugin, in general (independent of the deploy goal), seems to always require a pom.xml even if we would simply wish to invoke the goals as stand-alone commands and not bound to any particular maven life cycle phase.
This is not ideal when configuring a CI environment, as it forces a dummy pom.xml to have to be written for the sake of invoking start/shutdown/etc gooals, where all configuration comes via system properties.
However, the maven deploy goal seems to be very particular.
While trying to trigger a maven deploy task with perfect -D system properties passed on the maven call.
E.g.
mvn org.wildfly.plugins:wildfly-maven-plugin:1.2.0.Alpha6:deploy -Dwildfly.timeout=90 -Dwildfly.port=9990 -Dwildfly.username=admin -Dwildfly.password=admin -Dwildfly.deployment.filename=dummy-war.war -Dwildfly.deployment.name=dummy-war.war -Dwildfly.deployment.targetDir=D:/jenkins/workspace/System_Test_Build/dummy-project/dummy-war/target
D:\WildflyBase\wildfly-10.1.0.Final\user_projects\domains\dummyDomain\bin>mvn org.wildfly.plugins:wildfly-maven-plugin:1.2.0.Alpha6:deploy -Dwildfly.timeout=90 -Dwildfly.port=9990 -Dwildfly.username=admin -Dwildfly.password=admin -Dwildfly.deploym ent.filename=dummy-war.war -Dwildfly.deployment.name=dummy-war.war -Dwildfly.deployment.targetDir=D:/jenkins/workspace/System_Test_Build/dummy-project/dummy-war/target
[INFO] Scanning for projects... [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building Wildfly Server Maven Plugin 0.0.0-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] >>> wildfly-maven-plugin:1.2.0.Alpha6:deploy (default-cli) > package @ wildfly-maven-plugin-runner >>> [INFO] [INFO] --- maven-plugin-plugin:3.2:descriptor (mojo-descriptor) @ wildfly-maven-plugin-runner --- [INFO] [INFO] <<< wildfly-maven-plugin:1.2.0.Alpha6:deploy (default-cli) < package @ wildfly-maven-plugin-runner <<< [INFO] [INFO] --- wildfly-maven-plugin:1.2.0.Alpha6:deploy (default-cli) @ wildfly-maven-plugin-runner --- [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 1.287 s [INFO] Finished at: 2017-08-03T20:25:05+02:00 [INFO] Final Memory: 14M/309M [INFO] ------------------------------------------------------------------------
The above build success of course makes no sense.
The paths are not correct, the domain is not even start on the local machine.
The original dummy pom used that never succeeded to deploy anything, depsite perfect -D properties was of the form:
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <project> <modelVersion>4.0.0</modelVersion> <groupId>com.artificialpom</groupId> <artifactId>wildfly-maven-plugin-runner</artifactId> <packaging>pom</packaging> <version>0.0.0-SNAPSHOT</version> <name>Wildfly Server Maven Plugin</name> <url>http://maven.apache.org</url> <dependencies> </dependencies> <build> <pluginManagement> <plugins> <plugin> <groupId>org.wildfly.plugins</groupId> <artifactId>wildfly-maven-plugin</artifactId> <version>1.2.0.Alpha6</version> </plugin> </plugins> </pluginManagement> </build> </project>
With the above pom, we are ok to start/stop wildfly domains via system properties but not to deploy.
Eventually, It was possible to run a maven deployment.
But to do the pom had to be transformed into something that in my opinion is completely senseless.
Here is a pom that can deploy.
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <project> <modelVersion>4.0.0</modelVersion> <groupId>com.artificialpom</groupId> <artifactId>wildfly-maven-plugin-runner</artifactId> <packaging>maven-plugin</packaging> <version>0.0.0-SNAPSHOT</version> <name>Wildfly Server Maven Plugin</name> <url>http://maven.apache.org</url> <dependencies> </dependencies> <build> <plugins> <plugin> <groupId>org.wildfly.plugins</groupId> <artifactId>wildfly-maven-plugin</artifactId> <executions> <execution> <phase>prepare-package</phase> <goals> <goal>deploy</goal> </goals> </execution> </executions> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-plugin-plugin</artifactId> <version>3.2</version> <configuration> <skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound> </configuration> <executions> <execution> <id>mojo-descriptor</id> <goals> <goal>descriptor</goal> </goals> </execution> </executions> </plugin> </plugins> <pluginManagement> <plugins> <plugin> <groupId>org.wildfly.plugins</groupId> <artifactId>wildfly-maven-plugin</artifactId> <version>1.2.0.Alpha6</version> </plugin> </plugins> </pluginManagement> </build> </project>
With this pom, if I run the above deploy command without a server running.
I now have problems with the connection to port 9990.
D:\WildflyBase\wildfly-10.1.0.Final\user_projects\domains\dummyDomain\bin>mvn org.wildfly.plugins:wildfly-maven-plugin:1.2.0.Alpha6:deploy -Dwildfly.timeout=90 -Dwildfly.port=9990 -Dwildfly.username=admin -Dwildfly.password=admin -Dwildfly.deploym ent.filename=dummyProject-war.war -Dwildfly.deployment.name=dummyProject-war.war -Dwildfly.deployment.targetDir=D:/jenkins/workspace/System_Test_Build/dummyProject-project/dummyProject-war/target [INFO] Scanning for projects... [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building Wildfly Server Maven Plugin 0.0.0-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] >>> wildfly-maven-plugin:1.2.0.Alpha6:deploy (default-cli) > package @ wildfly-maven-plugin-runner >>> [INFO] [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ wildfly-maven-plugin-runner --- [WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent! [INFO] skip non existing resourceDirectory D:\WildflyBase\wildfly-10.1.0.Final\user_projects\domains\dummyDomain\bin\src\main\resources [INFO] [INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ wildfly-maven-plugin-runner --- [INFO] No sources to compile [INFO] [INFO] --- maven-plugin-plugin:3.2:descriptor (default-descriptor) @ wildfly-maven-plugin-runner --- [WARNING] Using platform encoding (Cp1252 actually) to read mojo metadata, i.e. build is platform dependent! [INFO] Applying mojo extractor for language: java [INFO] Mojo extractor for language: java found 0 mojo descriptors. [INFO] Applying mojo extractor for language: bsh [INFO] Mojo extractor for language: bsh found 0 mojo descriptors. [INFO] Applying mojo extractor for language: java-annotations [INFO] Mojo extractor for language: java-annotations found 0 mojo descriptors. [INFO] [INFO] --- maven-plugin-plugin:3.2:descriptor (mojo-descriptor) @ wildfly-maven-plugin-runner --- [WARNING] Using platform encoding (Cp1252 actually) to read mojo metadata, i.e. build is platform dependent! [INFO] Applying mojo extractor for language: java [INFO] Mojo extractor for language: java found 0 mojo descriptors. [INFO] Applying mojo extractor for language: bsh [INFO] Mojo extractor for language: bsh found 0 mojo descriptors. [INFO] Applying mojo extractor for language: java-annotations [INFO] Mojo extractor for language: java-annotations found 0 mojo descriptors. [INFO] [INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ wildfly-maven-plugin-runner --- [WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent! [INFO] skip non existing resourceDirectory D:\WildflyBase\wildfly-10.1.0.Final\user_projects\domains\dummyDomain\bin\src\test\resources [INFO] [INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ wildfly-maven-plugin-runner --- [INFO] No sources to compile [INFO] [INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ wildfly-maven-plugin-runner --- [INFO] No tests to run. [INFO] [INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ wildfly-maven-plugin-runner --- [INFO] Building jar: D:\WildflyBase\wildfly-10.1.0.Final\user_projects\domains\dummyDomain\bin\target\wildfly-maven-plugin-runner-0.0.0-SNAPSHOT.jar [INFO] [INFO] --- maven-plugin-plugin:3.2:addPluginArtifactMetadata (default-addPluginArtifactMetadata) @ wildfly-maven-plugin-runner --- [INFO] [INFO] <<< wildfly-maven-plugin:1.2.0.Alpha6:deploy (default-cli) < package @ wildfly-maven-plugin-runner <<< [INFO] [INFO] --- wildfly-maven-plugin:1.2.0.Alpha6:deploy (default-cli) @ wildfly-maven-plugin-runner --- Aug 03, 2017 8:33:40 PM org.jboss.remoting3.EndpointImpl <clinit> INFO: JBoss Remoting version 5.0.0.CR1 Aug 03, 2017 8:33:40 PM org.xnio.Xnio <clinit> INFO: XNIO version 3.5.0.CR1 Aug 03, 2017 8:33:40 PM org.xnio.nio.NioXnio <clinit> INFO: XNIO NIO Implementation Version 3.5.0.CR1 Aug 03, 2017 8:33:40 PM org.wildfly.security.Version <clinit> INFO: ELY00001: WildFly Elytron version 1.1.0.Beta54 [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 3.656 s [INFO] Finished at: 2017-08-03T20:33:41+02:00 [INFO] Final Memory: 20M/363M [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.wildfly.plugins:wildfly-maven-plugin:1.2.0.Alpha6:deploy (default-cli) on project wildfly-maven-plugin-runner: Failed to execute goal deploy. java.net.ConnectException: WFLYPRT0053: Could not connect to remote+http: //localhost:9990. The connection failed: Connection refused: no further information -
If with the above pom, we change the packaging from maven-plugin to "pom" type as in the original pom, the deploy goal will do absolutely nothing.
I believe this not expected behavior.
For the time being, I am using a very hacked pom to ensure that the deploy goal actually executes and does not return a blind success without taking any actions.
NOTE:
Existing related documentation on this topic.
https://docs.jboss.org/wildfly/plugins/maven/latest/examples/deployment-example.html