How to build orekit from maven? - maven

I am having issues building orekit. I am following this guide below:
https://www.orekit.org/site-orekit-latest/building.html
I have installed jdk and installed java (version 14.0.2) to the path as well as incorporated the necessary users paths (JAVA_HOME, M2_HOME, and MAVEN_HOME). I also installed the latest version of maven version 3.6.3). I tried running "mvn package" and it came up with a build failure:
[ERROR] The goal you specified requires a project to execute but there is no POM in this directory (C:\Users####). Please verify you invoked Maven from the correct directory. -> [Help 1]
I am not very technically proficient using the command prompt. I assume I need something relating to orekit in the same directory. I have a folder labeled orekit which I got from github in the same directory but I still get the error.
Help please.

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)

Jenkins build error FATAL: Couldn’t find any executable in C:\apache-maven-3.5.0\bin

I started using Jenkins 2.73.1 on Windows 7.
I also have Apache Maven 3.5.0 installed at C:\apache-maven-3.5.0\bin.
In Manage Jenkins -> Global Tool Configuration, I defined the maven installation.
I defined MAVEN_HOME as C:\apache-maven-3.5.0\bin, but it gives me a warning message
"C:\apache-maven-3.5.0\bin doesn’t look like a Maven directory".
I leave the setting as is because that is the correct maven install directory.
Should the path be something else?
I proceed with the project build and I get this error.
FATAL: Couldn’t find any executable in C:\apache-maven-3.5.0\bin
Build step 'Invoke top-level Maven targets' marked build as failure
Finished: FAILURE
What doesn't make sense is that I believe I have the correctly configured the Maven install so I don't know why I get the warning message and the error.
After searching online some seems to indicate that it is looking for mvn.cmd or mvn.bat so I made a copy to have both files in the directory but doesn't work for me.
I found my answer.
I defined MAVEN_HOME as C:\apache-maven-3.5.0\bin, but it should be MAVEN_HOME as C:\apache-maven-3.5.0.
This worked for me.
ikask

protobuf-maven-plugin, jenkins build fail

I am new for Jenkins building jobs.
Currently, i am trying to build a project which has protobuf-maven-plugin init for compile .proto file to generate required java file from it.
In local machine, able to do maven install build from STS by specifying protoc.exe path in Path environment variables. Where as in Jenkins it is failing to locate protoc, by stating below error
[ERROR] Failed to execute goal com.github.igor-petruk.protobuf:protobuf-maven-plugin:0.6.5:run (default) on project betstream-proto:
Cannot execute 'protoc': Cannot run program "protoc": error=2, No such file or directory -> [Help 1]
Where as Jenkins is already deployed in Dev environment of my company.
Please any one help me to resolve this issue. Thanks in advance.

Maven java compile error can not access CommonClassA

Background:
I am developing Maven multi module project.
One of the module is common module needed by other all modules.
This module contain CommonClassA.java.
common module is properly compiled.
It is installed into maven local repository properly.
One of the class(Billtype.java) in other module (EmployeeBilling) refers this class(CommonClassA.java).
Maven Dependency for common module is properly specified in pom.xml of EmployeeBilling module.
Problem:
While compiling EmployeeBilling module it throws
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project EmployeeBilling: Compilation failure
[ERROR] \MyWorkspace\Biz\EmployeeBilling\src\main\java\com\employee\Billtype.java:[79,19] error: cannot access CommonClassA
[ERROR] -> [Help 1]**
Supporting details:
dependency defined in EmployeeBilling> pom.xml:
Other classes from common module seems accessible as no error observed
There are no other errors like Class not found/file not found.
The class CommonCLassA implements Serializable
Same error occurs from Eclipse as well as commond line
I am using M2E plugin
Tools:
jdk1.7.0_02
OS: Windows 7
Eclipse JUNO and apache-maven-3.1.0
Thanks in advance!
If project builds properly using eclipse compiler then it should work with Maven.
Few things to check if its not working with maven:
Manually check in repository that jar is installed properly and it contains your class file.
Try to build project using locally installed Maven instead of maven in eclipse.
Set -DskipTest=true while installing your jar, as it can cause issues at times.
If these steps don't work then show us your pom.
With no more information it's hard to find the cause. But I also had this problems now and then, and there are some things which could go wrong:
Are you using the right JAVA version (everywhere) ?
... and the right java PROVIDER? (Oracle, IBM, OpenJDK) In my case it's often this issue, I'm sometimes bound to IBM JDK, although I try to use Oracle where I can and this sometimes breaks my build.
Is the right maven dependency VERSION used? If you depend on it multiple times, and all in the same (lower than root) dept of dependencies, Maven will just "choose" a version. It could be that thát version is incompatible with your code of thát particular dependency
Skipping tests sometimes WORKS! It has something to do with maven phases and getting stuff ready for using it elsewhere.
Good luck :)
I had the same problem. Even the jar dependency has the required class files. Finally I deleted the local maven repo and restarted the build. Now it worked without any issue.
It looks like you are using an old version of maven-compiler-plugin (v2.3.2).
I suggest you upgrade it to 3.x. it won't magically fix your issue but it will definitely give you better / more detailed error message.

Hudson build error: LifecycleExecutionException Unable to locate the Javac Compiler in

I created a dynamic web project in eclipse for a web service with axis2. I then converted it into Maven project, I'm able to compile and generate war file in eclipse, but when i deploy it on server and try to build it with Hudson-3.0.0 it gives me following error:
mojoFailed org.apache.maven.plugins:maven-compiler-plugin:2.3.2(default-compile)
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project WebServices: Compilation failure
Unable to locate the Javac Compiler in:
C:\Program Files (x86)\Java\jre6..\lib\tools.jar
Please ensure you are using JDK 1.4 or above and
not a JRE (the com.sun.tools.javac.Main class is required).
Please Let me know what's wrong with it!
I have exactly the same problem, ever since I upgraded Hudson from 2.2.1 to 3.0.1.
Both JAVA_HOME environment variable and JDK in hudson configuration point to JDK and not to JRE.
If I run mvn compile in the workspace directory of the job, everything works well.
Looks like the hudson cannot find java_home.
In hudson settings java.home property is set correctly ?
Does any other java projects builds successfully ?
Did you do what the exception said yet?
Please ensure you are using JDK 1.4 or above and
not a JRE (the com.sun.tools.javac.Main class is required).
Sounds like you don't have Java installed. So install it.

Resources