Skip to content
This repository has been archived by the owner on Dec 20, 2018. It is now read-only.

Error while building with Maven #16

Open
vsimko opened this issue Feb 24, 2017 · 1 comment
Open

Error while building with Maven #16

vsimko opened this issue Feb 24, 2017 · 1 comment
Assignees
Labels

Comments

@vsimko
Copy link
Member

vsimko commented Feb 24, 2017

Expected behaviour

Mavan should build the application.

Actual behavior

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7.615 s
[INFO] Finished at: 2017-02-24T12:52:47+01:00
[INFO] Final Memory: 17M/441M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project heatstressrouting: Could not resolve dependencies for project joachimrussig:heatstressrouting:war:0.0.1-SNAPSHOT: Could not find artifact net.osmand:osmand-core:jar:1.0 in Local repository (file:///home/simko/path-optimizer/lib) -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException

Steps to reproduce the behavior

git clone https://github.com/biggis-project/path-optimizer.git
cd path-optimizer
mvn clean install
@joachimrussig
Copy link
Collaborator

Okay, I was not able to reproduce the problem locally.

The actual problem is that the lib/OsmAnd-core.jar is not correctly installed to the local maven repository in the lib directory. There is a install-file command in the pom.xml executed during the initialize phase which should install the file to the respective local repository, but sadly that seems not to work as expected. Unfortunately the osmand library is not available on mvnrepository.com, which would make the things a lot easier.

One workaround could be to execute the install-file command manually in the project root directory before running mvn clean install:

mvn install:install-file -Dfile=./lib/OsmAnd-core.jar \
    -DgroupId=net.osmand \
    -DartifactId=osmand-core \
    -Dversion=1.0 \
    -Dpackaging=jar \
    -DlocalRepositoryPath=./lib

@vsimko it would be great if you could test the workaround.

I'll going to try to reproduce the problem and to find a permanent fix, but most likely not before the next weekend. But unfortunately, it seems that there is no easy and reliable way to add jar files to a maven project (I would appreciate any tips).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants