How to make kapt works with jpa - kotlin

Maven fails while compileris trying to generated jpa entities.
Gender_.java:[11,50] cannot find symbol Gender
Both classes are exists. Gender class exists in kaptStubs directory, Gender_ in kapt directory.
pom:
<plugin>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-maven-plugin</artifactId>
<version>${kotlin.version}</version>
<executions>
<execution>
<id>kapt</id>
<goals>
<goal>kapt</goal>
</goals>
<configuration>
<sourceDirs>
<sourceDir>src/main/kotlin</sourceDir>
<sourceDir>src/main/java</sourceDir>
</sourceDirs>
</configuration>
</execution>
</executions>
<configuration>
<jvmTarget>1.8</jvmTarget>
<compilerPlugins>
<plugin>all-open</plugin>
<plugin>spring</plugin>
<plugin>jpa</plugin>
</compilerPlugins>
</configuration>
<dependencies>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-maven-noarg</artifactId>
<version>${kotlin.version}</version>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-maven-allopen</artifactId>
<version>${kotlin.version}</version>
</dependency>
</dependencies>
</plugin>

Try to add annotationProcessorPaths to kapt configuration
<plugin>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-maven-plugin</artifactId>
<version>${kotlin.version}</version>
<configuration>
<sourceDirs>
<sourceDir>src/main/kotlin</sourceDir>
<sourceDir>src/main/java</sourceDir>
</sourceDirs>
</configuration>
<executions>
<execution>
<id>kapt</id>
<goals>
<goal>kapt</goal>
</goals>
<configuration>
<annotationProcessorPaths>
<annotationProcessorPath>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-jpamodelgen</artifactId>
<version>${version.hibernate}</version>
</annotationProcessorPath>
</annotationProcessorPaths>
</configuration>
</execution>
<execution>
<id>compile</id>
<phase>process-sources</phase>
<goals>
<goal>compile</goal>
</goals>
</execution>
<execution>
<id>test-compile</id>
<phase>process-test-sources</phase>
<goals>
<goal>test-compile</goal>
</goals>
</execution>
</executions>
</plugin>

Related

Getting required a bean of type 'org.springframework.web.reactive.function.server.ServerRequest' that could not be found. error

` Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name '*******Handler': Unsatisfied dependency expressed through method '*******Handler' parameter 0: No qualifying bean of type 'org.springframework.web.reactive.function.server.ServerRequest' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}
2023-01-23T23:45:46.974Z ERROR 9 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter :
APPLICATION FAILED TO START
Description:
Parameter 0 of method *********Handler in ***************Application required a bean of type 'org.springframework.web.reactive.function.server.ServerRequest' that could not be found.
Action:
Consider defining a bean of type 'org.springframework.web.reactive.function.server.ServerRequest' in your configuration.`
below are my dependencies.
`
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-function-adapter-aws</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-dynamodb</artifactId>
<version>1.12.381</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.9.1</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-webflux</artifactId>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${spring-cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.2</version>
<configuration>
<argLine>--enable-preview</argLine>
<skipTests>true</skipTests>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.22.2</version>
<configuration>
<argLine>--enable-preview</argLine>
</configuration>
<executions>
<execution>
<id>default-integration-test</id>
<goals>
<goal>integration-test</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.10.1</version>
<configuration>
<enablePreview>true</enablePreview>
<compilerArgs>
<arg>--enable-preview</arg>
</compilerArgs>
<source>19</source>
<target>19</target>
</configuration>
</plugin>
<plugin>
<groupId>org.graalvm.buildtools</groupId>
<artifactId>native-maven-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<imageName>${project.artifactId}</imageName>
<buildArgs combine.children="append">
<arg>--enable-preview</arg>
<arg>--enable-monitoring=jfr</arg>
</buildArgs>
<jvmArgs>
<arg>--enable-preview</arg>
</jvmArgs>
</configuration>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<jvmArguments>--enable-preview</jvmArguments>
<compilerArguments>--enable-preview</compilerArguments>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>Windows</id>
<activation>
<os>
<family>windows</family>
</os>
</activation>
<properties>
<name>img-ext</name>
<value>.exe</value>
</properties>
</profile>
<profile>
<id>default</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
</dependencies>
</profile>
<profile>
<id>native</id>
<build>
<plugins>
<plugin>
<groupId>org.graalvm.buildtools</groupId>
<artifactId>native-maven-plugin</artifactId>
<extensions>true</extensions>
<executions>
<execution>
<id>build-native</id>
<goals>
<goal>compile-no-fork</goal>
</goals>
<phase>package</phase>
</execution>
<execution>
<id>test-native</id>
<goals>
<goal>test</goal>
</goals>
<phase>test</phase>
</execution>
</executions>
<configuration>
<buildArgs>
--enable-url-protocols=http
-H:+AddAllCharsets
</buildArgs>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.4.2</version>
<executions>
<execution>
<id>native-zip</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<inherited>false</inherited>
</execution>
</executions>
<configuration>
<descriptors>
<descriptor>src/main/assembly/native.xml</descriptor>
</descriptors>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<repositories>
<repository>
<id>spring-releases</id>
<name>Spring Releases</name>
<url>https://repo.spring.io/release</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>repository.spring.snapshot</id>
<name>Spring Snapshot Repository</name>
<url>https://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>snapshots</id>
<name>Local Nexus</name>
<url>https://repo.spring.io/release</url>
</repository>
</repositories>
`
Handler is as below
`#Bean
public Mono *********Handler(ServerRequest request) {`
routes are as below
#Bean public RouterFunction<ServerResponse> functionalRoutes(final *********Application handler){ return route(POST("***********").and(accept(MediaType.APPLICATION_JSON)), handler::**********Handler); }
its a Springboot application with Spring cloud functions, aws lambda, also dynamodb and webflux. Trying to fetch data from dynamodb table. Can anyone help to resolve the above issue.

