>>>>> "Rob Withers" <reefed...@gmail.com>:

>> What's the directory layout of your projects?  Where do you issue the
>> command?  What are the error messages you're getting.
 
> workspace/
>     murmur/
>         pom.xml
>     murmur-events/
>         pom.xml

> I issue the command in the murmur-events dir and I have no parent
> pom.xml and the error is:

> [ERROR] Failed to execute goal 
> org.apache.maven.plugins:maven-pmd-plugin:2.7.1:check (default) on project 
> murmur-events: You have 17 PMD violations. For more de
> tails see:C:\rob\comp\workspace\murmur-events\target\pmd.xml -> [Help 1]

Right... one fix would be to fix those 17 PMD violations...;-)

Alternatively you can remove maven-pmd-plugin from the <plugins> section
of the murmur-events/pom.xml.  Or you can use that same entry to
configure the maven-pmd-plugin to be less strict (not sure if that's
possible...?).

>> >   3.. Do I need to have a parent pom with two modules, one for each
>> >   project?
>> 
>> That would be "the maven way", yes, structured so:
>> 
>> murmur-top/
>>   pom.xml
>>   murmur-events/
>>     pom.xml
>>   murmur/
>>     pom.xml

> Ok, I tried this and got an error in both the parent dir, when issuing
> the mvn command:

> C:\rob\comp\workspace>mvn
> [INFO] Scanning for projects...
> [ERROR] The build could not read 3 projects -> [Help 1]
> [ERROR]
> [ERROR]   The project org.murmur:murmur-events:1.0.1-SNAPSHOT 
> (C:\rob\comp\workspace\murmur-events\pom.xml) has 1 error
> [ERROR]     Non-resolvable parent POM: Could not find artifact 
> org.murmur:murmur-top:pom:1.0-SNAPSHOT and 'parent.relativePath' points at 
> wrong local POM @ line
>  5, column 11 -> [Help 2]

Hm... did I do something wrong in my example?  I don't think so...?
To try it out, I did "rm -rf ~/.m2/repository/org/murmur" and then "mvn
install" in the top dir again.  That worked fine.  The output is
attached.

I have also zipped together my banal test project so you can try it out
yourself.  I will email it to you.  Note: unix line endings.

> [ERROR]
> [ERROR]   The project org.murmur:murmur:0.0.1-SNAPSHOT 
> (C:\rob\comp\workspace\murmur\pom.xml) has 1 error
> [ERROR]     Non-resolvable parent POM: Could not find artifact 
> org.murmur:murmur-top:pom:1.0-SNAPSHOT and 'parent.relativePath' points at 
> wrong local POM @ line
>  4, column 11 -> [Help 2]

Same error... strange... could it be my fake groupId that makes the
problem.  What happens if you use the same groupId that your actual
pom.xml files use?

> and an error in the subdir, when issuing the mvn command:

> C:\rob\comp\workspace\murmur-events>mvn
> [INFO] Scanning for projects...
> [ERROR] The build could not read 1 project -> [Help 1]
> [ERROR]
> [ERROR]   The project org.murmur:murmur-events:1.0.1-SNAPSHOT 
> (C:\rob\comp\workspace\murmur-events\pom.xml) has 1 error
> [ERROR]     Non-resolvable parent POM: Could not find artifact 
> org.murmur:murmur-top:pom:1.0-SNAPSHOT and 'parent.relativePath' points at 
> wrong local POM @ line
>  5, column 11 -> [Help 2]

> These are really the same error.

Yep.  And with the parent POM residing in the directory above the
projects, this is strange.

>> >   5.. If the jar is named ‘murmur-events-1.0.1-SNAPSHOT.jar’, will the
>> > above dependency of the following find it?
>> 
>> Um... not sure I understood that...?

> This dependency section in the murmur pom:

> <dependency>
>   <groupId>org.reefedjib</groupId>
>   <artifactId>murmur-events</artifactId>
>   <version>1.0.1-SNAPSHOT</version>
> </dependency>

If that is the groupId+artifactId+version your actual murmur-events
pom.xml has, and if murmur-events have been built and installed in your
local repository, then yes, that shoud be enough.
 
>> >   6.. What about setting up an internal repository?  Would that be a
>> > better solution?
>> 
>> What do you mean by an internal repository?  A repository for internal to
>> your project?  Or a repository local to your site?

> Instead of a local repository, have a public repository at
> http://callistosheart.org/maven or something.

If that is an option for you, then I'm sure it will be a good thing.
I have only ever been allowed to set up an intranet repository...:-)

You can add that repository in your top pom.

>> >   7.. If I have the dependency in maven, will eclipse pick it up?
>> 
>> Not eclipse by itself.  But you can either use the eclipse m2e plugin that 
>> will
>> make maven projects appear as eclipse projects, or you can use the maven-
>> eclipse-plugin to let maven generate the eclipse project settings.  You can
>> also use maven as an external build tool in eclipse.

