Re: maven-eclipse-plugin JRE classpath generation problem

2008-09-20 Thread Stefan Hübner
2008/9/19 Tomek Maciejewski [EMAIL PROTECTED]:
...
  classpathContainers
  classpathContainerorg.elipse.mtj.JavaMEContainer/Sun
 Java(TM) Wireless Toolkit 2.5.2 for
 CLDC/DefaultColorPhone/classpathContainer
  /classpathContainers
  /configuration
  /plugin

 With this configuration I get .classpath file like this:

 classpath
 classpathentry kind=src path=src/main/java/
 classpathentry kind=src path=src/main/resources excluding=**/*.java/
 classpathentry kind=output path=target/classes/
 classpathentry kind=con path=org.eclipse.jdt.launching.JRE_CONTAINER/
 classpathentry kind=con path=org.elipse.mtj.JavaMEContainer/Sun Java(TM)
 Wireless Toolkit 2.5.2 for CLDC/DefaultColorPhone/
 /classpath

 The problem is I would like to get rid of JRE in classpath because I use
 JavaME. So my question is how to set maven-eclipse-plugin to not generate
 this line:   classpathentry kind=con
 path=org.eclipse.jdt.launching.JRE_CONTAINER/

Have you tried to eclipse:clean-up before eclipse:eclipse? Maven's
Eclipse plugin suggests to run eclipse:clean if you realy want to
replace earlier eclipse-settings.

-Stefan

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Having trouble with setting a property in settings.xml and activating a profile in a pom based on that property

2008-09-20 Thread Stefan Hübner
David,

this gave me hard time too. After a while I realized, that profiles
can only be activated by *system* properties which is a different
beast than those properties one can define in a POM or the settings.
System properties are those which are provided to maven by the command
line parameter -D.

http://maven.apache.org/guides/introduction/introduction-to-profiles.html
explicitely uses the term system property when it comes to profile
activation by property values.

-Stefan

2008/9/19 David [EMAIL PROTECTED]:
 Hello All,

 I'm trying to set a property in the settings.xml file and then have a
 profile in the pom.xml file activate if that property is set.  Right now I
 don't care about the value, I just need it to be set.  Currently I have the
 following in my settings.xml file.

 profile
  idA/id
activation
  activeByDefaulttrue/activeByDefault
/activation
properties
  davidC:\temp/david
/properties
 /profile

 In my pom.xml I have the following.

 profiles
profile
idB/id
activation
property
namedavid/name
/property
/activation
 ...
 profiles

 I can see from running mvn help:active-profiles that profile A in the
 settings.xml file is active but profile B is not.  I can also use the David
 property in other areas of the pom file.  I'm I doing something wrong?  I'm
 using Maven-2.0.6 on Windows.

 Thanks,

 David


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Maven/Eclipse - Keeping them in sync?

2008-09-20 Thread Klaus
So you want to add another folder as container for source files?
(additionally to /src/main/java and /target/generated-sources). Good
question..

From what google points me to i would recommend you to have a look at
http://mojo.codehaus.org/build-helper-maven-plugin/index.html . I do not
know, if any of the eclipse plugins does take this into account (possibly
not). But this should not be a big issue as you could do so manually..

Or you use Intellij (did i say that loud??) It seem as they have solved the
problem already.. http://intellij.net/forums/thread.jspa?threadID=273917

klaus

On Sat, Sep 20, 2008 at 7:25 AM, David C. Hicks [EMAIL PROTECTED] wrote:

 No, that doesn't work. It just resets the source folders to what the Maven
 pom.xml thinks it should be. I had tried that before, but I just
 double-checked before I replied to make certain I wasn't misremembering.

 Thanks for the suggestion, though.



 stug23 wrote:

 To bring project up to date when adding source directories, try selecting
 the
 following menu item from the contextual menu (right-click on your project
 in
 the Package Explorer):

 Maven = Update Project Configuration

 This will synch up the source folders with the Eclipse classpath.



 David C. Hicks wrote:


 OK, I installed m2eclipse and it seems happy with my project. I was able
 to go through the POM editor and update a lot of information that previously
 wasn't there. Very cool.

 Problem: I still don't see it picking up new source folders. If I add a
 source folder in Eclipse, how does that end up in the pom.xml to somehow be
 included in a production and/or test build? I see a spot to enter source
 folders in the POM editor, but it is unclear how to actually enter them.

 Am I missing something?

 Thanks again!
 Dave

 PS - for those who recommended Q4E, I'm looking at it, too, but from what
 I can tell it seems that m2eclipse is way ahead in terms of fit and finish.
 That's just a first impression, though.


 Stevo Slavic' wrote:


 Hello David,

 Just as Klaus said, use m2eclipse plugin. After installing it, I'd first
 manually create a folder in eclipse workspace, named as your root maven
 project artifactId, then copy root POM and rest of the project structure
 you've created into that new folder. Finally, with m2eclipse plugin you
 could just File--Import...--General--Maven Projects and
 select/browse
 to newly created folder, leaving m2eclipse do the rest.

 Regards,
 Stevo.

 On Fri, Sep 19, 2008 at 11:24 PM, Klaus [EMAIL PROTECTED] wrote:



 Have a look at http://m2eclipse.codehaus.org . It's a eclipse plugin
 that
 updates the project settings according to the setting in the pom.xml.
 No
 (re)generate of eclipse-project files, no problem with new source
 folders..

 klaus

 On Fri, Sep 19, 2008 at 11:17 PM, David C. Hicks [EMAIL PROTECTED]
 wrote:



 I'm beginning a new, fairly large, project.  Eclipse will be our
 development platform, but I've already set up the starting point in


 Maven.


  Simple enough.  Now, my question is, how can I keep them in sync,


 easily?


  I realize that it's best to re-run mvn eclipse:eclipse after adding
 dependencies, but what about source folders?  I need to add new source
 folders, but Maven doesn't know anything about that, so the next time
 I
 re-generate the .project/.classpath files, it'll revert back to those
 folders not being source folders.

 Any help how to make this behave?
 Thanks,
 Dave


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]






 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]









 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




Re: Maven/Eclipse - Keeping them in sync?

2008-09-20 Thread Stefan Hübner
David,

2008/9/19 David C. Hicks [EMAIL PROTECTED]:
 I'm beginning a new, fairly large, project.  Eclipse will be our development
 platform, but I've already set up the starting point in Maven.  Simple
 enough.  Now, my question is, how can I keep them in sync, easily?  I
 realize that it's best to re-run mvn eclipse:eclipse after adding
 dependencies, but what about source folders?  I need to add new source
 folders, but Maven doesn't know anything about that, so the next time I
 re-generate the .project/.classpath files, it'll revert back to those
 folders not being source folders.

 Any help how to make this behave?

You need to add additional source folders by using the
build-helper-maven-plugin
(http://mojo.codehaus.org/build-helper-maven-plugin/). Then the
maven-eclipse-plugin happily add all your source folders to eclipse's
project configuration.

Also another hint on handling larger project setup with many
submodules and maybe independent project side by side. In my last
project to keep all my projects and submodules (40+) synced with
eclipse I put all projects and multiprojects in the same subversion
trunk and thus the same working folder in parallel subfolders. in the
working folder's root I established a bootstapper-pom which included
all projects as submodules. the project's parent pom resided in a
parallel subfolder next to the projects as well. Also this parent-pom
was included as a submodule by the bootstrapper-pom. With this setup
we were able to invoke any maven commands on all projects at once.

-Stefan

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



frustration with testNG tests running twice.

2008-09-20 Thread Mick Knutson
I have this declaration:
plugin
groupIdorg.apache.maven.plugins/groupId
artifactIdmaven-surefire-plugin/artifactId
executions
execution
idunit-tests/id
phasetest/phase
goals
goaltest/goal
/goals
configuration
skipfalse/skip
testFailureIgnorefalse/testFailureIgnore
excludes
exclude**/*.java/exclude
/excludes
/configuration
/execution

