maven soupUI plugin properties file - maven

Can somebody knows how to add property file example. file.properties to global settings in maven
soapui-maven-plugin. I tried so many option but nothing works.
Thanks

Related

maven directory not found in Jenkins?

I am doing auto deployment of Java Application using Maven and Jenkins, but it is getting failed.Here is the console output:
I have set the environment varaibles and also downloaded and configure all the required plugins. Need help to solve this issue.
Thanks
First of all: Please copy/paste messages instead of using images.
Secondly, the message said that you probably misconfigured the directory for the settings.xml. The settings.xml is usually in the directory .m2 in the user directory, but it can also be supplied from somewhere else.

Rename set of files using some patterns in maven

I need to rename set of files in maven without using Maven-Antrun-plugin in a single execution or command.
I have many property files with same suffix ab_bc.properties,de_bc.properties,etc and I need to replace the suffix to some other name like ab_BR.properties,de_BR.properties.
Is there any plugin available to do the same in Maven?
I tried Maven-assmbly plugin and copy-rename plugin but adding lot of files makes it more complex.
You can give this plugin a try or have a look on workarounds with the Maven Assembly plugin, see related question here.
Hope that helps :)

Set permissions on tar created by maven assembly plugin

With the Maven assembly plugin I know I can set the permissions of the files contained within my tar such as here. However can I use the plugin to set the permissions of the tar itself?
Maybe I should just the ant plugin but this is a little messy
I haven't tested this, but you might be able to use "exec-maven-plugin" to do this.
How to change permission of jar packaged by maven? I am using maven assembly plugin
"Use maven:exec plugin to execute chmod"
So the idea is that you would add another plugin to the pom.xml file that sets the permission on the tar itself.
The only drawback that I see is that you have to have the name of the file in the plugin xml code in the pom file. That's fine as I have that listed in in the maven-assembly-plugin. But the file extension is found in assembly.xml (.zip, or .tar-gz), so if you change the file extension in assembly.xml, you would have to remember to change it in the pom.xml file. Not a big hassle, but it might be easy to miss on your first review.

intellij flags properties set by maven-resources-plugin as "cannot resolve symbol"

In my project's POM, I use maven-resources-plugin to set some properties from a file. However, Intellij flags these property references in the POM with the error "cannot resolve symbol", presumably because it cannot see them being defined anywhere. Is there a way to suppress this error?
Warning: The solution to define the property blank as vikingsteve mentioned is very dangerous because in Maven 3 properties which are declared in pom.xml could not be changed by other plugins.
So if you have one plugin which sets a property and another plugin which reads the value of the property it will always get an empty string if you initialize it in the pom.xml.
In fact you can't define it in the pom.xml but i have no idea what i can do to eliminate the IntelliJ IDEA warning. For now i have to disable the "Maven model inspection". :-(
The best way I see to solve the issue is to use the following comment:
<!-- suppress UnresolvedMavenProperty -->
Empty properties are not overwritten or may be a risky operation as #Josef mentioned.
Yes, you can open Settings (spanner icon), go to Project Settings -> Inspections and then disable the inspection Maven -> Maven Model Inspection.
Alternatively, you might like to try defining "blank" values for the properties, and see if the plugin successfully overwrites them.
<properties>
<myproperty></myproperty>
</properties>
Good luck!
Error “cannot resolve symbol” can occur if you open a directory maven project, but intellij project has not yet been created. Why does the "Maven model inspection" there is such a relationship - is not clear, but it helped me.

Activate a profile based on environment

Here's my scenario:
Maven 2.0.9 is our build system
We install code to multiple environments
All of our environment-specific properties are contained in property files, one for each environment
We currently read these properties into maven using the properties-maven-plugin; this sub-bullet is not a requirement, just our current solution
Goal:
Perform certain parts of the build (ie. plugin executions) only for certain environments
Control which parts are run by setting values in the environment-specific property files
What I've tried so far:
Maven allows plugins executions to be put inside pom profiles, which can be activated by properties; unfortunately these must be system properties - ie. from settings.xml or the command-line, not from properties loaded by the properties-maven-plugin
If possible, we'd like to keep everything encapsulated within the build workspace, which looks something like this:
project
pom.xml
src
...
conf
dev.properties
test.properties
prod.properties
build-scripts
build.groovy <-- the script that wraps maven to do the build
install.groovy <-- ... wraps maven to do the install
Running a build looks like:
cd build-scripts
./build.groovy
./install.groovy -e prod
Is there any possible way to accomplish these goals with the version of maven we are using? If not, is it possible with a newer version of maven?
This isn't possible using just Maven. (See also How to activate profile by means of maven property?) The reason is that profiles are the first thing evaluated before anything else to determine the effective POM.
My suggestion is to write some preprocessor that parses your environment specific property files and converts them to the required system properties before launching Maven. This script can be included in your ~/.mavenrc so that it runs automatically before Maven is launched. Here is an example script that that assumes the properties file is in a fixed location:
properties=`cat /etc/build-env.properties`
while read line; do
MAVEN_OPTS="$MAVEN_OPTS -D$line"
done <<< "$properties"
If the properties file is not fixed, you'll just need to add something to the script to discover the location (assuming it is discoverable).

Resources