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

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

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

Malte Skoruppa
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]
------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 3.173s
[INFO] Finished at: Fri Nov 29 13:46:21 CET 2013
[INFO] Final Memory: 9M/211M
[INFO]
------------------------------------------------------------------------

While this is a workaround, it is not a solution. The project is quite
large and complex, and I cannot just rebuild the entire project
structure. (There are more very similar problems.) Also, different
version of maven-generic-conf are used by different modules, etc.

Yes, I did visit both URLs at [Help 1] and [Help 2], and read them
carefully. It is true that a <relativePath> is not set in the child
module (i.e., cryptography-2.0.0), but in an entirely different project
of mine the <relativePath> is not set either and its parent POM is also
only in the local repo, yet that one validates fine. Also as can be seen
from the [DEBUG] line stated above, Maven does know the correct location
of the parent POM, apparently it just doesn't read it.
I googled for similar problems. But I could not find a solution.

I also tried to use the -o switch to make the build offline and force
Maven to not download anything. But the error I get then is quite similar:
[FATAL] Non-resolvable parent POM: The repository system is offline but
the artifact com.scytl:maven-generic-conf:pom:1.1.39 is not available in
the local repository. and 'parent.relativePath' points at wrong local
POM @ line 3, column 13

Does anyone have an idea of what may be going on here? Any help would be
GREATLY appreciated. I'm out of ideas here. It may be something very
simple, and I just miss experience with Maven :)

Many thanks,

Malte


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

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

Ron Wheeler
Rather than putting the parent in the repo, try using maven to install it.

Ron


On 29/11/2013 8:17 AM, Malte Skoruppa wrote:

> 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]
> ------------------------------------------------------------------------
> [INFO] BUILD SUCCESS
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Total time: 3.173s
> [INFO] Finished at: Fri Nov 29 13:46:21 CET 2013
> [INFO] Final Memory: 9M/211M
> [INFO]
> ------------------------------------------------------------------------
>
> While this is a workaround, it is not a solution. The project is quite
> large and complex, and I cannot just rebuild the entire project
> structure. (There are more very similar problems.) Also, different
> version of maven-generic-conf are used by different modules, etc.
>
> Yes, I did visit both URLs at [Help 1] and [Help 2], and read them
> carefully. It is true that a <relativePath> is not set in the child
> module (i.e., cryptography-2.0.0), but in an entirely different
> project of mine the <relativePath> is not set either and its parent
> POM is also only in the local repo, yet that one validates fine. Also
> as can be seen from the [DEBUG] line stated above, Maven does know the
> correct location of the parent POM, apparently it just doesn't read it.
> I googled for similar problems. But I could not find a solution.
>
> I also tried to use the -o switch to make the build offline and force
> Maven to not download anything. But the error I get then is quite
> similar:
> [FATAL] Non-resolvable parent POM: The repository system is offline
> but the artifact com.scytl:maven-generic-conf:pom:1.1.39 is not
> available in the local repository. and 'parent.relativePath' points at
> wrong local POM @ line 3, column 13
>
> Does anyone have an idea of what may be going on here? Any help would
> be GREATLY appreciated. I'm out of ideas here. It may be something
> very simple, and I just miss experience with Maven :)
>
> Many thanks,
>
> Malte
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>


--
Ron Wheeler
President
Artifact Software Inc
email: [hidden email]
skype: ronaldmwheeler
phone: 866-970-2435, ext 102


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

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

stephenconnolly
In reply to this post by Malte Skoruppa
Maven 3.0+ enforces that downloaded artifacts were resolved from a
repository url/id that matches an url available for the current session.

Your log shows that the only repository url/id available to your
session is  [central
(http://repo.maven.apache.org/maven2, releases)]

i.e. you are using the default Maven settings and the pom your are building
does not declare any <repositories>

As the file is not available on central, Maven will (correctly in my
opinion) fail the build as the build would be non-reproducible.

This is one of those cases where the project you are building did not pay
heed to the blog post I wrote on how to handle non-maven jars:
http://developer-blog.cloudbees.com/2013/03/playing-trade-offs-with-maven.html

They thought they had a hack that would work... they are sadly wrong.

IIRC there is a CLI option that you can enabled in Maven 3.1.1 that tells
Maven "I know what I am doing and don't make that check this time" i.e.
--legacy-local-repository

If you have any influence on the project you are trying to build I would
recommend asking them to pay heed to my blog post as their hack is not good
for users.

HTH


On 29 November 2013 13:17, Malte Skoruppa <[hidden email]>wrote:

> 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] ------------------------------------------------------------
> ------------
> [INFO] BUILD SUCCESS
> [INFO] ------------------------------------------------------------
> ------------
> [INFO] Total time: 3.173s
> [INFO] Finished at: Fri Nov 29 13:46:21 CET 2013
> [INFO] Final Memory: 9M/211M
> [INFO] ------------------------------------------------------------
> ------------
>
> While this is a workaround, it is not a solution. The project is quite
> large and complex, and I cannot just rebuild the entire project structure.
> (There are more very similar problems.) Also, different version of
> maven-generic-conf are used by different modules, etc.
>
> Yes, I did visit both URLs at [Help 1] and [Help 2], and read them
> carefully. It is true that a <relativePath> is not set in the child module
> (i.e., cryptography-2.0.0), but in an entirely different project of mine
> the <relativePath> is not set either and its parent POM is also only in the
> local repo, yet that one validates fine. Also as can be seen from the
> [DEBUG] line stated above, Maven does know the correct location of the
> parent POM, apparently it just doesn't read it.
> I googled for similar problems. But I could not find a solution.
>
> I also tried to use the -o switch to make the build offline and force
> Maven to not download anything. But the error I get then is quite similar:
> [FATAL] Non-resolvable parent POM: The repository system is offline but
> the artifact com.scytl:maven-generic-conf:pom:1.1.39 is not available in
> the local repository. and 'parent.relativePath' points at wrong local POM @
> line 3, column 13
>
> Does anyone have an idea of what may be going on here? Any help would be
> GREATLY appreciated. I'm out of ideas here. It may be something very
> simple, and I just miss experience with Maven :)
>
> Many thanks,
>
> Malte
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

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