How do I include RestEasy Jackson2Provider in jar-with-dependencies?

I have a java rest service client that I am packaging up using the maven-assembly-plugin. I am creating a zip file containing all of the dependencies plus a jar-with-dependencies. So I end up with:
my-client-1.2-bin.zip
my-client-1.2-jar-with-dependencies.jar
I have written a small test java app that calls the client so that I can test the dependencies. If I unzip the dependency zip and add all of the jars to the class path, I am able to use the client successfully. If I attempt to only add the jar-with-dependency to my class path, it fails unless I also add the RestEasy Jackson2Provider jar to my classpath. I have confirmed that the ResetEasy Jackson2Provider is available in the jar-with-dependency jar file.
Here is the relevent part of my pom:
<dependencies>
<!-- https://mvnrepository.com/artifact/org.jboss.resteasy/resteasy-jaxrs -->
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-jaxrs</artifactId>
<version>3.1.2.Final</version>
<scope>runtime</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.jboss.resteasy/resteasy-jackson2-provider -->
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-jackson2-provider</artifactId>
<version>3.1.2.Final</version>
<scope>runtime</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.jboss.resteasy/resteasy-client -->
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-client</artifactId>
<version>3.1.2.Final</version>
<scope>runtime</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.jboss.resteasy/resteasy-jaxb-provider -->
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-jaxb-provider</artifactId>
<version>3.1.2.Final</version>
<scope>runtime</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.jboss.resteasy/resteasy-jaxrs-services -->
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-jaxrs-services</artifactId>
<version>3.1.2.Final</version>
<scope>runtime</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.httpcomponents/httpcore -->
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore</artifactId>
<version>4.4.6</version>
<scope>runtime</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.httpcomponents/httpclient -->
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.3</version>
<scope>runtime</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.jboss.logging/jboss-logging -->
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging</artifactId>
<version>3.3.1.Final</version>
<scope>runtime</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.jaxrs/jackson-jaxrs-base -->
<dependency>
<groupId>com.fasterxml.jackson.jaxrs</groupId>
<artifactId>jackson-jaxrs-base</artifactId>
<version>2.8.8</version>
<scope>runtime</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.6</version>
<configuration>
<dependencySets>
<dependencySet>
<outputDirectory>lib</outputDirectory>
<scope>runtime</scope>
</dependencySet>
</dependencySets>
<descriptors>
<descriptor>src/assembly/client.xml</descriptor>
</descriptors>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<pluginRepositories>
<pluginRepository>
<id>onejar-maven-plugin.googlecode.com</id>
<url>http://onejar-maven-plugin.googlecode.com/svn/mavenrepo</url>
</pluginRepository>
</pluginRepositories>
src/assembly/client.xml
<?xml version="1.0" encoding="UTF-8"?>
<assembly
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2
http://maven.apache.org/xsd/assembly-1.1.2.xsd">
<id>bin</id>
<formats>
<format>zip</format>
<format>tar.gz</format>
</formats>
<dependencySets>
<dependencySet>
<outputDirectory>lib</outputDirectory>
<scope>runtime</scope>
</dependencySet>
</dependencySets>
</assembly>
I ran into a similar problem when using the shade plugin. This is because the transformers in the Metadata folder is overwritten by the shade/assembly plugins. I could resolve it by using the following
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>path.to.your.main.Class</mainClass>
</transformer>
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>META-INF/spring.handlers</resource>
</transformer>
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>META-INF/spring.schemas</resource>
</transformer>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
</transformers>
</configuration>
</execution>
</executions>
</plugin>
</plugins>

