Can't figure out a global setting for pom.xml - maven

I'm trying to compile an open source project on Github that has no build instructions. I know it's built with Maven, but there are some variables that need to be set in settings.xml and I cannot find in the Maven documentation anything about the custom variables (outside of "servers", "proxies", etc). I found this answer that helps a bit, but I still cannot figure it out.
For example, Where do I set the value ${global.awe.version} used in the top level pom.xml file, where it seems to be defined 2 lines later:
<global.awe.version>3.6.0-rc-05</global.awe.version>?
<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/xsd/maven-4.0.0.xsd">
...
<version>${global.awe.version}</version>
<properties>
<global.awe.version>3.6.0-rc-05</global.awe.version>
<global.awe-api.version>2.2.0-rc-05</global.awe-api.version>
</properties>
...

Related

maven read pom.xml containing multiple modules and write file

We have "master" pom.xml file and has multiple modules, using maven-antrun-plugin or other plugin, how do we be able to achieve by means of writing a file to all module folders in this master pom.xml? Want to store a file containing "${project.version}". For instance, we run mvn clean verify, we want to retrieve the version from this master pom.xml and store as file to all multiple modules.
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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.mp</groupId>
<artifactId>parentApp</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<name>parentApp</name>
<description>This is just to test pom inheritance</description>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<modules>
<module>../example1</module>
<module>../example2</module>
<module>../example3</module>
<module>../example4</module>
<module>../example5</module>
..
..
Never mind - we can add exec-maven-plugin to run the bash script to list all multiple modules, for loop - copy the folder to all modules.

How to use smartics-jboss-modules maven plugin in maven project

We can create module.xml manually and keep it in modules folder of Jboss. But to autogenerate it, there is a plugin called smartics-jboss-modules-maven-plugin. Has anyone implemented it in maven project. My requirement is to generate module.xml and module from maven project and automatically add it to jboss modules folder. I need to know the exact steps to implement it in my project.
and inside that particular folder make sure you create a file that complies with the following model
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
</project>
As documented in here:
https://www.smartics.eu/confluence/display/SJBMMP/The+smartics+JBoss+Modules+XSD

Maven Install adds version id in final name of the war file

I am beginner with maven.
I have a pom file something like this
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>group</groupId>
<artifactId>artID</artifactId>
<version>${FILE_VERSION}</version>
...
When the install command is run, I get example_dir/1.0.1/application-1.0.1.war
I want to retain version in directory structure but I want to remove the version from war file name.
Is it possible?
The structure in the local repository (usually .m2/repository) is fixed and cannot be changed.
If you need a different name, you need to rename the file after downloading it from the local repository.

OpenDolphin Maven on Netbeans basic config

I'm trying to get started with JavaFX / OpenDolphin and have downloaded the jumpstart zip. When I import the Maven zip into Netbeans, I get the expected project tree. Then I try to run jumpstart_0 and get the following error:
Could not find artifact MyFirstDolphin:server:jar:1.0-SNAPSHOT
As Maven is also new to me, I am puzzled as to where to begin solving this problem.
Two suggestions by HelpWiki are:
The POM misses the declaration of the repository which hosts the artifact.
The repository you have configured requires authentication and Maven failed to provide the correct credentials to the server. In this case, make sure your ${user.home}/.m2/settings.xml contains a declaration whose matches the of the remote repository to use.
Here is the current pom.xml:
<?xml version="1.0" encoding="UTF-8"?>
<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/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>MyFirstDolphin</artifactId>
<groupId>MyFirstDolphin</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>shared</artifactId>
</project>
There is obviously some basic knowledge I'm lacking and it would be great if someone could shed some light on this. DolphinJumpStart doesn't work 'out of the box' in Netbeans 8 on Windows 7, so there must be others with the same problem?

A way to add new tags at pom.xml

I'm working on a project that uses Maven and Eclipse.
In this project I have some artifacts (like jar's, war's and so on) and want to add some features (or 'attributes') to those artifacts. (simple string fields)
Some of these attributes could be something like a "problem-description" tag.
I'm wondering about the possibility of adding these attributes into their own pom.xml associated files.
So, here is my question: there's a way to add customized tags at pom.xml?
If not, could I modify the maven configuration to point to other XML Schema modified by me (to add the validation of the attribute created by me)?
I'm using Maven 3.0.5
Thanks in advance
you can define properties in pom.xml like this:
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.domain.example</groupId>
<artifactId>example-artifact</artifactId>
<version>1.0.0-SNAPSHOT</version>
<name>${project.artifactId}</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.build.compiler.version>1.6</project.build.compiler.version>
<myProperty>myValue</myProperty>
</properties>
</project>
so within pom.xml or a filtered file you can use ${myProperty} to have maven fill in "myValue"
if you want to use a plugin this guide may help: http://maven.apache.org/guides/mini/guide-configuring-plugins.html - within the configuration section you can do almost anything.

Resources