execution
idintegration-tests/id
phaseintegration-test/phase
goals
goaltest/goal
/goals
configuration
skipfalse/skip
testFailureIgnoretrue/testFailureIgnore

suiteXmlFiles

suiteXmlFilesrc/test/resources/testng-functional.xml/suiteXmlFile
/suiteXmlFiles


groupssuite-init,database,functional,selenium/groups
excludeGroupsunit/excludeGroups
/configuration
/execution
/executions
/plugin


Now I even commented out the phasetest/phase to stop unit test from
running, but they run anyways. And because there is not a testng.xml for
that phase, the tests fail.

Can someone please help me get just my functional tests to run in the
phaseintegration-test/phase ???

Your help is greatly appreciated!

-- 
---
Thank You…

Mick Knutson
BASE Logic, inc.
(415) 354-4215

Website: http://baselogic.com
Blog: http://baselogic.com/blog
BLiNC Magazine: http://blincmagazine.com
Linked IN: http://linkedin.com/in/mickknutson
DJ Mick: http://djmick.com
MySpace: http://myspace.com/mickknutson
Vacation Rental: http://tahoe.baselogic.com


Re: m2eclipse and inter-module dependencies...

2008-09-20 Thread Baptiste MATHUS
Hi James,

First you should know there's a specific mailing list for M2E. You should be
able to find more accurate answer on this list.
Second, could you please give us more details about what it's doing
incorrectly. Actually it would help that you both explain what it does now
and what you think it should do.

