I am trying to create an OSGi maven project in Intellij Idea. It is a simple calculator. When I try to build my project the following error message appears on the console. What can be the reason?
The error message like this:
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building cal 1.0.0
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for org.eclipse.osgi:org.eclipse.osgi:jar:3.9.1.v20130814-1242
is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.445s
[INFO] Finished at: Fri May 23 09:22:30 IST 2014
[INFO] Final Memory: 6M/146M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project cal: Could not resolve dependencies
for project org.wso2.nilash:cal:jar:1.0.0: Failure to find
org.eclipse.osgi:org.eclipse.osgi:jar:3.9.1.v20130814-1242 in
http://repo.maven.apache.org/maven2 was cached in the local repository,
resolution will not be reattempted until the update interval of central has elapsed or updates are forced -> [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
I also add the dependency in pom.xml like this:
<dependency>
<groupId>org.eclipse.osgi</groupId>
<artifactId>org.eclipse.osgi</artifactId>
<version>3.9.1.v20130814-1242</version>
</dependency>
I also add different versions. But It didn't work.
The console output itself contains a hint as to what can be the cause of your problems.
From the apache maven documentation on confluence:
This error generally occurs when Maven could not download dependencies. Possible causes for this error are:
- The POM misses the declaration of the 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<server>
declaration whose<id>
matches the<id>
of the remote repository to use. See the Maven Settings Reference for more details.- The remote repository in question uses SSL and the JVM running Maven does not trust the certificate of the server.
- There is a general network problem that prevents Maven from accessing any remote repository, e.g. a missing proxy configuration.
- You have configured Maven to perform strict checksum validation and the files to download got corrupted.
- Maven failed to save the files to your local repository, see
LocalRepositoryNotAccessibleException
for more details.
Similar problems can also occur if an incompatible version of the JAR is cached in your local Maven repository. In this case you should also try building your project with the -U
command line parameter ( mvn clean install -U
should do the trick) or manually cleaning the local repository (found in the ${user.home}/.m2/repository
directory and then triggering a build.