Access to the full classpath when running under Surefire (WAS: [Maven 2])

2007-05-22 Thread Lasse Koskela

Oops. Sorry about the ambiguous title in my previous post... I changed
it to something more communicative.

Lasse

On 5/23/07, Lasse Koskela <[EMAIL PROTECTED]> wrote:

Hi,

I'm trying to convert the open source JUnit extension called JspTest
to use Maven2 for the build and I'm running into trouble with how
Maven's Surefire test runner plugin seems to "hide" the classpath from
the executing code.

The issue stems from the need for a unit test to be able to compile
Java source code (generated from JSP source files), which obviously
needs all sorts of J2EE stuff in the classpath. These dependencies
have been defined in the pom.xml and are visible just fine when
compiling the framework itself and when running the tests, but when
those tests (indirectly) attempt to use the same dependencies to build
up a classpath for a new "javac" process I get all kinds of
"symbol/package/class not found" compilation errors because
System.getProperty("java.class.path") returns only some
maven/surefire/plexus libraries and not a single dependency (not even
the "target/classes" or "target/test-classes" directories).

If I were talking about a plugin, I could have the dependencies be
injected to the Mojo through properties but I'm not talking about a
plugin so that's not an option.

So, I guess my question is how can I get access to the Maven
dependencies and/or the full classpath?


best regards,
Lasse


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



[Maven 2]

2007-05-22 Thread Lasse Koskela

Hi,

I'm trying to convert the open source JUnit extension called JspTest
to use Maven2 for the build and I'm running into trouble with how
Maven's Surefire test runner plugin seems to "hide" the classpath from
the executing code.

The issue stems from the need for a unit test to be able to compile
Java source code (generated from JSP source files), which obviously
needs all sorts of J2EE stuff in the classpath. These dependencies
have been defined in the pom.xml and are visible just fine when
compiling the framework itself and when running the tests, but when
those tests (indirectly) attempt to use the same dependencies to build
up a classpath for a new "javac" process I get all kinds of
"symbol/package/class not found" compilation errors because
System.getProperty("java.class.path") returns only some
maven/surefire/plexus libraries and not a single dependency (not even
the "target/classes" or "target/test-classes" directories).

If I were talking about a plugin, I could have the dependencies be
injected to the Mojo through properties but I'm not talking about a
plugin so that's not an option.

So, I guess my question is how can I get access to the Maven
dependencies and/or the full classpath?


best regards,
Lasse

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



Re: Managing Dependent Jars

2007-02-01 Thread Lasse Koskela

On 1/31/07, Wayne Fay <[EMAIL PROTECTED]> wrote:

I doubt anyone will need to use Spring 1.2.1 for example
when 2.0 is available, so you won't need to ever access
those older /spring etc artifacts.


Anyone except all of those thousands of poor corporate developers who
just this week celebrated a successful upgrade of their standard
technology stack from WebLogic 6.1 to 7.0 and Java 1.3 to Java 1.4...

Lasse

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



Re: Is there a way to control the order of repositories?

2007-01-17 Thread Lasse Koskela

Hi Wayne,

I suppose using a local "proxy" repository would do the trick if I
were always in the same place. However, I rarely work in the same
place for longer than a few weeks, which means that the proxy
repository should move with me :)

Lasse

On 1/18/07, Wayne Fay <[EMAIL PROTECTED]> wrote:

I think most of this functionality can/should be handled with a
Corporate Maven proxy rather than depending on Maven to provide it
directly.

In fact, I think a bit of this functionality might already exist in
Archiva, Proximity, etc -- have you considered them?

Wayne

On 1/17/07, Lasse Koskela <[EMAIL PROTECTED]> wrote:
> I'd like Maven to first check if the nearby (fast) repository has the
> stuff I need and only then fall back to the slower repository.
> [...]
> PS. Another related problem: I'm currently sitting in Finland. Next
> week, I'll be in Poland. A couple of weeks later somewhere else. If
> there was a way to set a "preferred order" for the repositories, I'd
> anyway have to change it quite often as I'm travelling. Unless...


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



Re: Is there a way to control the order of repositories?

2007-01-17 Thread Lasse Koskela