> Does Eclipse Juno include these plugins? 

m2e?  By default?  No idea.

> It does have some level of support, but I am finding I need to go to
> the command line to generate new projects.

That isn't m2e or eclipse.  That's the maven-eclipse-plugin.  If you do
"mvn eclipse:eclipse" on the workspace level this maven plugin will
generate the eclipse project files/directories in murmur-events and
murmur.

The dependency from murmur to murmur-events will be a project
dependency. 

Note that you also need to "mvn eclipse:configure-workspace" on the
workspace level before starting eclipse.  This will set the M2_REPO
eclipse variable, pointing to your local repository.

> Thinking about this, I think I will establish a sample project with
> everything and just copy it over to new projects I want to create and
> update the artifactId in the pom.  This way I can have all my default
> dependencies setup.

Hm... OK.  Maybe my test project can help you a little bit.  You can
just start out with the project and verify that it builds, then add
stuff and test builds and if it breaks figure out what makes it
break....

Attached is the output from me doing "mvn install" on the test project.

[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO] 
[INFO] murmur-top
[INFO] murmur-events
[INFO] murmur
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building murmur-top 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-install-plugin:2.3.1:install (default-install) @ murmur-top ---
[INFO] Installing /tmp/murmur-top/pom.xml to 
/home/sb/.m2/repository/org/murmur/murmur-top/1.0-SNAPSHOT/murmur-top-1.0-SNAPSHOT.pom
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building murmur-events 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-resources-plugin:2.5:resources (default-resources) @ 
murmur-events ---
[debug] execute contextualize
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, 
i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory 
/tmp/murmur-top/murmur-events/src/main/resources
[INFO] 
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ 
murmur-events ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-resources-plugin:2.5:testResources (default-testResources) @ 
murmur-events ---
[debug] execute contextualize
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, 
i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory 
/tmp/murmur-top/murmur-events/src/test/resources
[INFO] 
[INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ 
murmur-events ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-surefire-plugin:2.10:test (default-test) @ murmur-events ---
[INFO] Surefire report directory: 
/tmp/murmur-top/murmur-events/target/surefire-reports

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running org.murmur.AppTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.058 sec

Results :

Tests run: 1, Failures: 0, Errors: 0, Skipped: 0

[INFO] 
[INFO] --- maven-jar-plugin:2.3.2:jar (default-jar) @ murmur-events ---
[INFO] 
[INFO] --- maven-install-plugin:2.3.1:install (default-install) @ murmur-events 
---
[INFO] Installing 
/tmp/murmur-top/murmur-events/target/murmur-events-1.0-SNAPSHOT.jar to 
/home/sb/.m2/repository/org/murmur/murmur-events/1.0-SNAPSHOT/murmur-events-1.0-SNAPSHOT.jar
[INFO] Installing /tmp/murmur-top/murmur-events/pom.xml to 
/home/sb/.m2/repository/org/murmur/murmur-events/1.0-SNAPSHOT/murmur-events-1.0-SNAPSHOT.pom
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building murmur 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-resources-plugin:2.5:resources (default-resources) @ murmur ---
[debug] execute contextualize
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, 
i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory 
/tmp/murmur-top/murmur/src/main/resources
[INFO] 
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ murmur ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-resources-plugin:2.5:testResources (default-testResources) @ 
murmur ---
[debug] execute contextualize
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, 
i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory 
/tmp/murmur-top/murmur/src/test/resources
[INFO] 
[INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ 
murmur ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-surefire-plugin:2.10:test (default-test) @ murmur ---
[INFO] Surefire report directory: /tmp/murmur-top/murmur/target/surefire-reports

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running org.murmur.AppTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.045 sec

Results :

Tests run: 1, Failures: 0, Errors: 0, Skipped: 0

[INFO] 
[INFO] --- maven-jar-plugin:2.3.2:jar (default-jar) @ murmur ---
[INFO] 
[INFO] --- maven-install-plugin:2.3.1:install (default-install) @ murmur ---
[INFO] Installing /tmp/murmur-top/murmur/target/murmur-1.0-SNAPSHOT.jar to 
/home/sb/.m2/repository/org/murmur/murmur/1.0-SNAPSHOT/murmur-1.0-SNAPSHOT.jar
[INFO] Installing /tmp/murmur-top/murmur/pom.xml to 
/home/sb/.m2/repository/org/murmur/murmur/1.0-SNAPSHOT/murmur-1.0-SNAPSHOT.pom
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] 
[INFO] murmur-top ........................................ SUCCESS [1.194s]
[INFO] murmur-events ..................................... SUCCESS [3.612s]
[INFO] murmur ............................................ SUCCESS [0.734s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6.352s
[INFO] Finished at: Sat Oct 06 19:08:02 CEST 2012
[INFO] Final Memory: 6M/15M
[INFO] ------------------------------------------------------------------------

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org

Reply via email to