Quantcast
Channel: Apache Timeline
Viewing all articles
Browse latest Browse all 5648

Cannot find parent POM... but it's there!

$
0
0
Hey guys,

I want to build a project that I downloaded
(https://sourcecode.valg.no/websvn/listing.php?repname=Internettstemmegivning)
and that is supposed to work fine.

Yet I cannot build even the first module, because Maven tells me it
cannot find the parent POM. The parent POM is there in the local repo,
at the correct location, yet somehow Maven refuses to see it and tries
to fetch it remotely, which clearly will not work. This parent POM is a
general POM of packaging type "pom" that defines some plugin versions to
be used etc.

Put simply:
* I extracted the m2repository.tar (from the above URL) to
/home/malte/.repository
* I extracted the module "cryptography-2.0.0" from code.tar (from the
above URL) to /home/malte/cryptography-2.0.0

Now, in /home/malte/cryptography-2.0.0/pom.xml there is the section:

<parent>
<groupId>com.scytl</groupId>
<artifactId>maven-generic-conf</artifactId>
<version>1.1.39</version>
</parent>

The corresponding parent POM *does exist* in the local repo:
$ ls
~/.repository/com/scytl/maven-generic-conf/1.1.39/maven-generic-conf-1.1.39.pom
/home/malte/.repository/com/scytl/maven-generic-conf/1.1.39/maven-generic-conf-1.1.39.pom

Yet when I try to validate the module cryptography-2.0.0:

[~/cryptography-2.0.0] $ mvn validate -X -U
-Dmaven.repo.local=/home/malte/.repository
Apache Maven 3.0.4
...snip...
[INFO] Error stacktraces are turned on.
[DEBUG] Reading global settings from /usr/share/maven/conf/settings.xml
[DEBUG] Reading user settings from /home/malte/.m2/settings.xml
[DEBUG] Using local repository at /home/malte/.repository
[DEBUG] Using manager EnhancedLocalRepositoryManager with priority 10
for /home/malte/.repository
[INFO] Scanning for projects...
[DEBUG] Verifying availability of
/home/malte/.repository/com/scytl/maven-generic-conf/1.1.39/maven-generic-conf-1.1.39.pom
from [central (http://repo.maven.apache.org/maven2, releases)]
[DEBUG] Using connector WagonRepositoryConnector with priority 0 for
http://repo.maven.apache.org/maven2
Downloading:
http://repo.maven.apache.org/maven2/com/scytl/maven-generic-conf/1.1.39/maven-generic-conf-1.1.39.pom
[DEBUG] Writing resolution tracking file
/home/malte/.repository/com/scytl/maven-generic-conf/1.1.39/maven-generic-conf-1.1.39.pom.lastUpdated
[ERROR] The build could not read 1 project -> [Help 1]
org.apache.maven.project.ProjectBuildingException: Some problems were
encountered while processing the POMs:
[FATAL] Non-resolvable parent POM: Could not find artifact
com.scytl:maven-generic-conf:pom:1.1.39 in central
(http://repo.maven.apache.org/maven2) and 'parent.relativePath' points
at wrong local POM @ line 3, column 13

at
org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:363)
...snip...
[ERROR] The project com.scytl.jbasis:cryptography:2.0.0
(/home/malte/cryptography-2.0.0/pom.xml) has 1 error
[ERROR] Non-resolvable parent POM: Could not find artifact
com.scytl:maven-generic-conf:pom:1.1.39 in central
(http://repo.maven.apache.org/maven2) and 'parent.relativePath' points
at wrong local POM @ line 3, column 13 -> [Help 2]
org.apache.maven.model.resolution.UnresolvableModelException: Could not
find artifact com.scytl:maven-generic-conf:pom:1.1.39 in central
(http://repo.maven.apache.org/maven2)
...snip...
Caused by: org.sonatype.aether.transfer.ArtifactNotFoundException: Could
not find artifact com.scytl:maven-generic-conf:pom:1.1.39 in central
(http://repo.maven.apache.org/maven2)
...snip...
[ERROR] [Help 1]
http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[ERROR] [Help 2]
http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException

As you can see Maven tries to fetch
com.scytl:maven-generic-conf:pom:1.1.39 from central, which clearly does
not work.

What bugs me in particular is this line:
[DEBUG] Verifying availability of
/home/malte/.repository/com/scytl/maven-generic-conf/1.1.39/maven-generic-conf-1.1.39.pom
from [central (http://repo.maven.apache.org/maven2, releases)]

Why? WHY? I mean, the file
/home/malte/.repository/com/scytl/maven-generic-conf/1.1.39/maven-generic-conf-1.1.39.pom
is THERE. It's fine. Why does Maven want to download it from central
repo? Why won't it just read it?

Also, if I actually put maven-generic-conf-1.1.39.pom in the parent
directory and rename it to pom.xml, the build works fine:

[~] $ mkdir maven-generic-conf
[~] $ cp
~/.repository/com/scytl/maven-generic-conf/1.1.39/maven-generic-conf-1.1.39.pom
maven-generic-conf/pom.xml
[~] $ cp -r cryptography-2.0.0/ maven-generic-conf/
[~] $ cd maven-generic-conf/cryptography-2.0.0/
[~/maven-generic-conf/cryptography-2.0.0] $ mvn validate -X -U
-Dmaven.repo.local=/home/malte/.repository
...snip...
[INFO]

Viewing all articles
Browse latest Browse all 5648

Trending Articles