Malte Skoruppa
In reply to this post by Ron Wheeler
Hi,

> Rather than putting the parent in the repo, try using maven to install
> it.
>

Awesome! That worked just fine! Now it's building... thanks!
(Please note that I had not put the parent in the repo myself, I just
downloaded a repo which already included that parent... and I did not
have the original module to install via Maven, though I now managed to
"simulate" its installation; see below)

Explanation: I think the problem was that this parent POM, which was
only in the local repo
(/home/malte/.repository/com/scytl/maven-generic-conf/1.1.39/maven-generic-conf-1.1.39.pom)
itself specified some repository mirrors from the company that created
the project I was trying to build. The company probably does that
because "it gives them control over the code that is being used, and
isolates them from failure or disappearance of the upstream repository",
as Stephen nicely formulated it in his blog post.

I had removed the sections specifying those mirrors from the parent POM
in the local repo (I didn't mention that in my first mail because I
thought it was not relevant), as I cannot access these mirrors. And the
errors I described in my first mail occurred with or without those
mirror specifications in the parent POM anyway.

However, following your suggestion I simulated "installation" of the POM by:
1. creating an empty directory /home/malte/maven-generic-conf
2. copying
/home/malte/.repository/com/scytl/maven-generic-conf/1.1.39/maven-generic-conf-1.1.39.pom
to /home/malte/maven-generic-conf/pom.xml
3. typing 'mvn -X -U -Dmaven.repo.local=/home/malte/.repository install'
inside the directory /home/malte/maven-generic-conf

Afterwards, the child module finally compiled successfully!
I was curious about what that "installation simulation" exactly changed
in my local repository, as the parent POM in principle was already
installed there anyway. The thing that made the whole difference was
that the file
/home/malte/.repository/com/scytl/maven-generic-conf/1.1.39/_maven.repositories,
which contained

#NOTE: This is an internal implementation file, its format can be
changed without prior notice.
#Wed Sep 04 19:15:02 CEST 2013
maven-generic-conf-1.1.39.pom>mirror=

...had now been overwritten with the following contents:

#NOTE: This is an internal implementation file, its format can be
changed without prior notice.
#Fri Nov 29 17:52:50 CET 2013
maven-generic-conf-1.1.39.pom>=
maven-generic-conf-1.1.39.pom>mirror=

...and that was it! It was probably because of this file that Maven
insisted on trying to download the file. I found out I do not even have
to simulate "installation" of the parent POM. By just removing the
keyword 'mirror' from
/home/malte/.repository/com/scytl/maven-generic-conf/1.1.39/_maven.repositories
(as well as removing the mirror specifications from
/home/malte/.repository/com/scytl/maven-generic-conf/1.1.39/maven-generic-conf-1.1.39.pom),
everything works fine.

Can someone explain what this _maven.repositories file exactly does? I
know how to get it to work now, but I don't fully understand what
happened here. :)


> Maven 3.0+ enforces that downloaded artifacts were resolved from a
> repository url/id that matches an url available for the current session.

How does it know where downloaded artifacts were resolved from?

> This is one of those cases where the project you are building did not pay
> heed to the blog post I wrote on how to handle non-maven jars:
> http://developer-blog.cloudbees.com/2013/03/playing-trade-offs-with-maven.html
>
> They thought they had a hack that would work... they are sadly wrong.

That blog post was very interesting and instructive.

However, seeing the above, do you think that this was indeed the problem?
Note that this parent POM installed in the local repo did not include
any non-maven-jars JARs or anything.
It was simply a kind of generic company-internal über-pom that specified
some configuration, like, for some plugins which versions to use, an
<issueManagement>, a <ciManagement>, etc., as well as, of course, those
company-internal <repositories> / <pluginRepositories> /
<distributionManagement> which I had removed.