Hi Andre,

I suppose I could just use Mergere's repository but how is it
different from others?
For example, does their DNS server automatically direct me to a nearby
server based on my IP...? Or is it just generally faster than, say,
the iBiblio servers?

Lasse

On 1/18/07, Andrea Malagodi <[EMAIL PROTECTED]> wrote:

Can you not just use: http://repo.mergere.com/maven2/ ?

On 17 Jan 2007, at 23:13, Lasse Koskela wrote:
> Please excuse me for hijacking the thread, but I've got another reason
> for wanting to "order" repositories.
>
> Speed.
>
> What this means is that I'd like Maven to first check if the nearby
> (fast) repository has the stuff I need and only then fall back to the
> slower repository.


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



Re: Is there a way to control the order of repositories?

2007-01-17 Thread Lasse Koskela

On 1/17/07, Raymond Feng <[EMAIL PROTECTED]> wrote:

We use multiple maven repos in the build. Is there a way to control the order 
of the repositories to be searched for artifacts? In some cases, an arifact is 
published to both maven1 and maven2 repos and we prefer to use the one from the 
maven2 repo.


Please excuse me for hijacking the thread, but I've got another reason
for wanting to "order" repositories.

Speed.

Let's say there's a repository in the office building next to me,
which is a gazillion times as fast as an "official" one on the other
side of the globe. Now, let's also say that the nearby repository is
slow to synchronize with the far-away official repository.

What this means is that I'd like Maven to first check if the nearby
(fast) repository has the stuff I need and only then fall back to the
slower repository.

Lasse


PS. Another related problem: I'm currently sitting in Finland. Next
week, I'll be in Poland. A couple of weeks later somewhere else. If
there was a way to set a "preferred order" for the repositories, I'd
anyway have to change it quite often as I'm travelling. Unless...

[begin smoking the proverbial crack]

Maybe Maven could do a daily benchmark--a ping of some kind--against
each repository, measuring the latency and reordering them
accordingly, storing the measured latencies under "$HOME/.m2"?

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



Re: [m2] could not locate maven-surefire-plugin in svn repo

2007-01-17 Thread Lasse Koskela

Hi Dario,

On 1/17/07, Dário Luís Coneglian Oliveros <[EMAIL PROTECTED]> wrote:

Could anoyne please tell me what happened to maven-surefire-plugin ?
I couldn't find it at http://svn.apache.org/repos/asf/maven/plugins/trunk as 
stated in its site -  
http://maven.apache.org/plugins/maven-surefire-plugin/index.html.
Thanks,
Dário


It's under http://svn.apache.org/repos/asf/maven/surefire/trunk/


Lasse

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



Re: How to make plugin see the full (project & plugin) classpath?

2007-01-17 Thread Lasse Koskela

Hi,

On 1/17/07, Niels Gylling <[EMAIL PROTECTED]> wrote:

Also make sure you have the following mojo property set
@requiresDependencyResolution compile

That will populate ${plugin.artifacts}


Thanks. I had that set to "test".

I actually did get my stuff working by using the ${plugin.artifactMap}
before I saw this. I'll start using the "plugin.artifacts" instead of
"plugin.artifactMap" as it's much prettier, though.

Lasse

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



Re: How to make plugin see the full (project & plugin) classpath?

2007-01-17 Thread Lasse Koskela

Hmm. Answering my own question, it looks like "${plugin.artifactMap}"
might do the trick. Let me report back after I've had a chance to try
it out.

Lasse

On 1/17/07, Lasse Koskela <[EMAIL PROTECTED]> wrote:

Allan, Franz,

On 1/17/07, franz see <[EMAIL PROTECTED]> wrote:
> For more information about Maven Properties, please see [1].
> [1] http://docs.codehaus.org/display/MAVENUSER/MavenPropertiesGuide
>
> allan ramirez wrote:
> > Have you tried using ${plugin.artifacts} expression?

Thanks for the tips, although I still couldn't get it working.

I tried all of the artifact-related properties listed in Franz's link
and what I'm missing is, for example, the following.

My plugin's POM has a dependency to "maven-plugin-api" as follows:


  ...
  jdave-maven-plugin
  maven-plugin
  

  org.apache.maven
  maven-plugin-api
  2.0

