Maven version error during build - maven

I get the following error when I am trying to build my project
Failed to execute goal org.eclipse.tycho:tycho-packaging-plugin:0.25.0:validate-version (default-validate-version) on project com.google.guice: Maven version 8.0.0.qualifier must have -SNAPSHOT qualifier for SNAPSHOT builds -> [Help 1]
I am not using release plugin for my build. I haven't seen this error before and not very certain about its meaning. All I am doing is changing version from in my pom from "-SNAPSHOT" to ".qualifier". Can someone help me understand what I am doing wrong? As far as I can tell I am not doing anything different from previous times I've build release version of my projects.
Here is my 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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>com.google.guice</artifactId>
<!-- BEFORE -->
<version>8.0.0-SNAPSHOT</version>
<!-- NOW -->
<version>8.0.0.qualifier</version>
<build>
...
...

Related

mvn Deployment failed: repository element was not specified in the POM

When I run mvn clean deploy on my project I get an error
Also my project in eclipse displays the following errors which I don't know if they are related to my current problem.
Project configuration not up-to-date with pom.xml
plugin configuration not covered by lifecycle configuration
In addition my eclipse doesn't seems to compile the files correctly. My SpringBoot java files aren't being compiled as java files. I can tell because if I deliberately induce syntax errors, there isn't a compilation error. This is all run on eclipse EE and is part of a maven project so I don't even know if a source folder is needed.
Also I'm displaying my main pom.xml file below and it has compilation errors on "pom" and both "&ndash"
I've tried the following solutions
Eclipse Blue, Maven: Project configuration is not up-to-date with pom.xml
Failed to resolve version for org.apache.maven.archetypes
repository element was not specified in the POM inside distributionManagement element or in -DaltDep loymentRepository=id::layout::url parameter
<?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">
<modelVersion>4.0.0</modelVersion>
<groupId>com.fanniemae.dfc</groupId>
<artifactId>dfc_app</artifactId>
<packaging>pom</packaging>
<version>0.0.1-SNAPSHOT</version>
<modules>
<module>dfc_angular</module>
<module>dfc_springBoot</module>
</modules>
<!--<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.3RELEASE</version>
<relativePath/> <!– lookup parent from repository
–>
</parent>-->
</project>
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project dfc_app: Deployment failed: repository element was not specified in the POM inside distributionManagement element or in -DaltDeploymentRepository=id::layout::url parameter
mvn deploy will deploy the produced artifact to a Maven Repository.
To do so it needs the configuration to which repository it must be deployed and this is missing.
But I assume that you don't want to deploy it to a repository but just build it.
That's mvn install This will install it in your local repository.
Maybe you should start with reading the docs: https://maven.apache.org/guides/getting-started/maven-in-five-minutes.html

Packaging for reactor multi module build?

I suppose I've made something wrong failing to find answer for basic philosophical question:
What is the correct packaging for reactor build module for multi module maven project?
I'm using pom but I don't feel it's correct since the pom artifact is used by no one:
<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.example.project</groupId>
<artifactId>reactor-build</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>pom</packaging>
<modules>
<module>../config</module>
<module>../module1</module>
<module>../module2</module>
</modules>
</project>
The packaging pom is the only allowed packaging for aggregator projects, that is to say a project with modules like the one you have, and also for parent projects. From Inheritance:
The packaging type required to be pom for parent and aggregation (multi-module) projects.
Any attempt to use a different packaging will result in an error when trying to build the project, such as the following when using jar (or keeping the default):
[ERROR] 'packaging' with value 'jar' is invalid. Aggregator projects require 'pom' as packaging.

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?

Cannot build a Hudson plugin using Maven

