Install fail for Maven 3.0.4 - maven

CentOS with java 1.4.2 and ant 1.6.5
Download maven 3.0.4 source
export M2_HOME=$HOME/maven/
ant
I then get following log. Couldn't find anything on google. Suggestions appreciated.
Buildfile: build.xml
clean-bootstrap:
initTaskDefs:
[echo] Building Apache Maven ...
isMavenHomeSet:
init:
[echo] maven.home = /home/larryk/maven/
[echo] maven.repo.local = /home/larryk/.m2/repository
[echo] distributionId = apache-maven
[echo] distributionName = Apache Maven
[echo] distributionDirectory = apache-maven
prompt-maven-home-exists:
pull:
[artifact:pom] -----------------------------------------------------
[artifact:pom] this realm = plexus.core
[artifact:pom] Number of imports: 0
[artifact:pom] -----------------------------------------------------
[artifact:pom] An error has occurred while processing the Maven artifact tasks.
[artifact:pom] Diagnosis:
[artifact:pom]
[artifact:pom] Unable to find component: org.apache.maven.project.MavenProjectBuilder
[artifact:pom] java.util.concurrent.BlockingQueue
BUILD FAILED
/home/downloads/apache-maven-3.0.4/build.xml:105: Unable to find component: org.apache.maven.project.MavenProjectBuilder
Total time: 1 second
Added
Thanks to #sparc_speed, I found the problem.
First issue was to upgrade to current Java. I used yum to automatically update the system. That brought me Java 1.6. Unfortunately that didn't solve the build problem--exact same error as before.
Turns out that yum had updated Java to 1.6. But yum didn't automatically upgrade the libraries. After the yum upgrade, these packages were on the system:
java-1.4.2-gcj-compat.i386
java-1.4.2-gcj-compat-devel.i386
java-1.6.0-openjdk.i386
Answer was to manually use yum to install the latest libraries:
sudo yum install java-1.6.0-openjdk-devel.i386
Note that maven still doesn't build:
BUILD FAILED
/home/downloads/apache-maven-3.0.4/build.xml:228: Syntax error in property: ${
but that's their problem, I'll file a bug with them.
Ant 1.8+ required Looks like the build error is a doc error that was fixed on the maven website but not in the project's README.bootstrap.txt file.
I'll file a bug against the readme file.
Bug report filed

You mentioned that you were using Java 1.4 - you probably need to upgrade. It would seem from this error message that Maven 3.0 needs java.util.concurrent.BlockingQueue, which was first added to Java in 1.5

Related

Could not find artifact org.apache.pulsar:pulsar-broker:pom:2.12.0-SNAPSHOT in apache.snapshots (https://repository.apache.org/snapshots)

While following the instructions to setup IntelliJ for pulsar development I got the below error
Could not find artifact org.apache.pulsar:pulsar-broker:pom:2.12.0-SNAPSHOT in apache.snapshots (https://repository.apache.org/snapshots)
Digging deeper into the snapshots, I don't see pulsar-broker at 2.12.0 either: https://repository.apache.org/content/groups/snapshots/org/apache/pulsar/pulsar-broker/
Is there some configuration step missing?
Attempted Fix [RESOLVED]
accepted answers steps and fix an issue with SDKMAN to have mvn call Java 17
I tried the command mvn -Pcore-modules,-main clean install -DskipTests -Dspotbugs.skip=true and got the new error below.
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project buildtools: Compilation failure
[ERROR] /Users/brandon.hoffman/Projects/pulsar/buildtools/src/main/java/org/apache/pulsar/tests/RetryAnalyzer.java:[30,18] cannot access org.testng.ITestResult
[ERROR] bad class file: /Users/brandon.hoffman/.m2/repository/org/testng/testng/7.7.0/testng-7.7.0.jar(org/testng/ITestResult.class)
[ERROR] class file has wrong version 55.0, should be 52.0
[ERROR] Please remove or make sure it appears in the correct subdirectory of the classpath.
Running this on the command line will fix that problem:
mvn -Pcore-modules,-main clean install -DskipTests -Dspotbugs.skip=true
You must use Java 17 for compiling the master branch version of Pulsar (requirements).
It's possible that there has been some change in the maven build after the instructions were originally written.
It does not look like the project is currently using the repository.apache.org for nightly snapshots. You should ask your question on the dev#pulsar.apache.org mailing list.
Also we have not yet cut the 2.12 branch. The VOTE for the first release of 2.11.0 just passed the PMC.
(FYI I am an Apache Pulsar PMC Member)

Maven error when attempting to build a zookeeper rpm package

Trying to build an zookeeper rpm package.
In .spec file have specified:
BuildRequires: python-devel,gcc,make,libtool,autoconf,cppunit-devel,hostname,systemd,maven
But does not seem to like the version of maven used:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:3.0.0-M3:enforce (banned-commons-lang) on project parent: A type incompatibility occured while executing org.apache.maven.plugins:maven-enforcer-plugin:3.0.0-M3:enforce: org.sonatype.aether.util.DefaultRepositorySystemSession cannot be cast to org.eclipse.aether.RepositorySystemSession
Is there a way I can force it to use a newer maven like https://dlcdn.apache.org/maven/maven-3/3.8.6/binaries/apache-maven-3.8.6-bin.tar.gz
That I have been advised works ok with zookeeper 3.8.0?
Have tried specifying BuildRequires >=3.8.6
But results in this error:
Error: No Package found for maven >= 3.8.6
Any help appreciated - very new to builds.
Thanks khmarbaise, pointed me in the right direction, in the .spec file I added the following to use the latest maven:
Added new source entry for maven repo in package info section:
Source5: https://dlcdn.apache.org/maven/maven-3/3.8.6/binaries/apache-maven-3.8.6-bin.tar.gz
%prep
tar xvf %SOURCE5 -C /usr/local/**
%build
/usr/local/apache-maven-3.8.6/bin/mvn -DskipTests package
Now .rpm files generated as expected.

Maven issue while Building for a latest fix given by WSO2

WSO2 has given a latest fix for Governance Registry5.3.0(Governance REST API Update issue). While building a code for applying a fix the below error is thrown.
Error when building code using Maven.
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.1:compile (default-compile) on project org.wso2.carbon.governance.api: Compilation failure: Compilation failure:
[ERROR] \Users\a596500\Downloads\carbon-governance-master\components\governance\org.wso2.carbon.governance.api\src\main\java\org\wso2\carbon\governance\api\util\CheckpointTimeUtils.java:[22,30] error: package org.apache.commons.lang does not exist
[ERROR] Failed to execute goal on project org.wso2.carbon.governance.api: Could not resolve dependencies for projectorg.wso2.carbon.governance:org.wso2.carbon.governance.api:bundle:4.7.2-SNAPSHOT: The following artifacts could not beresolved: org.wso2.carbon.registry:org.wso2.carbon.registry.extensions:jar:4.6.1-SNAPSHOT, org.wso2.carbon.registry:org.wso2.carbon.registry.common:jar:4.6.1-SNAPSHOT, org.wso2.carbon.registry:org.wso2.carbon.registry.admin.api:jar:4.6.1-SNAPSHOT
org.wso2.carbon.registry:org.wso2.carbon.registry.indexing:jar:4.6.1-SNAPSHOT: Could not find artifact org.wso2.carbon.registry:org.wso2.carbon.registry.extensions:jar:4.6.1-SNAPSHOT in nexuspro-level0 (https://repo.fmr.com/content/groups/level0/)
Please clone below repos, Move to the relevant tag and run an mvn clean install -e on each and every repo accordingly.
https://github.com/wso2/carbon4-kernel.git tag : 4.4.7
https://github.com/wso2/carbon-registry.git tag : 4.6.0
https://github.com/wso2/carbon-governance.git tag : 4.7.1
https://github.com/wso2/carbon-governance-extensions.git tag : 4.5.2
https://github.com/wso2/jaggery-extensions.git tag : 1.5.5
https://github.com/wso2/carbon-store tag : 2.4.6
https://github.com/wso2/product-greg.git tag : 5.3.0
To apply the fix and generate the latest jar you have to apply the fix manually to 5.3.0 tag from your local machine and build the source.

Unable to get dependency information when running mvn jetty:run

I cloned a project from github and try to build it. Follow its instruction I run mvn package but when I try to run mvn jetty:run. It failed and give me:
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to resolve artifact.
Unable to get dependency information: Unable to read the metadata file for artifact 'org.mortbay.jasper:apache-jsp:jar': Cannot find parent: org.eclipse.jetty:jetty-parent for project: org.mortbay.jasper:jasper-jsp:pom:8.0.9.M3 for project org.mortbay.jasper:jasper-jsp:pom:8.0.9.M3
org.mortbay.jasper:apache-jsp:jar:8.0.9.M3
Why this happen?
Upgrade maven to version 3 or higher. I had maven 2.2.1, then I upgraded it to 3.3.9 and this issue was solved.
Also use JDK 1.7 or higher.

Cannot find parent: net.java:jvnet-parent for project: com.sun.jersey:jersey-project:pom:1.9

My project invloves of spring-data-neo4j,when runnging mvn clean install,
there is a maven build error.
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error building POM (may not be this project's POM).
Project ID: com.sun.jersey:jersey-project:pom:1.9
Reason: Cannot find parent: net.java:jvnet-parent for project: com.sun.jersey:jersey-project:pom:1.9 for project com.sun.jersey:jersey-project:pom:1.9
"The root cause is a deficiency in Maven 2.2.1. It's not following 301 redirects; if you look at the .pom that is downloaded into your local repository, you will see the 301 HTML that was delivered from the server. More information is available at http://jira.codehaus.org/browse/WAGON-314 . It sounds like the only workaround is to either downgrade to 2.2.0, or upgrade to a newer version of Maven 3." (mrandall_cerner_com at https://java.net/jira/browse/JERSEY-1080 )
I second the issue here with specific version of maven installation. 2.2.1
Steps for resolution : (Assuming you have ubuntu)
If maven (2.2.1) is already installed :
sudo apt-get remove maven2 [To uninstall current maven 2.2.1]
sudo apt-get install maven [Will install upgraded version]
Verify :
mvn --version [Expect to display 3.*]
Try this and see:
Go to Eclipse-> Window-> Preferences->Maven->User Settings
Copy the local repository path of your machine
Navigate to .m2\repository\com\sun\jersey\jersey-project and clean all folders
if jersey-project folder is not there then
clean .m2\repository\com\sun\jersey contents..
Then on you project update you maven depencies (then check if all jars are downloaded to .m2\repository\com\sun\jersey folder)

Resources