Mulesoft - Cloudhub deployment error: Deployment configuration is not valid, : No deployment configuration was defined - deployment

This is my build details in POM:
<build>
<plugins>
<plugin>
<groupId>org.mule.tools.maven</groupId>
<artifactId>mule-maven-plugin</artifactId>
<version>${mule.maven.plugin.version}</version>
<extensions>true</extensions>
<configuration>
<deploymentType>${deploymentType}</deploymentType>
<muleVersion>${muleVersion}</muleVersion>
<redeploy>${redeploy}</redeploy>
<businessGroup>${businessGroup}</businessGroup>
<username>${username}</username>
<password>${password}</password>
<applicationName>${applicationName}</applicationName>
<environment>${environment}</environment>
<region>${region}</region>
<workers>${workers}</workers>
<workerType>${workerType}</workerType>
<uri>${anypoint.uri}</uri>
</configuration>
<executions>
<execution>
<id>deploy</id>
<phase>deploy</phase>
<goals>
<goal>deploy</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
<configuration>
<compilerArgs>
<args>-parameters</args>
</compilerArgs>
</configuration>
</plugin>
</plugins>
</build>
These are my properties:
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<app.runtime>4.2.1</app.runtime>
<mule.maven.plugin.version>3.2.7</mule.maven.plugin.version>
<deploymentType>cloudhub</deploymentType>
<muleVersion>4.2.1</muleVersion>
<redeploy>true</redeploy>
<businessGroup>****</businessGroup>
<username>****</username>
<password>****</password>
<applicationName>****</applicationName>
<environment>Sandbox</environment>
<region>us-east-1</region>
<workers>1</workers>
<workerType>Micro</workerType>
<anypoint.uri>https://anypoint.mulesoft.com</anypoint.uri>
</properties>
Following is my terminal command:
mvn clean deploy -DmuleDeploy -X
and I am getting following error:
[ERROR] Failed to execute goal org.mule.tools.maven:mule-maven-plugin:3.2.7:deploy (default-deploy) on project helloworld: Deployment configuration is not valid, : No deployment configuration was defined. Aborting. -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.mule.tools.maven:mule-maven-plugin:3.2.7:deploy (default-deploy) on project helloworld: Deployment configuration is not valid,
If I use following configuration, it deploys successfully in cloudhub:
<configuration>
<cloudHubDeployment>
<uri>${anypoint.uri}</uri>
<muleVersion>${muleVersion}</muleVersion>
<businessGroup>${businessGroup}</businessGroup>
<username>${username}</username>
<password>${password}</password>
<applicationName>${applicationName}</applicationName>
<environment>${environment}</environment>
<region>${region}</region>
<workers>${workers}</workers>
<workerType>${workerType}</workerType>
</cloudHubDeployment>
</configuration>
Not sure where I am doing wrong in the first config.

The configuration in the first example is for the older version of the Mule Maven Plugin (2.2.x or earlier) for Mule 3.x. The versions for Mule 4.x (3.3.x) always used the format of your second example. See the documentation at https://docs.mulesoft.com/mule-runtime/4.2/mmp-concept#deploying-to-cloudhub
The last version of the Mule Maven Plugin for Mule 3 (2.3.x) uses the same format than the Mule 4 version.
In summary, the first example is obsolete and not compatible with a Mule 4 deployment.

Related

Deployment on payara with cargo plugin