Unable to configure maven ProGuard plugin

I'm trying to use proguard plugin for reducing and optimizing my jar. However, I am facing difficulties in using this plugin. Below is my project pom file:
<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.hps</groupId>
<artifactId>geomesafrontend</artifactId>
<packaging>jar</packaging>
<version>1.0</version>
<name>geomesafrontend</name>
<url>http://maven.apache.org</url>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.avro</groupId>
<artifactId>avro</artifactId>
<version>1.8.1</version>
</dependency>
<dependency>
<groupId>org.locationtech.geomesa</groupId>
<artifactId>geomesa-accumulo-datastore_2.11</artifactId>
<version>1.3.1</version>
</dependency>
<dependency>
<groupId>org.apache.accumulo</groupId>
<artifactId>accumulo-core</artifactId>
<version>1.8.1</version>
</dependency>
<dependency>
<groupId>redis.clients</groupId>
<artifactId>jedis</artifactId>
<version>2.9.0</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<!-- <minimizeJar>true</minimizeJar> -->
<createDependencyReducedPom>false</createDependencyReducedPom>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
<transformers>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
</transformers>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.github.wvengen</groupId>
<artifactId>proguard-maven-plugin</artifactId>
<version>2.0.14</version>
<dependencies>
<dependency>
<groupId>net.sf.proguard</groupId>
<artifactId>proguard-base</artifactId>
<version>5.3.3</version>
</dependency>
</dependencies>
<executions>
<execution>
<phase>package</phase>
<goals><goal>proguard</goal></goals>
</execution>
</executions>
<configuration>
<!-- <proguardVersion>4.10</proguardVersion> -->
<options>
<option>-keep public class com.hps.EventServer{public static void main(java.lang.String[]);}</option>
<option>-keep public class com.hps.AvroCodec{*;}</option>
</options>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>locationtech-releases</id>
<url>https://repo.locationtech.org/content/groups/releases</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>osgeo</id>
<url>http://download.osgeo.org/webdav/geotools</url>
</repository>
</repositories>
</project>
when I run the command: mvn package, I am getting lots of warnings like regarding the duplicate definition of library classes and can't find referenced class java.lang.Class. At the end, the build fails.
I am new to maven, any documentation which will help newbies in understand how to configure it correctly will also be helpful.

hibernate3-maven: JDBC Driver not found in child project when compiling from parent project

Problem:
12:03:10,126 ERROR org.hibernate.tool.hbm2ddl.SchemaExport - schema export unsuccessful org.hibernate.HibernateException: JDBC Driver class not found: com.mysql.jdbc.Driver
I have a project divided into modules: ParentProject and ChildModule. When I try to compile pom.xml of ChildModule everything works fine, maven successfully connects to the database an creates the tables. However, when compiling from ParentProject I got error mentioned above (while executing hbm2ddl). Any ideas what is the problem?
Here are my pom.xml files:
ParentProject pom.xml:
<project ... >
<build>
<plugins>
<plugin>
<!-- JDK version used to compile project -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.0.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>hibernate3-maven-plugin</artifactId>
<version>2.2</version>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>JBOSS</id>
<name>JBoss Repository</name>
<url>http://repository.jboss.org/maven2/</url>
</repository>
<repository>
<id>Codehaus Snapshots</id>
<url>http://snapshots.repository.codehaus.org/</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
<releases>
<enabled>false</enabled>
</releases>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>Codehaus Snapshots</id>
<url>http://snapshots.repository.codehaus.org/</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
<releases>
<enabled>true</enabled>
</releases>
</pluginRepository>
</pluginRepositories>
<dependencyManagement>
<dependencies>
...
</dependencies>
</dependencyManagement>
<modules>
<module>../ChildModule</module>
</modules>
</project>
ChildModule pom.xml:
<project ... >
<parent>
<groupId>com.somepackage</groupId>
<artifactId>ChildModule</artifactId>
<version>0.1</version>
<relativePath>../ParentProject/pom.xml</relativePath>
</parent>
...
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>hibernate3-maven-plugin</artifactId>
<executions>
<execution>
<id>generate-entities</id>
<phase>generate-sources</phase>
<goals>
<goal>hbm2java</goal>
</goals>
<configuration>
<components>
<component>
<name>hbm2java</name>
<implementation>configuration</implementation>
<outputDirectory>${generated-source-dir}</outputDirectory>
</component>
</components>
<componentProperties>
<configurationFile>src/main/resources/hibernate.cfg.xml</configurationFile>
<jdk5>true</jdk5>
</componentProperties>
</configuration>
</execution>
<execution>
<id>generate-schema</id>
<phase>process-classes</phase>
<goals>
<goal>hbm2ddl</goal>
</goals>
<configuration>
<componentProperties>
<outputfilename>schema.ddl</outputfilename>
<drop>true</drop>
<ejb3>false</ejb3>
</componentProperties>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.17</version>
</dependency>
<dependency>
<groupId>cglib</groupId>
<artifactId>cglib-nodep</artifactId>
<version>2.2.2</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
<dependencies>
...
</dependencies>
<properties>
<generated-source-dir>generated-sources/hibernate3</generated-source-dir>
<generated-resource-dir>generated-resources/hibernate3</generated-resource-dir>
</properties>
</project>
Your parent's plugin doesn't have dependencies to mysql-connector-java, which child has. I suggest to add (or even move) this dependencies to parent's plugin.

