Can not deploy from maven after deploying using CLI on JBOSS - maven

On our jenkins we have a build pipe that as a last step deploys the artifact (ear file in this case) to a remote JBoss 6.4 server. This works fine as long as I don't install that same ear file using tje JBoss cli on the server. After that Maven complains:
Failed to execute goal org.jboss.as.plugins:jboss-as-maven-
plugin:7.7.Final:deploy (deploy) on project caretrack-ear:
Deployment failed and was rolled back. "JBAS018785: There is
already a deployment called foo-ear-1.0-SNAPSHOT.ear with the
same runtime name foo.ear"

Found the problem.
Apparently as we build the assembly, used with the manual deploy, the ear file has a different name than the ear file built in the continuous integration pipe. Both try to deploy, different name but same runtime name.
The ear in the Assembly contained an ear with the version number still attached, while the ear in the ci-pipe had it's version number stripped.

Related

Artifactory + TeamCity : How to deploy custom JAR?

I am building a maven project within a Docker container as a TeamCity job configuration.
(This is necessary because the maven project builds a JNA library -- so it must be built on a specific distro)
At the end of running the docker container, I'm left with the target folder of the maven module which contains the JAR & associated other files (i.e. class files etc..)
I'm stumped onto now how to get this JAR published to Artifactory? All the integration with TeamCity seems to be if the JAR was built with the maven runner specifically
Usually, you use mvn deploy to build and deploy an artifact with Maven. It is transferred to the Maven repository that you specified in your distributionManagement.
With Artifactory, you can also use the artifactory-maven-plugin for deployment.

Jelastic - deploy from maven generates both WAR and EAR files and fails

I am using Jelastic and I have an environment with a WildFly 10.1 node and a Maven 3.5.0 node. When I click "build and deploy" on the project in the Maven node my application should build and deploy a EAR file.
However, after the first time I do that, the deploy fails, and when I check the WildFly admin console there is a EAR and a WAR file. I have no idea where this WAR is coming from, and I can't find such file in the "target" folder either.
Checking the WildFly log, I see a "org.jboss.msc.service.DuplicateServiceException: Service jboss.naming.context.java.app.myapp-dev is already registered"
If I remove the war from the admin console, disable the EAR and re-enable it, the application works.
I don't know exactly how Jelastic works with maven, but I believe there is no problem with my pom.xml files.
Thanks in advance!
edit: here's the pom.xml for the project root, and the pom.xml for the inner EAR module.
Automatic build and deploy functionality in Jelastic is designed to build all the targets specified in pom.xml and deploy all the built artifacts to the app server.
If multiple targets are specified in root pom.xml of the project, all of them will be built and deployed to the app server, not only the .ear target.
Please try to deploy the subproject with the inner EAR module with the appropriate pom.xml as root project file to build and deploy only the *.ear file.

Secondary Jar version don't sync up when deploying

I'm using gradle artifactory plugin to deploy my library to oss-snapshot-local.
The first deploy works as intended and the filenames are correct:
eg.
skrypton-api-1.0.0-20171014.053125-1-sources.jar
skrypton-api-1.0.0-20171014.053125-1.jar
But on the second deploy, the sources jar is not uploaded despite the plugin saying it has deployed it. I end up with only
skrypton-api-1.0.0-20171014.053349-2.jar
Deploying for the third time,
skrypton-api-1.0.0-20171014.053349-2-sources.jar shows up. But not third source jar. Only skrypton-api-1.0.0-20171014.054252-3.jar
This is what it looks like in general after 3 deploys
The source jar version seems to be stuck at (deploy number - 1) after the first deployment. Tried it with a javadoc jar and it also doesn't work properly.
This is the build script in question.

Where does maven wildfly plugin deposit its deployed WARs?

I have been deploying mvn wildfly:deploy successfully for a few days, and I always imagined that deployment would place my foo.war in the standalone deployments folder, but all I can find are some foo.war empty directories in deployments/tmp.
Where is maven sticking the deployed files?
Is mvn wildfly:deploy suitable for production use?
The wildfly-maven-plugin uses management operations to deploy the archive created by Maven. It does not move the file itself as that would not work for remote deployments. Where the deployment content is stored is up to the application server itself.
The $JBOSS_HOME/standalone/deployments directory is used by the deployment-scanner to deploy applications copied there. See the documentation on the deployment scanner for more details.

Maven JBOSS application deployment

I followed this tutorial http://www.mastertheboss.com/jboss-maven/jboss-maven-example-building-a-java-ee-6-application/ in order to have a simple web application to better understand Java EE and JBOSS. I set up the example project (by archetype) and compiled it.
However, I am stuck after running mvn compile. I want to deploy my application as a war file to my JBOSS webroot directory (in my case /usr/share/jboss-as/standalone/deployments/).
I think mvn package and mvn install must be executed. Where can I specify that I want a war file and that it should be copied to my deployment location on JBOSS?
Obviously, I can use the jboss maven plugin http://docs.jboss.org/jbossas/7/plugins/maven/latest/, which is addressed via console
jboss-as:deploy
Configuration is read from the POM file.

Resources