Cannot build a Hudson plugin using Maven - 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?

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

Maven version error during build

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>
...
...

Maven relative path seemed to resolve to a concatentation of 2 full paths

I have the following pom.xml 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>
<groupId>com.globalfoundries.pdk.dm</groupId>
<artifactId>pdk-swtcommon</artifactId>
<version>1.6-SNAPSHOT</version>
<packaging>jar</packaging>
<name>PDK SWT Common</name>
<url>http://maven.apache.org</url>
<parent>
<groupId>com.globalfoundries.pdk</groupId>
<artifactId>pdk-parent</artifactId>
<version>1.2</version>
<relativePath>../pdk-parent/pom.xml</relativePath>
</parent>
...
</project>
When I do an Maven Clean, I got an error that seems to concatenate the full path for the pdk-parent/pom.xml into the current path where it complaints about non-readable POM and the path that is was given is:
\MPTFS04\cley\Profile\Perforce\pdk-workspace\pdk-qa\shared\dev\DEV\java\pdk-swtcommon\MPTFS04\cley\Profile\Perforce\pdk-workspace\pdk-qa\shared\dev\DEV\java\pdk-parent\pom.xml
Well, \MPTFS04\cley\Profile\Perforce\pdk-workspace\pdk-qa\shared\dev\DEV\java\pdk-swtcommon is where my current project and pom.xml is; and \MPTFS04\cley\Profile\Perforce\pdk-workspace\pdk-qa\shared\dev\DEV\java\pdk-parent\pom.xml is where the parent pdk-parent\pom.xml full path is... I am running on a Windows 7 machine and those are the mounted network drive... I am running the Maven build within Eclipse.
(see error below)
[INFO] Scanning for projects... [ERROR] [ERROR] Some problems were
encountered while processing the POMs: [FATAL] Non-readable POM
\MPTFS04\cley\Profile\Perforce\pdk-workspace\pdk-qa\shared\dev\DEV\java\pdk-swtcommon\MPTFS04\cley\Profile\Perforce\pdk-workspace\pdk-qa\shared\dev\DEV\java\pdk-parent\pom.xml:
\MPTFS04\cley\Profile\Perforce\pdk-workspace\pdk-qa\shared\dev\DEV\java\pdk-swtcommon\MPTFS04\cley\Profile\Perforce\pdk-workspace\pdk-qa\shared\dev\DEV\java\pdk-parent\pom.xml
(The system cannot find the path specified) #
\MPTFS04\cley\Profile\Perforce\pdk-workspace\pdk-qa\shared\dev\DEV\java\pdk-swtcommon\MPTFS04\cley\Profile\Perforce\pdk-workspace\pdk-qa\shared\dev\DEV\java\pdk-parent\pom.xml
# [ERROR] The build could not read 1 project -> [Help 1]
Change your relativePath element to:
<relativePath>../pdk-parent</relativePath>
Here is what I finally got it working for me....
My environments:
Version Control: Perforce
Windows 7
Eclipse Mars (4.5.2 Build 20160218-0600)
Maven Integration For Eclipse 1.6.2.20150902-0002
When I initially setup the projects
- My Perforce workspace is on the networked drive (\myfilesystem\mounted\joe...)
- My Eclipse workspace is on the C:\ drive.
I got the error that it is unable to find the "pom.xml" for the dependencies using the "relative path"... I noticed that it was searching for "C:..." (the error on the console is using \myfilesystem\mounted\joe... which threw me off; I only noticed that C:\ reference in a different place.)
Nevertheless, I re-setup a new Eclipse workspace on my network drive and redo everything... Now it seems to be working.
Just FYI.

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?

Resources