...
  


And a project that's using my plugin has a plugin dependency to my plugin:


  ...
  

  
my
my-maven-plugin

  
test

  test

  

  

  


Now I can figure out from within "my-maven-plugin" where the plugin's
Mojo class itself is loaded by asking the ClassLoader, for example.
The problem is that I can't see its dependencies.

The "project.pluginArtifacts" property seems to inject some stuff,
including "my-maven-plugin" but not the plugin's dependencies. Also,
the Artifact objects don't seem to have enough information to resolve
to an actual .jar file in the repository (their getVersion() says
"RELEASE"?).

Lasse


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



Re: How to make plugin see the full (project & plugin) classpath?

2007-01-17 Thread Lasse Koskela

Allan, Franz,

On 1/17/07, franz see <[EMAIL PROTECTED]> wrote:

For more information about Maven Properties, please see [1].
[1] http://docs.codehaus.org/display/MAVENUSER/MavenPropertiesGuide

allan ramirez wrote:
> Have you tried using ${plugin.artifacts} expression?


Thanks for the tips, although I still couldn't get it working.

I tried all of the artifact-related properties listed in Franz's link
and what I'm missing is, for example, the following.

My plugin's POM has a dependency to "maven-plugin-api" as follows:


 ...
 jdave-maven-plugin
 maven-plugin
 
   
 org.apache.maven
 maven-plugin-api
 2.0
   
   ...
 


And a project that's using my plugin has a plugin dependency to my plugin:


 ...
 
   
 
   my
   my-maven-plugin
   
 
   test
   
 test
   
 
   
 
   
 


Now I can figure out from within "my-maven-plugin" where the plugin's
Mojo class itself is loaded by asking the ClassLoader, for example.
The problem is that I can't see its dependencies.

The "project.pluginArtifacts" property seems to inject some stuff,
including "my-maven-plugin" but not the plugin's dependencies. Also,
the Artifact objects don't seem to have enough information to resolve
to an actual .jar file in the repository (their getVersion() says
"RELEASE"?).

Lasse

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



How to make plugin see the full (project & plugin) classpath?

2007-01-16 Thread Lasse Koskela

Hi,

I'm developing a Maven 2 plugin and I'm having trouble making my
plugin see the necessary libraries etc. in its classpath.

What I need is:
1) the plugin itself and all of its dependencies
2) the compilation classpath and all dependencies for the project
that's using the plugin

It seems that by default I don't get neither and with the ${project.*}
properties I can only get the project's classpath and dependencies but
not the plugin's.

Am I missing a property? (are they documented somewhere on one page,
by the way?)
Should I add some special annotation to my Mojo class?

Lasse

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



Re: SCM URL for the maven-surefire-plugin

2007-01-16 Thread Lasse Koskela

...which I noticed just 5 minutes ago to my pleasure. Thanks :)
(The URLs were still incorrect, though)

Lasse

On 1/16/07, Tom Huybrechts <[EMAIL PROTECTED]> wrote:

These patches in MSUREFIRE-31 have already been applied to trunk.

http://svn.apache.org/viewvc/maven/surefire/trunk/


On 1/16/07, Lasse Koskela <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I'm in the process of figuring out whether I can get one of the
> surefire-and-junit4 patches working and found out that a wrong URL to
> the Subversion repository is posted on the "Source repository" page at
> http://maven.apache.org/plugins/maven-surefire-plugin/source-repository.html
>
> Apparently it should point to:
> http://svn.apache.org/repos/asf/maven/surefire/trunk/maven-surefire-plugin
>
> Lasse
>
> -
> 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]



SCM URL for the maven-surefire-plugin

2007-01-16 Thread Lasse Koskela

Hi,

I'm in the process of figuring out whether I can get one of the
surefire-and-junit4 patches working and found out that a wrong URL to
the Subversion repository is posted on the "Source repository" page at
http://maven.apache.org/plugins/maven-surefire-plugin/source-repository.html

Apparently it should point to:
http://svn.apache.org/repos/asf/maven/surefire/trunk/maven-surefire-plugin

Lasse

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