i want to deploy my War with cargo-maven2-plugin but its not work like expected.
when i deploy the first time, its works, but when i deploy a second time i got an error after undeploy is executed.
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.cargo:cargo-maven2-plugin:1.7.16:redeploy (deploy) on project XXX-deploy: Execution deploy of goal org.codehaus.cargo:cargo-maven2-plugin:1.7.16:redeploy failed: Deployment has failed: null
here my code:
<profile>
<id>payara-remote</id>
<activation>
<property>
<name>deployAll</name>
<value>true</value>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<configuration>
<configuration>
<properties>
<cargo.servlet.port>${servlet.port}</cargo.servlet.port>
</properties>
</configuration>
<deployables>
<deployable>
<groupId>${groupId}</groupId>
<artifactId>${artifactId}</artifactId>
<type>war</type>
</deployable>
</deployables>
</configuration>
<executions>
<execution>
<id>deploy</id>
<phase>pre-integration-test</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
'''
Can you try with the Payara customized version of the Maven Cargo plugin.
version: 1.8.4-payara-p1 (https://github.com/payara/Payara_PatchedProjects/tree/master/org/codehaus/cargo)
https://github.com/payara/Payara_PatchedProjects/ can be used as Maven repository in your project.
Rudy

How to build a Maven project with Eclipse with a pom.xml that imports an external properties file?

I have looked around from various questions on stackoverflow, but I have not found the answer that solve my purpose.
I want to import a properties file in a pom.xml; my purpose is to replace the <properties> section with the properties loaded from the external file.
Each property refers to the version of a particular maven dependency.
I have tried the properties-maven-plugin, but the properties are not solved and the project is not built.
I'm looking for a way that preserve the standard build of Eclipse, and also the mvn install goal of Maven.
As an example, I want that this section:
<properties>
<dependency1.version>1.0.0</dependency1.version>
</properties>
will be replaced with the property declared in a dependency.properties file, like this one:
dependency1.version=1.0.0
How can I implement my pom.xml in order to obtain this behaviour?
Thanks in advance.
EDIT
This is what I have tried:
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>properties-maven-plugin</artifactId>
<version>1.0.0</version>
<executions>
<execution>
<phase>initialize</phase>
<goals>
<goal>read-project-properties</goal>
</goals>
<configuration>
<files>
<file>${basedir}/dependencies.properties</file>
</files>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<phase>generate-resources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<echo>my version: ${dependency1.version}</echo>
</tasks>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
Well, if I do a simple mvn install, in maven console it prints:
[INFO] Executing tasks
[echo] my version: 1.0.0
[INFO] Executed tasks
So, the plugin solve the property, but when I try to import the dependency with this:
<dependencies>
<dependency>
<groupId>dependency1</groupId>
<artifactId>dependency1</artifactId>
<version>${dependency1.version}</version>
</dependency>
</dependencies>
I obtain this error:
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[ERROR] 'dependencies.dependency.version' for dependency1:dependency1:jar must be a valid version but is '${dependency1.version}'. # line 21, column 13
#
The property is solved in the maven-antrun-plugin, but if it is used in the dependencies section, it doesn't work.

Errors when using maven plugin for Weblogic deployment

I have been trying to deploy application to Weblogic 10.3.6 using maven
I have created weblogic plugin for maven as mentioned in this article.
I have added the following to pom.xml
<build>
<plugins>
<plugin>
<artifactId>maven-plugin-plugin</artifactId>
<version>2.3</version>
<configuration>
<goalPrefix>weblogic</goalPrefix>
</configuration>
</plugin>
<plugin>
<groupId>weblogic</groupId>
<artifactId>weblogic-maven-plugin</artifactId>
<version>10.3.6.0</version>
<configuration>
<adminurl>t3://localdomain:7001</adminurl>
<user>weblogic</user>
<password>password</password>
<name>wldemo</name>
<remote>true</remote>
<upload>true</upload>
<targets>AdminServer</targets>
</configuration>
<executions>
<execution>
<id>deploy</id>
<phase>pre-integration-test</phase>
<goals>
<goal>deploy</goal>
</goals>
<configuration>
<source>target/EmployeesApp-1.0-SNAPSHOT.war</source>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
When I did mvn com.oracle.weblogic:weblogic-maven-plugin:deploy I am getting the following errors, how can I resolve these errors?
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Final Memory: 3M/15M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.oracle.weblogic:weblogic-maven-plugin:10.3.6.
0:deploy (default-cli) on project EmployeesApp: The parameters 'source' for goal
com.oracle.weblogic:weblogic-maven-plugin:10.3.6.0:deploy are missing or invali
d
You have specified the source parameter in the execution configuration, so in order to make it taken into account you should invoke this particular execution. It can be done using the phase key you specified, so e.g.:
mvn integration-test
Maven will go through the whole lifecycle and on the pre-integration-test test phase (which precedes the integration-test one) it will run the execution of weblogic-maven-plugin you configured.

Maven generate-sources folder not being picked up by Eclipse

I am in the process of migrating my build from Ant to Maven. The Ant build used to compile a "code generator", execute this "code generator" which produced a set of Java and C code. It then took the generated Java code and compiled it along with some additional code produce a single jar.
I have replicated this this in Maven quite easily and it works well when I run from the command line but Eclipse is complaining and is giving me an error relating to the pom file
Failure to find {group.id}:{artifact.id}:pom:1.0.0-SNAPSHOT in
http://{our internal site repository}/nexus/content/groups/public was
cached in the local repository, resolution will not be reattempted
until the update interval of snapshots has elapsed or updates are
forced
where the group.id and artifact.id are the group and artifact id of my code generator plugin
and any code that references the generated code also fails to compile.
My maven build consists of
a generator project that contains just the Java code for the code generator.
a generator-plugin project that contains just the code to wrap the generator as a Maven plugin. This is dependent upon the generator project.
an xyz project that uses the plugin to generate the code. The code ends up in the target/generated-sources/xxx folder of this project. I have configured the build-helper-maven-plugin as per Maven compile with multiple src directories to include this extra source directory.
If I manually add the generated source folder to the Eclipse build path all of the errors relating to the code not being there go away on that project but not on any downstream projects and the "Failure to find..." error listed above remains.
What puzzles me a little is that it is referring to the ...:pom:1.0.0-SNAPSHOT when in fact my generator-plugin is defined as a maven-plugin.
Is this a sensible approach?
Why am I getting a "Failure to find..." error?
Why isn't Eclipse picking up my generated-sources folders?
I should also say I have the m2e plugin and the m2e connector for build-help-maven-plugin installed in my Eclipse IDE.
It looks like a problem during the download of the lib from the repository. I already had the same error message once.
Did you take a look at your local repository?
Go to the .m2 folder and look for /nexus/content/groups/public. If the folder is there, open it and see if the lib was download correctly. If not, try to delete the folder and try to run mvn install to force the download of the lib.
At Eclipse, run Right button > Maven > Update Project too.
Are you using an local repository like Artifactory, aren't you? Also look for the lib in the repo1-cache (or similar) folder. See if the jar is there.
Are you behind any firewall or proxy?
Using eclipse Indigo3.7, this was what I found that worked good using spring 3.1.1 which does have the 3.0.6 version as well in it. Once I got the plugins setup and put into the correct area of the pom and included the argline and endorseddirs to have the java sources put out into the target/generated-sources/cxf folder then maven generated the sources ok.
....
<properties>...
<dependencyManagement>
<dependencies>.....
</dependencyManagement>
<dependencies>
<dependency>....
</dependencies>
<!-- *************************** Build process ************************************* -->
<build>
<finalName>projName</finalName>
<plugins>
<!-- Force Java 6 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.4</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<!-- Deployent on AS from console
<plugin>
<groupId>org.jboss.as.plugins</groupId>
<artifactId>jboss-as-maven-plugin</artifactId>
<version>${version.jboss.as.maven.plugin}</version>
</plugin>
-->
<!-- wildbill added tomcat plugin -->
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.0</version>
</plugin>
<!-- Surefire plugin before 2.9 version is buggy. No need to declare here,
it's being referenced below w/ the version
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.12</version>
</plugin>
-->
<!-- developer added these -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<compilerArguments>
<endorseddirs>target/generated-sources/cxf</endorseddirs>
</compilerArguments>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.12</version>
<configuration>
<forkMode>once</forkMode>
<argLine>-Djava.endorsed.dirs=target/generated-sources/cxf</argLine>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<compilerArguments>
<endorseddirs>target/generated-sources/cxf</endorseddirs>
</compilerArguments>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<forkMode>once</forkMode>
<argLine>-Djava.endorsed.dirs=target/generated-sources/cxf</argLine>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<configuration>
<artifactItems>
<artifactItem>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.2</version>
</artifactItem>
<artifactItem>
<groupId>javax.xml.ws</groupId>
<artifactId>jaxws-api</artifactId>
<version>2.2</version>
</artifactItem>
</artifactItems>
<outputDirectory>target/generated-sources/cxf</outputDirectory>
</configuration>
</plugin>
</plugins>
</build>
<!-- *********************** Profiles ************************************ -->
<profiles>
<profile>
<!-- When built in OpenShift the 'openshift' profile will be
used when invoking mvn. -->
<!-- Use this profile for any OpenShift specific customization
your app will need. -->
<!-- By default that is to put the resulting archive into the
'deployments' folder. -->
<!-- http://maven.apache.org/guides/mini/guide-building-for-different-environments.html -->
<id>projName</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-codegen-plugin</artifactId>
<version>2.5.2</version>
<executions>
<execution>
<id>process-sources</id>
<phase>generate-sources</phase>
<configuration>
<fork>once</fork>
<additionalJvmArgs>-Djava.endorsed.dirs=target/generated-sources/cxf</additionalJvmArgs>
</configuration>
<goals>
<goal>wsdl2java</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>2.2</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-xjc</artifactId>
<version>2.2</version>
</dependency>
</dependencies>
</plugin>
<!-- Actual war created in default target dir -->
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.2</version>
</plugin>
</plugins>
</build>
</profile>
</profiles>
If your wsdl folder is in ${basedir}/src/main/resources it'll find it automatically
Hope this helps!

Maven 3 site descriptor issue : deploying artifact not working or site not building

I've migrated to maven 3.0.3 but I'm not able to build the maven site.
In fact my project use an external parent pom that doesn't provide any site descriptor as artifact.
1- Is there a way to generate the maven site even if the parent doesn't provide a site.xml ? I can't make it work. "mvn site" command still crashing trying to download the site.xml of the parent with the following eroor (ArtifactResolutionException: Unable to locate site descriptor...)
2- How do we install or deploy the site.xml on maven repository. I try to add the following xml in my parent pom, but it's not installing anything in my local repo with mvn install command. I've a src/site/site.xml in my project, my project is a pom type project
maven-site-plugin
attach-descriptor
attach-descriptor
UPDATE
No it's not working
In my pom I have
<url>${site_url_pattern}</url>
<distributionManagement>
<site>
<id>test</id>
<url>file://${baseDir}../maven-site</url>
</site>
</distributionManagement>
In plugin management I put
<plugin>
<!-- Site plugin -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>3.0</version>
<configuration>
<chmod>true</chmod>
<inputEncoding>${encoding}</inputEncoding>
<outputEncoding>${encoding}</outputEncoding>
</configuration>
</plugin>
In plugins I put
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>3.0</version>
<configuration>
<locales>en</locales>
<reportPlugins>
<!-- Manage site info part creation -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin
</artifactId>
<version>2.2</version>
<configuration>
<dependencyLocationsEnabled>false</dependencyLocationsEnabled>
<dependencyDetailsEnabled>false</dependencyDetailsEnabled>
<offline>true</offline>
</configuration>
<reports>
<report>cim</report>
<!-- Dependencies report are consuming resources set MAVEN_OPTS=-Xmx1024m if java heap <report>dependencies</report> <report>dependencies-convergence</report> <report>dependencies-management</report> -->
<report>index</report>
<report>issue-tracking</report>
<!-- pb time generation on licence report <report>license</report> -->
<report>mailing-list</report>
<report>plugin-management</report>
<report>project-team</report>
<report>scm</report>
<report>summary</report>
</reports>
</plugin>
</reportPlugins>
</configuration>
<executions>
<execution>
<id>attach-descriptor</id>
<goals>
<goal>attach-descriptor</goal>
</goals>
</execution>
</executions>
</plugin>
I have a src/site/site.xml in the same project
When I do mvn site I still have
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-site-plugin:3.0:si
te (default-site) on project ner-delivery: SiteToolException: The site descripto
r cannot be resolved from the repository: ArtifactResolutionException: Unable to
locate site descriptor: Could not transfer artifact com.sopragroup.evolan:evola
n-framework-superpom:xml:site_en:6.14.2 from/to Artifactory (http://pdtinteg.ptx
.fr.sopra/artifactory/repo): Access denied to: http://pdtinteg.ptx.fr.sopra/arti
factory/repo/com/sopragroup/evolan/evolan-framework-superpom/6.14.2/evolan-frame
work-superpom-6.14.2-site_en.xml
[ERROR] com.sopragroup.evolan:evolan-framework-superpom:xml:6.14.2
If I put manually a evolan-framework-superpom-6.14.2-site_en.xml on my local repo it's working, but that's not a real solution
Explicitly configure maven-site-plugin 3.0 in your pom:
<pluginManagement>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>3.0</version>
<configuration>
<chmod>true</chmod>
<inputEncoding>UTF-8</inputEncoding>
<outputEncoding>UTF-8</outputEncoding>
</configuration>
</plugin>
</pluginManagement>
Add a url & a distributionManagement element that tell where you plan to deploy it.
Add a src/site/site.xml that contains what you need.
If your parent has none of these, it will work.