How use cargo-maven2-plugin deploy to jboss as5?

I trying cargo-maven2-plugin, but I don't deploy in jboss5x I pom.xml is
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<version>1.0.2</version>
<configuration>
<container>
<containerId>jboss51x</containerId>
<home>E:\JavaWorkingTools\JBoss\jboss-5.1.0.GA</home>
<log>${basedir}/target/jboss5.1.x.logs/cargo.log</log>
<timeout>300000</timeout> <!-- 5 minutes -->
<systemProperties>
<jboss.server.log.threshold>INFO</jboss.server.log.threshold>
</systemProperties>
</container>
<configuration>
<type>existing</type>
<home>${project.build.directory}/target/jboss51x</home>
<properties>
<cargo.jvmargs>-XX:PermSize=512m -XX:MaxPermSize=1024
-XX:+UseConcMarkSweepGC -XX:+CMSPermGenSweepingEnabled
-XX:+CMSClassUnloadingEnabled</cargo.jvmargs>
</properties>
</configuration>
<deployer>
<type>installed</type>
<deployables>
<deployable>
<groupId>${project.groupId}</groupId>
<artifactId>${project.artifactId}</artifactId>
<type>war</type>
<!--
<pingURL>http://localhost:8080/${artifactId}</pingURL>
<pingTimeout>300000</pingTimeout>
-->
<pingURL>http://localhost:8080/${project.artifactId}/index.jsp</pingURL>
<properties>
<context>/${project.artifactId}</context>
</properties>
</deployable>
</deployables>
</deployer>
</configuration>
<executions>
<execution>
<id>start-container</id>
<phase>pre-integration-test</phase>
<goals>
<goal>start</goal>
</goals>
</execution>
<execution>
<id>stop-container</id>
<phase>post-integration-test</phase>
<goals>
<goal>stop</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
I run a cargo:deployer-start or cargodeployer-deploy is error
cargo:deployer-start Error message is:
Failed to execute goal org.codehaus.cargo:cargo-maven2-plugin:1.0.2:deployer-start (default-cli) on project SSH2Maven: Execution default-cli of goal org.codehaus.cargo:cargo-maven2-plugin:1.0.2:deployer-start failed: Not supported -> [Help 1]
and cargodeployer-deploy
The Deployable state is thus unknown. ->
I read a Deploying to a running container but I dont't know how to depoly webapp in jboss5 :(
There is something strange with your configuration. Since you're using an installed existing container, I'd expect to see the path to its home, not to a directory under target. Here is a configuration I'm using:
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<version>1.0.2</version>
<configuration>
<container>
<containerId>jboss51x</containerId>
<append>false</append>
<log>${project.build.directory}/logs/jboss51x.log</log>
<output>${project.build.directory}/logs/jboss51x.out</output>
<timeout>300000</timeout><!-- 5 minutes -->
</container>
<configuration>
<type>existing</type>
<home>/path/to/jboss-5.1.0.GA</home>
<properties>
<cargo.servlet.port>8080</cargo.servlet.port>
<cargo.jboss.configuration>default</cargo.jboss.configuration>
<cargo.rmi.port>1099</cargo.rmi.port>
<cargo.logging>high</cargo.logging>
</properties>
<deployables>
<!-- application to deploy -->
<deployable>
<groupId>${project.groupId}</groupId>
<artifactId>myapp</artifactId>
<type>war</type>
<!--
<properties>
<context>acontext</context>
</properties>
-->
</deployable>
</deployables>
</configuration>
</configuration>
</plugin>