> IIRC there is a CLI option that you can enabled in Maven 3.1.1 that tells
> Maven "I know what I am doing and don't make that check this time" i.e.
> --legacy-local-repository
As I'm on Maven 3.0.4 and Ron's solution did it, I didn't get to try
this one (I would have had to update Maven). Would be interesting to see
if that works, though :)


Best,

Malte


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

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

Ron Wheeler
http://blog.artifact-software.com/tech/?p=177
more free advice that really helps.

Ron


On 29/11/2013 12:29 PM, Malte Skoruppa wrote:

> Hi,
>
>> Rather than putting the parent in the repo, try using maven to
>> install it.
>>
>
> Awesome! That worked just fine! Now it's building... thanks!
> (Please note that I had not put the parent in the repo myself, I just
> downloaded a repo which already included that parent... and I did not
> have the original module to install via Maven, though I now managed to
> "simulate" its installation; see below)
>
> Explanation: I think the problem was that this parent POM, which was
> only in the local repo
> (/home/malte/.repository/com/scytl/maven-generic-conf/1.1.39/maven-generic-conf-1.1.39.pom)
> itself specified some repository mirrors from the company that created
> the project I was trying to build. The company probably does that
> because "it gives them control over the code that is being used, and
> isolates them from failure or disappearance of the upstream
> repository", as Stephen nicely formulated it in his blog post.
>
> I had removed the sections specifying those mirrors from the parent
> POM in the local repo (I didn't mention that in my first mail because
> I thought it was not relevant), as I cannot access these mirrors. And
> the errors I described in my first mail occurred with or without those
> mirror specifications in the parent POM anyway.
>
> However, following your suggestion I simulated "installation" of the
> POM by:
> 1. creating an empty directory /home/malte/maven-generic-conf
> 2. copying
> /home/malte/.repository/com/scytl/maven-generic-conf/1.1.39/maven-generic-conf-1.1.39.pom
> to /home/malte/maven-generic-conf/pom.xml
> 3. typing 'mvn -X -U -Dmaven.repo.local=/home/malte/.repository
> install' inside the directory /home/malte/maven-generic-conf
>
> Afterwards, the child module finally compiled successfully!
> I was curious about what that "installation simulation" exactly
> changed in my local repository, as the parent POM in principle was
> already installed there anyway. The thing that made the whole
> difference was that the file
> /home/malte/.repository/com/scytl/maven-generic-conf/1.1.39/_maven.repositories,
> which contained
>
> #NOTE: This is an internal implementation file, its format can be
> changed without prior notice.
> #Wed Sep 04 19:15:02 CEST 2013
> maven-generic-conf-1.1.39.pom>mirror=
>
> ...had now been overwritten with the following contents:
>
> #NOTE: This is an internal implementation file, its format can be
> changed without prior notice.
> #Fri Nov 29 17:52:50 CET 2013
> maven-generic-conf-1.1.39.pom>=
> maven-generic-conf-1.1.39.pom>mirror=
>
> ...and that was it! It was probably because of this file that Maven
> insisted on trying to download the file. I found out I do not even
> have to simulate "installation" of the parent POM. By just removing
> the keyword 'mirror' from
> /home/malte/.repository/com/scytl/maven-generic-conf/1.1.39/_maven.repositories
> (as well as removing the mirror specifications from
> /home/malte/.repository/com/scytl/maven-generic-conf/1.1.39/maven-generic-conf-1.1.39.pom),
> everything works fine.
>
> Can someone explain what this _maven.repositories file exactly does? I
> know how to get it to work now, but I don't fully understand what
> happened here. :)
>
>
>> Maven 3.0+ enforces that downloaded artifacts were resolved from a
>> repository url/id that matches an url available for the current session.
>
> How does it know where downloaded artifacts were resolved from?
>
>> This is one of those cases where the project you are building did not
>> pay
>> heed to the blog post I wrote on how to handle non-maven jars:
>> http://developer-blog.cloudbees.com/2013/03/playing-trade-offs-with-maven.html 
>>
>>
>> They thought they had a hack that would work... they are sadly wrong.
>
> That blog post was very interesting and instructive.
>
> However, seeing the above, do you think that this was indeed the problem?
> Note that this parent POM installed in the local repo did not include
> any non-maven-jars JARs or anything.
> It was simply a kind of generic company-internal über-pom that
> specified some configuration, like, for some plugins which versions to
> use, an <issueManagement>, a <ciManagement>, etc., as well as, of
> course, those company-internal <repositories> / <pluginRepositories> /
> <distributionManagement> which I had removed.
>
>> IIRC there is a CLI option that you can enabled in Maven 3.1.1 that
>> tells
>> Maven "I know what I am doing and don't make that check this time" i.e.
>> --legacy-local-repository
> As I'm on Maven 3.0.4 and Ron's solution did it, I didn't get to try
> this one (I would have had to update Maven). Would be interesting to
> see if that works, though :)
>
>
> Best,
>
> Malte
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>


--
Ron Wheeler
President
Artifact Software Inc
email: [hidden email]
skype: ronaldmwheeler
phone: 866-970-2435, ext 102


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Loading...