I cannot manage to build the Hudson plugin using Maven.
Here is my pom.xml:
<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>
<parent>
<groupId>org.jvnet.hudson.plugins</groupId>
<artifactId>hudson-plugin-parent</artifactId>
<version>2.2.1</version><!-- which version of Hudson is this plugin built against? -->
</parent>
<groupId>com.my-project</groupId>
<artifactId>my-project-hudson-asap-plugin</artifactId>
<version>2.0.1</version>
<packaging>hpi</packaging>
<name>my-project-hudson-asap-plugin</name>
<url>http://www.my-project.com</url>
</project>
Here is the error:
Failed to execute goal org.jvnet.hudson.tools:maven-hpi-plugin:3.0.1:run (default-cli) on project my-project-hudson-asap-plugin: Version of org.jvnet.hudson.main:gin:jar:2.1.2 is inconsistent with org.jvnet.hudson.main:hudson-war:war:2.2.1 -> [Help 1]
I have a feeling it has to do with moving to java 7, it worked in java 6 yet i've made many changes since i moved to java 7.
Any suggestions?
Thank you
Try compiling with different parent version, such as that 2.1.2 mentioned in the error. That should at least change the error message...
Or do you have some specific reason to use 2.2.1 parent, instead of an older one?

'parent.relativePath' points at my com.mycompany:MyProject instead of org.apache:apache - Why?

What is true is that Solr project directory is inside MyProject parent directory (but there's no module or any maven relationship between the 2, just FS convenience). Do I have to place it out?
$ mvn -DskipTests clean install
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for org.apache.lucene:lucene-solr-grandparent:pom:3.1-SNAPSHOT
[WARNING] 'parent.relativePath' points at com.mycompany:MyProject instead of org.apache:apache, please verify your project structure # line 23, column 11
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
from pom.xml:
<parent>
<groupId>org.apache</groupId>
<artifactId>apache</artifactId>
<version>8</version>
</parent>
$ pwd
/Users/simpatico/ws/MyProjectBaseDir/solr
Add an empty <relativePath> to <parent> so that it resolves the parent pom from the repositories.
<parent>
<groupId>org.apache</groupId>
<artifactId>apache</artifactId>
<version>8</version>
<relativePath></relativePath>
</parent>
Here is the relevant doc.
This feature is only for enhancing the development in a local checkout of that project. Set the value to an empty string in case you want to disable the feature and always resolve the parent POM from the repositories.
Default value is: ../pom.xml.
either ignore the warning, move the sources out of the unrelated parent or enter the correct value of to the element. The problem is caused by the default value for relativePath which is ../pom.xml and that default value gets injected in your effective pom, triggering the warning.
That message might be caused by a pom.xml in the parent directory relative to your current project. The pom in the parent directory does not match the project.parent config of the current pom.
I have a fringe case. A fat finger case on my part.
My pom parent had this:
<?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">
<modelVersion>4.0.0</modelVersion>
<groupId>com.mygroup </groupId>
<artifactId>pom-parent</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<name>pom-parent</name>
and my (child) pom
<parent>
<groupId>com.mygroup</groupId>
<artifactId>pom-parent</artifactId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>../pom-parent/pom.xml</relativePath>
</parent>
My group id in my parent had a fat finger space at the end of the name. "com.mygroup " instead of the correct "com.mygroup".
Because of this fat finger mistake........the "groupId" names did not match....and I got the error.
Aka, check for fat finger mistakes before you go to too many extremes to resolve.
error I got for internet-searching
"Project build error: 'parent.relativePath' of POM" "points at"
"please verify your project structure"
I think you have missed out the <relativePath> tag in the question. I'm saying that because, without it This error will not arise. That being said,
The line you will have to concentrate is the below warning statement.
'parent.relativePath' points at com.mycompany:MyProject instead of
org.apache:apache
It clearly says that the relative path of tag on your module points to a pom file which has different artifactId compared to what is specified
This is because there is a mismatch between the artifactId of your parent/pom.xml and the artifactId you have mentioned in the <parent> tag of module/pom.xml. To avoid the warning change the <parent> in your module/pom.xml as shown below.
<parent>
<groupId>com.mycompany</groupId>
<artifactId>MyProject</artifactId>
<version>8</version>
<relativePath>path-to-your-parent-pom.xml</relativePath>
</parent>
I had the same warning quite a long time. The cause was simply a pom.xml in the parent folder of the project where the warning occured.
As soon as I had removed the ../pom.xml the warning was gone.
This was kind of indicated in some of the above comments/answers. Normally you don't set the <relativePath> field at all when it is remote.
The pom.xml was there by mistake; obviously the result of an errornous action within another project or just an errornous copy destination by myself.

Resources