In Eclipse I can build my project with the following steps:
- clone project from github
- Maven -> Update project with the following settings enabled
- "Update dependencies"
- "Update project configuration from pom.xml"
- "Refresh workspace resources from local filesystem"
- "Clean projects"
- Run as -> Maven install The build succeeds.
Now I want to do the same from the CLI.
- I dont know which arguments I need to fully replicate the steps from eclipse, I tried the following
- mvn clean
- mvn dependency:resolve
- mvn eclipse:eclipse
- mvn install -U
The installation fails with a lot of errors (see example below) about packages that doesn't exist. This is normally done in step 2 for the eclipse procedure. When I perform this step in eclipse and run mvn install, then it works.
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /C:/projects/git/mypackage/src/mypackage/myfile.java:[13,10] package ij does not exist
I suppose I am using the wrong CLI commands. Someone knows which I should use?
-- edit --
The only file that contains a reference to ij.jar is the MANIFEST.MF:
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Tasks
Bundle-SymbolicName: mypackage
Bundle-Version: 1.0.0.qualifier
Bundle-ClassPath: mypackage.jar,
lib/ij.jar
The file ij.jar is located in the lib folder.
The error above indeed is the first error. The other errors are similar, therefore I didn't copy all of them.
The difference in output of mvn install -U from the CLI compared to the output of the console in eclipse after using Update project followed by Run as -> Maven install is
[INFO] Scanning for projects...
[INFO]
[INFO] ---------------< mypakcage >----------------
[INFO] Building mypackage 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ mypackage ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 12 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.0:compile (default-compile) @ mypackage ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 202 source files to C:\projects\eclipse\mypackage\target\classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /C:/projects/git/mypackage/src/mypackage/myfile.java:[13,10] package ij does not exist
vs
[INFO] Scanning for projects...
[INFO]
[INFO] ---------------< mypackage:mypackage >----------------
[INFO] Building mypackage 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ mypackage ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 12 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.0:compile (default-compile) @ mypackage ---
[INFO] Nothing to compile - all classes are up to date
The errors occur once the build tries to compile mypackage.