Cheers.

2008/9/19 James Carman [EMAIL PROTECTED]


 We've got a multi-module maven-based project and we're trying to import it
 using m2eclipse.  Everything seems to be working fine, but it's not setting
 up the classpath correctly for projects that depend on other projects, it
 seems.  Is this a known issue?
 --
 View this message in context:
 http://n2.nabble.com/m2eclipse-and-inter-module-dependencies...-tp1101616p1101616.html
 Sent from the maven users mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




-- 
Baptiste Batmat MATHUS - http://batmat.net
Sauvez un arbre,
Mangez un castor !


RE: a slue of warnings

2008-09-20 Thread Brian E. Fox
No, this requires upgrading maven to use a new container with a different api, 
which is why we never put it into 2.0. 3.0 would be the first release to 
reasonable expect it to be fixed. I worked around it by rebuilding that jar 
without the warning and distributed it across my team, but then one day it 
really went away by itself. I wish I could give you better info on how to make 
it stop, I never did get to the bottom of why it happened sometimes and not 
others before it was gone for good.

-Original Message-
From: Wayne Fay [mailto:[EMAIL PROTECTED] 
Sent: Friday, September 19, 2008 1:29 PM
To: Maven Users List
Subject: Re: a slue of warnings

According to what JvZ and Brian said in the bug, it doesn't seem to be
a trivial dependency change, or I'd expect it might have already been
done.

Andy looked into this and we can't fix it easily without upgrading
the container and that's just too much work... we can try to upgrade
the container which will bring people in line with 2.1 but will
require much testing.

So, I doubt that simply changing the Plexus version in a pom somewhere
will do it. You should try the latest 2.1.0-M1 and see if the bug is
still there.

Wayne

On Fri, Sep 19, 2008 at 3:31 AM, EJ Ciramella [EMAIL PROTECTED] wrote:
 Is there a way I can update my maven pom that has a dependency on this
 somewhere such that I'm getting the latest version of plexus?

 We are trying to migrate to these new machines and having almost 38K
 lines of nonsense makes it impossible to build in CC.

 mvn -q makes things so quiet, it's useless.



 -Original Message-
 From: Wayne Fay [mailto:[EMAIL PROTECTED]
 Sent: Friday, September 19, 2008 1:18 AM
 To: Maven Users List
 Subject: Re: a slue of warnings

 As the Jira MNG says:
 This issue has already been fixed in PLX-287. This MNG issue is to try
 and get that fix into 2.0.x

 So, the bug still exists in Maven, though it has been fixed in Plexus...
 The fix has simply never made its way into a Maven release, as yet.

 Wayne

 On Thu, Sep 18, 2008 at 2:56 PM, EJ Ciramella [EMAIL PROTECTED]
 wrote:
 So I'm very confused -

 This bug says it's NOT fixed

 http://jira.codehaus.org/browse/MNG-2879?page=com.atlassian.jira.plugi
 n

 Yet, this one says it is:

 http://jira.codehaus.org/browse/PLX-287

 Where can I see the version of plexus used?

 -Original Message-
 From: Brett Porter [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, September 16, 2008 12:12 PM
 To: Maven Users List
 Subject: Re: a slue of warnings

 2008/9/16 EJ Ciramella [EMAIL PROTECTED]

 Which component - SystemPropertyProfileActivator?

 How do I shut it off via the logger?  It's generating (as shown
 below)

 almost 39 thousand lines so it can't simply be ignored.


 Apologies, I was thinking of something else. This can only be changed
 programatically.



 -Original Message-
 From: Brett Porter [mailto:[EMAIL PROTECTED]
 Sent: Monday, September 15, 2008 7:50 PM
 To: Maven Users List
 Subject: Re: a slue of warnings

 I believe it can be safely ignored. You might like to try editing the

 Maven installation's logger configuration to not output warnings from

 this component.
 - Brett

 2008/9/16 Michael Delaney [EMAIL PROTECTED]

  All,
 
 
 
  We have been using Maven 2.0.9 for sometime but on a Windows
 environment
  (Windows 2000  Windows XP). We are beginning our testing to move
  from Windows to Solaris. When I try to do a 'mvn clean install' on
  one of
 our
  projects, we get a slue (count of 38772) warnings that are all
  [WARNING] Component returned which is not the same manager.
 Ignored.
 
 component=org.apache.maven.profiles.activation.SystemPropertyProfileA
 c
 ti
  [EMAIL PROTECTED]. We found a bug (pasted below) but I wanted to hit
  up
 the
  mailing list to see if anyone could shed some light on the
 situation.
 
 
 
  Help?
 
 
 
  [ Maven Bug ]
 
 


 http://jira.codehaus.org/browse/MNG-2879?page=com.atlassian.jira.plugin.
 
 system.issuetabpanels:comment-tabpanelfocusedCommentId=134786#action
 _
 13
 http://jira.codehaus.org/browse/MNG-2879?page=com.atlassian.jira.plu
 g
 in
 .system.issuetabpanels:comment-tabpanelfocusedCommentId=134786#actio
 n
 _1
 3
  4786
 
 


 --
 Brett Porter
 Blog: http://blogs.exist.com/bporter/

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




 --
 Brett Porter
 Blog: http://blogs.exist.com/bporter/

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




Re: AW: Release fails during SVN commit

2008-09-20 Thread doballve

I'm forced to go with 1.5.1 right now, so here is a workaround that worked
for me (on gentoo):

 * Checkout a working copy with svn client 1.5.1, otherwise svn copy fails
with file already exists
 * run mvn release:prepare, it will fail in the svn --non-interactive copy
...
 * run svn update
 * run svn copy manually, do not use --non-interactive, and you'll have to
provide a message
 * edit release.properties, advance the completed phase
- completedPhase=scm-commit-release
   + completedPhase=scm-tag
* run mvn release:prepare to continue the release
* proceed normally with release:perform and so on..

If anybody has the proper solution for this issue, I'd be glad to know it.

Thanks,
Diego
-- 
View this message in context: 
http://www.nabble.com/Release-fails-during-SVN-commit-tp19084270p19586036.html
Sent from the Maven - Users mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Maven/Eclipse - Keeping them in sync?

2008-09-20 Thread David C. Hicks

Thanks again.  I'll check out the build-helper plugin.

As for larger projects, that's exactly how I've done them in the past.  
It requires a little massaging of the pom.xml files, but I haven't found 
a cleaner way to handle it.  Maybe one day between Eclipse and Maven 
this won't be such a mind twister.


The primary reason I'm adding extra source folders is for test code.  I 
really don't want to mix functional tests with my unit tests.  It made 
sense, to me, to put them in a different tree, but it didn't seem like a 
good fit for a sub-module.


Thanks for all the suggestions!
Dave

Stefan Hübner wrote:

David,

2008/9/19 David C. Hicks [EMAIL PROTECTED]:
  

I'm beginning a new, fairly large, project.  Eclipse will be our development
platform, but I've already set up the starting point in Maven.  Simple
enough.  Now, my question is, how can I keep them in sync, easily?  I
realize that it's best to re-run mvn eclipse:eclipse after adding
dependencies, but what about source folders?  I need to add new source
folders, but Maven doesn't know anything about that, so the next time I
re-generate the .project/.classpath files, it'll revert back to those
folders not being source folders.

Any help how to make this behave?



You need to add additional source folders by using the
build-helper-maven-plugin
(http://mojo.codehaus.org/build-helper-maven-plugin/). Then the
maven-eclipse-plugin happily add all your source folders to eclipse's
project configuration.

Also another hint on handling larger project setup with many
submodules and maybe independent project side by side. In my last
project to keep all my projects and submodules (40+) synced with
eclipse I put all projects and multiprojects in the same subversion
trunk and thus the same working folder in parallel subfolders. in the
working folder's root I established a bootstapper-pom which included
all projects as submodules. the project's parent pom resided in a
parallel subfolder next to the projects as well. Also this parent-pom
was included as a submodule by the bootstrapper-pom. With this setup
we were able to invoke any maven commands on all projects at once.

-Stefan

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

  


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[maven-pmd-plugin] Customizing generated report

2008-09-20 Thread jieryn
Greetings,

I don't see any way for me to customize the generated PMD report to my
needs. Specifically, I think it would be quite helpful to me and my
project developers to have clickable rules which would launch to the
official PMD documentation for the rule which is being reported. I
believe that PMD itself can create reports this way, I'm a bit stunned
no one else has requested this before... (perhaps my searching of both
the archive and JIRA is deficient, however).

Perhaps I should just open a new JIRA for this? Thanks in advance,
-jieryn

-- 
There are 10 types of people in this world, those
that can read binary and those that can not.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Surefire, TestNG, and @ContextConfiguration

2008-09-20 Thread Stevo Slavić
Problem was in fact that test from one module was referencing a test
resource from other module of the same maven multi-module project. I'm not
sure whether it is a bug in TestNG or m2eclipse eclipse integration, but it
enabled test, which was failing in Maven, to run successfully from TestNG
eclipse plugin.

Regards,
Stevo.

On Fri, Sep 12, 2008 at 3:06 PM, Stevo Slavić [EMAIL PROTECTED] wrote:

 Hello all,

 This is my first post to maven-users mailing list, and from the start, I'm
 here to brag about my problems with maven.

 I'm having a problem with a TestNG test which runs successfully in
 Eclipse(3.4) TestNG plugin(5.8.02), but in Maven (2.0.9) Surefire (2.4.3)
 same test fails. It's a spring(2.5.5)-based integration test, it extends
 AbstractTestNGSpringContextTests, and through @ContextConfiguration
 annotation and its locations attribute it gets configured to load 3 context
 files, two of them referenced as classpath:/com/ while third one is
 from a dependent project/library (test is in one module [war] which depends
 on another module [jar] from same multimodule project [pom]) and is
 referenced using classpath*:/com/. .

 Among other things, test makes use of a bean (well) defined in that third
 (classpath*) context file. That referenced bean is injected to the test
 through use of autowiring (@Autowired). Problem is that that bean doesn't
 get found and test initialization fails. Log doesn't print that problematic
 context failed to load, just any of it's beans aren't accessible/registered.
 Btw, if I leave out * from classpath* spring reports that it couldn't load
 context file as it is missing.

 I've tried substituting autowiring with getting bean by name manually in
 setUp method through this.applicationContext.getBean but this also failed.

 Then I've thought that it has to do with loader used to load context's, so
 I explicitly specified loader attribute of @ContextConfiguration annotation
 to be GenericXmlContextLoader.class. This didn't work either. In all of
 these tweaks, test would continue to run well in eclipse testng plugin, but
 it fails in maven (both external and m2eclipse internal).

 Because I use reportng, I though it interfered with the test somehow but
 removing reportng didn't help as well as removing parallel mode for test
 execution.


 With this I ran out of options, with you guys being my last resort. Any
 comments and pointers are welcome!

 Thanks in advance!

 Regards,
 Stevo.



Re: Maven/Eclipse - Keeping them in sync?

2008-09-20 Thread Eugene Kuleshov


David C. Hicks wrote:
 
 Thanks again.  I'll check out the build-helper plugin.
 
 As for larger projects, that's exactly how I've done them in the past.  
 It requires a little massaging of the pom.xml files, but I haven't found 
 a cleaner way to handle it.  Maybe one day between Eclipse and Maven 
 this won't be such a mind twister.
 
 The primary reason I'm adding extra source folders is for test code.  I 
 really don't want to mix functional tests with my unit tests.  It made 
 sense, to me, to put them in a different tree, but it didn't seem like a 
 good fit for a sub-module.
 
 Thanks for all the suggestions!
 

  The m2eclipse uses pom.xml as a source of information for configuring
projects in Eclipse. The reason for that is to keep build in Eclipse and in
the command line in sync. The command line build won't run for your
additional test folders if they are not in the pom.xml. After all it might
be a good idea to keep integration tests in a separate module and that would
closely follow standard Maven conventions.

  On the other hand, if you have command line build that works, but there is
some issues in the IDE for the very same build, please submit a bug report
for m2eclipse and provide test project that would allow us to reproduce it.

  Thanks

  Eugene


-- 
View this message in context: 
http://www.nabble.com/Maven-Eclipse---Keeping-them-in-sync--tp19579618p19588102.html
Sent from the Maven - Users mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Separate Jar FIles

2008-09-20 Thread Wayne Fay
It may just be me, but I don't understand what exactly you are asking.
Perhaps you can describe things in more detail, and someone will reply
with a reasonable approach.

In the meantime, if you haven't already read either of the freely
available Maven2 PDF ebooks, you really should:
http://maven.apache.org/articles.html

Wayne

On Fri, Sep 19, 2008 at 3:47 PM, Michael McGrady
[EMAIL PROTECTED] wrote:
 I have a project in which separate applications are included for ease of
 development due to their dependencies.  I want Maven to create separate
 SNAPSHOTS for each.  How do I do that?  Or, better, where do I look?

 Mike


 Michael McGrady
 Senior Engineer
 Topia Technology, Inc.
 [EMAIL PROTECTED]
 1 (253) 720-3365






 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Surefire, TestNG, and @ContextConfiguration

2008-09-20 Thread Wayne Fay
Test resources are not typically available in the packaged jars
produced by a given module.

Given what you've said (now that you've solved it), you should
probably look at creating a module with packaging test-jar that
bundles up the test resources you need to use across multiple modules.
Then you can use those test-jar modules in the other module's tests.

http://maven.apache.org/guides/mini/guide-attached-tests.html

Wayne

2008/9/20 Stevo Slavić [EMAIL PROTECTED]:
 Problem was in fact that test from one module was referencing a test
 resource from other module of the same maven multi-module project. I'm not
 sure whether it is a bug in TestNG or m2eclipse eclipse integration, but it
 enabled test, which was failing in Maven, to run successfully from TestNG
 eclipse plugin.

 Regards,
 Stevo.

 On Fri, Sep 12, 2008 at 3:06 PM, Stevo Slavić [EMAIL PROTECTED] wrote:

 Hello all,

 This is my first post to maven-users mailing list, and from the start, I'm
 here to brag about my problems with maven.

 I'm having a problem with a TestNG test which runs successfully in
 Eclipse(3.4) TestNG plugin(5.8.02), but in Maven (2.0.9) Surefire (2.4.3)
 same test fails. It's a spring(2.5.5)-based integration test, it extends
 AbstractTestNGSpringContextTests, and through @ContextConfiguration
 annotation and its locations attribute it gets configured to load 3 context
 files, two of them referenced as classpath:/com/ while third one is
 from a dependent project/library (test is in one module [war] which depends
 on another module [jar] from same multimodule project [pom]) and is
 referenced using classpath*:/com/. .

 Among other things, test makes use of a bean (well) defined in that third
 (classpath*) context file. That referenced bean is injected to the test
 through use of autowiring (@Autowired). Problem is that that bean doesn't
 get found and test initialization fails. Log doesn't print that problematic
 context failed to load, just any of it's beans aren't accessible/registered.
 Btw, if I leave out * from classpath* spring reports that it couldn't load
 context file as it is missing.

 I've tried substituting autowiring with getting bean by name manually in
 setUp method through this.applicationContext.getBean but this also failed.

 Then I've thought that it has to do with loader used to load context's, so
 I explicitly specified loader attribute of @ContextConfiguration annotation
 to be GenericXmlContextLoader.class. This didn't work either. In all of
 these tweaks, test would continue to run well in eclipse testng plugin, but
 it fails in maven (both external and m2eclipse internal).

 Because I use reportng, I though it interfered with the test somehow but
 removing reportng didn't help as well as removing parallel mode for test
 execution.


 With this I ran out of options, with you guys being my last resort. Any
 comments and pointers are welcome!

 Thanks in advance!

 Regards,
 Stevo.




Re: Surefire, TestNG, and @ContextConfiguration

2008-09-20 Thread Stevo Slavić
Yes Wayne, thank you, I know, moving shared test resources into separate
module solved it for me. Problem that remains is why was test resource
available in TestNG plugin when it shouldn't have. For this problem I've
moved discussion to m2eclipse user mailing list, as I suspect it wrongly set
classpath (in eclipse for the module with the problematic test) to contain
test resources of referenced module/dependency.

Regard,
Stevo.

On Sat, Sep 20, 2008 at 9:31 PM, Wayne Fay [EMAIL PROTECTED] wrote:

 Test resources are not typically available in the packaged jars
 produced by a given module.

 Given what you've said (now that you've solved it), you should
 probably look at creating a module with packaging test-jar that
 bundles up the test resources you need to use across multiple modules.
 Then you can use those test-jar modules in the other module's tests.

 http://maven.apache.org/guides/mini/guide-attached-tests.html

 Wayne

 2008/9/20 Stevo Slavić [EMAIL PROTECTED]:
  Problem was in fact that test from one module was referencing a test
  resource from other module of the same maven multi-module project. I'm
 not
  sure whether it is a bug in TestNG or m2eclipse eclipse integration, but
 it
  enabled test, which was failing in Maven, to run successfully from TestNG
  eclipse plugin.
 
  Regards,
  Stevo.
 
  On Fri, Sep 12, 2008 at 3:06 PM, Stevo Slavić [EMAIL PROTECTED] wrote:
 
  Hello all,
 
  This is my first post to maven-users mailing list, and from the start,
 I'm
  here to brag about my problems with maven.
 
  I'm having a problem with a TestNG test which runs successfully in
  Eclipse(3.4) TestNG plugin(5.8.02), but in Maven (2.0.9) Surefire
 (2.4.3)
  same test fails. It's a spring(2.5.5)-based integration test, it extends
  AbstractTestNGSpringContextTests, and through @ContextConfiguration
  annotation and its locations attribute it gets configured to load 3
 context
  files, two of them referenced as classpath:/com/ while third one
 is
  from a dependent project/library (test is in one module [war] which
 depends
  on another module [jar] from same multimodule project [pom]) and is
  referenced using classpath*:/com/. .
 
  Among other things, test makes use of a bean (well) defined in that
 third
  (classpath*) context file. That referenced bean is injected to the test
  through use of autowiring (@Autowired). Problem is that that bean
 doesn't
  get found and test initialization fails. Log doesn't print that
 problematic
  context failed to load, just any of it's beans aren't
 accessible/registered.
  Btw, if I leave out * from classpath* spring reports that it couldn't
 load
  context file as it is missing.
 
  I've tried substituting autowiring with getting bean by name manually
 in
  setUp method through this.applicationContext.getBean but this also
 failed.
 
  Then I've thought that it has to do with loader used to load context's,
 so
  I explicitly specified loader attribute of @ContextConfiguration
 annotation
  to be GenericXmlContextLoader.class. This didn't work either. In all of
  these tweaks, test would continue to run well in eclipse testng plugin,
 but
  it fails in maven (both external and m2eclipse internal).
 
  Because I use reportng, I though it interfered with the test somehow but
  removing reportng didn't help as well as removing parallel mode for test
  execution.
 
 
  With this I ran out of options, with you guys being my last resort. Any
  comments and pointers are welcome!
 
  Thanks in advance!
 
  Regards,
  Stevo.
 
 



[m2] archetype repository requires authentication

2008-09-20 Thread Adrian Herscu

Hi all,

I have written an archetype and deployed to my remote repository.
The repository requires authentication.
The problem is when somebody runs mvn archetype:generate ... 
-DarchetypeRepository=http://my.repo he gets a 401 from the server and 
generation fails of course.


Is there any possibility to supply credentials?

Adrian.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [m2] archetype repository requires authentication

2008-09-20 Thread Dave Newton
--- On Sat, 9/20/08, Adrian Herscu wrote:
 I have written an archetype and deployed to my remote
 repository.
 The repository requires authentication.
 The problem is when somebody runs mvn archetype:generate
 ... 
 -DarchetypeRepository=http://my.repo he gets a 401 from the
 server and 
 generation fails of course.
 
 Is there any possibility to supply credentials?

This might help, although I haven't tried it :/

http://maven.apache.org/guides/mini/guide-configuring-maven.html

See the Security and Deployment Settings section; it sounds like the server 
element may do what you want.

HTH,
Dave


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Maven/Eclipse - Keeping them in sync?

2008-09-20 Thread David C. Hicks
Good points, Eugene.  I'll take a closer look at what we're trying to 
accomplish.  Maybe it does make more sense to put integration tests in a 
different module.  This is a very new project, so we're still figuring 
out a lot of the details.  It's just so easy to add source folders under 
Eclipse, that it's easy to think about it that way.


Thanks for the input.
Dave


Eugene Kuleshov wrote:

David C. Hicks wrote:
  

Thanks again.  I'll check out the build-helper plugin.

As for larger projects, that's exactly how I've done them in the past.  
It requires a little massaging of the pom.xml files, but I haven't found 
a cleaner way to handle it.  Maybe one day between Eclipse and Maven 
this won't be such a mind twister.


The primary reason I'm adding extra source folders is for test code.  I 
really don't want to mix functional tests with my unit tests.  It made 
sense, to me, to put them in a different tree, but it didn't seem like a 
good fit for a sub-module.


Thanks for all the suggestions!




  The m2eclipse uses pom.xml as a source of information for configuring
projects in Eclipse. The reason for that is to keep build in Eclipse and in
the command line in sync. The command line build won't run for your
additional test folders if they are not in the pom.xml. After all it might
be a good idea to keep integration tests in a separate module and that would
closely follow standard Maven conventions.

  On the other hand, if you have command line build that works, but there is
some issues in the IDE for the very same build, please submit a bug report
for m2eclipse and provide test project that would allow us to reproduce it.

  Thanks

  Eugene


  


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]