For all packaging other than war you need to configure the container you wish to use

882 views
Skip to first unread message

Marko Lazić

unread,
Mar 30, 2021, 5:16:50 AM3/30/21
to Codehaus Cargo
Hello,

Thanks for the great plugin. I have been using it locally for years now. It is always working fine on glassfish and on payara. 

Last weekend I wanted to change things a little bit. instead of locally, I am having payara on a docker, so I changed the default local maven configuration to work remotely.

When I try to do mvn install like before I get this error message that I could not find anywhere on the internets.

For all packaging other than war you  need to configure the container you wish to use

Here the full error

My project has two war modules, couple ejb modules, and one ear module. Usually, I don't deploy them all so I tell Maven which artifacts to deploy with the -pl --also-make flags.

S. Ali Tokmen

unread,
Mar 30, 2021, 1:49:03 PM3/30/21
to codehau...@googlegroups.com

Hi Marko

It looks like you are progressing nicely with the Codehaus Cargo Maven 3 plugin.

As explained in the Maven 3 Plugin Reference Guide, the default container that the Maven 3 plugin uses when you don't specify any is a Jetty 8.x installed local container. Unfortunately, Jetty can only handle WARs and hence your seeing of that message.

In order to deploy to Payara, you need to specify it in the Codehaus Cargo Maven 3 configuration. Example (I highlighted in blue the crucial parts):

<plugin>
  <groupId>org.codehaus.cargo</groupId>
  <artifactId>cargo-maven3-plugin</artifactId>
  <version>1.9.3</version>
  <configuration>
    <container>
      <containerId>payara</containerId>
      <artifactInstaller>
        <groupId>fish.payara.distributions</groupId>
        <artifactId>payara</artifactId>
        <version>5.2021.1</version>
      </artifactInstaller>
    </container>

    <configuration>
      <home>${project.build.directory}/payara-home</home>
      <properties>
        <cargo.hostname>tokmen-nas</cargo.hostname>
        <cargo.servlet.port>8080</cargo.servlet.port>
        <cargo.glassfish.admin.port>4848</cargo.glassfish.admin.port>
      </properties>
    </configuration>
    <deployables>
      <deployable>
        <groupId>org.codehaus.cargo</groupId>
        <artifactId>simple-ear</artifactId>
        <type>ear</type>
      </deployable>
    </deployables>
  </configuration>
</plugin>

Regards

S. Ali Tokmen
http://ali.tokmen.com/
http://contact.ali.tokmen.com/
--
You received this message because you are subscribed to the Google Groups "Codehaus Cargo" group.
To unsubscribe from this group and stop receiving emails from it, send an email to codehaus-carg...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/codehaus-cargo/7b7a006e-7e5c-4399-8b36-8771995fb6f1n%40googlegroups.com.

Marko Lazić

unread,
Apr 1, 2021, 8:51:01 AM4/1/21
to Codehaus Cargo
Hi Ali,

That did the trick. But I still get errors when I try to deploy my app. When try to deploy EAR and WAR

mvn clean install -DskipTests -pl my-ear, web-app -am

It complains about EJB which is on that path.

[ERROR] Failed to execute goal org.codehaus.cargo:cargo-maven3-plugin:1.9.3:redeploy (my-deploy) on project my-ejb: Execution my-deploy of goal org.codehaus.cargo:cargo-maven3-plugin:1.9.3:redeploy failed: Deployment has failed: Action failed Deploying application to target server failed; File not found : /Users/marko/projekti/app/my-ejb/target/my-ejb.jar

If I try to deploy web-app only the path where it is looking becomes different.
mvn clean install -DskipTests -pl web-app -am

Gets error

[ERROR] Failed to execute goal org.codehaus.cargo:cargo-maven3-plugin:1.9.3:redeploy (my-deploy) on project web-app: Execution my-deploy of goal org.codehaus.cargo:cargo-maven3-plugin:1.9.3:redeploy failed: Deployment has failed: Action failed Deploying application to target server failed; File not found : /var/folders/j9/hjzs11bj6hdcbd8jj55_v4jc0000gn/T/cargo/41389/my-app.war

My configuration is pretty similar to the one you shared. Only that I don't have <deployables> section and I got container <type>remote</type> tag and plugin configuration <type>runtime</type> tag. Also I removed <home> tag.

Also one more question. I noticed with the Intellij Glassfish Remote plugin that I can not deploy exploded artifacts thus I  can only hot-swap classes but not the xhtml or css files. This part of updating resources is critical for me when I work on the frontend. can Cargo update remotely those files?

Kind regards,
Marko

S. Ali Tokmen

unread,
Apr 2, 2021, 2:37:09 AM4/2/21
to codehau...@googlegroups.com

Hi Marko

Would you mind sharing the full build log and the pom.xml file? I am suspecting, there is a problem with the lifecycle assignment.

As for the remote deployment: indeed, Codehaus Cargo can also only remote-deploy packaged deployables, and not the exploded versions...

Marko Lazić

unread,
Apr 2, 2021, 9:29:00 AM4/2/21
to Codehaus Cargo

S. Ali Tokmen

unread,
Apr 2, 2021, 3:21:01 PM4/2/21
to codehau...@googlegroups.com

Hi Marko

Thanks - Unfortunately, the partial build file and logs are very mysterious...

Would you be able of sharing more please?

Reply all
Reply to author
Forward
0 new messages