maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Milos Kleint <Milos.Kle...@Sun.COM>
Subject Re: AW: Maven classloader breaks URLs
Date Fri, 12 Nov 2004 13:57:51 GMT
if you install mevenide for netbeans, it should be able to do it for 
you.  (http://mevenide.codehaus.org/download.html)
You just open the project from the IDE,  set the breakpoint in the test 
and find the debug test action in main menu.
It's using a mevenide in-house maven plugin that does exactly that, 
allowing you to run the test with debug args and connects the IDE's 
debugger to it.. The connection part is a bit shaky, but generally works.
You can actuallyuse the maven-plugin itself separately on the command 
line as well, see 
http://mevenide.codehaus.org/maven-mevenide-plugin/index.html for details.

Regards

Milos Kleint


Brett Porter wrote:

>I thnik it is maven.junit.jvmargs (check the test plugin doco), where
>you can specify -Xdebug etc then connect using your IDE using a remote
>debugger (JPDA).
>
>Cheers,
>Brett
>
>
>On Fri, 12 Nov 2004 11:02:17 +0100, Daniel Frey <daniel.frey@xmatrix.ch> wrote:
>  
>
>>Thanks for the hint. It solves the problem partly. But I get wired
>>behaviour, directories are not created aso. Is there a way to debug the
>>projects source code line by line within my IDE when the tests are run with
>>maven?
>>
>>-----Urspr√ľngliche Nachricht-----
>>Von: Brett Porter [mailto:brett.porter@gmail.com]
>>Gesendet: Donnerstag, 11. November 2004 23:33
>>An: Maven Users List
>>Betreff: Re: Maven classloader breaks URLs
>>
>>I'd have to look closer to understand this and see whether it is a real
>>problem or not, but a possible workaround is to have your tests in a forked
>>JVM?
>>
>>maven.junit.fork=true
>>
>>- Brett
>>
>>On Thu, 11 Nov 2004 12:51:13 +0100, Daniel Frey <qwer12341@gmx.ch> wrote:
>>    
>>
>>>Hello
>>>
>>>I am using a method SharkUtils.class.getResource to load resources for
>>>my project. The resource is lateron addressed as a file:
>>>
>>>001  final String name = "sql/hsql/LoaderJob.olj";
>>>002  final URL resource = SharkUtils.class.getResource(name);
>>>003  final String external = resource.toExternalForm();
>>>004  final URI uri = new URI(external);
>>>005  final String string = uri.getRawPath();
>>>006  final File file = new File(string);
>>>
>>>Running such code in my IDE works great. The values of the variables
>>>(using
>>>toString()) are:
>>>
>>>001  sql/hsql/LoaderJob.olj
>>>002
>>>file:/E:/Daten/OrderManager/target/classes/ch/xmatrix/om/core/impl/sha
>>>rk/sql
>>>/hsql/LoaderJob.olj
>>>003
>>>file:/E:/Daten/OrderManager/target/classes/ch/xmatrix/om/core/impl/sha
>>>rk/sql
>>>/hsql/LoaderJob.olj
>>>004
>>>file:/E:/Daten/OrderManager/target/classes/ch/xmatrix/om/core/impl/sha
>>>rk/sql
>>>/hsql/LoaderJob.olj
>>>005
>>>/E:/Daten/OrderManager/target/classes/ch/xmatrix/om/core/impl/shark/sq
>>>l/hsql
>>>/LoaderJob.olj
>>>006
>>>E:\Daten\OrderManager\target\classes\ch\xmatrix\om\core\impl\shark\sql
>>>\hsql\
>>>LoaderJob.olj
>>>
>>>However running it with maven (within a test case) failes. The values
>>>of the variables are:
>>>
>>>001  sql/hsql/LoaderJob.olj
>>>002
>>>file:E:/Daten/OrderManager/target/classes/ch/xmatrix/om/core/impl/shar
>>>k/sql/
>>>hsql/LoaderJob.olj
>>>003
>>>file:E:/Daten/OrderManager/target/classes/ch/xmatrix/om/core/impl/shar
>>>k/sql/
>>>hsql/LoaderJob.olj
>>>004
>>>file:E:/Daten/OrderManager/target/classes/ch/xmatrix/om/core/impl/shar
>>>k/sql/
>>>hsql/LoaderJob.olj
>>>005  null
>>>006  NPE
>>>
>>>The difference is obvious. The URL is not translated to an absolute
>>>reference, hence leading to a NPE. I do not know the internals of maven
>>>      
>>>
>>but:
>>    
>>
>>>If it uses an own class loader, this could explain the behaviour. Or
>>>do you have another idea why the URL is not addressed absloutley? Any
>>>ideas to resolve this issue?
>>>
>>>Thanks
>>>Daniel
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>For additional commands, e-mail: users-help@maven.apache.org
>>>
>>>
>>>      
>>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>>    
>>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>For additional commands, e-mail: users-help@maven.apache.org
>
>  
>


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


Mime
View raw message