RE: MavenEmbedder problem with 3.1.x

2013-11-20 Thread Bernd Adamowicz
No answer so far. Should I file a bug? Any opinion?

Bernd Adamowicz


-Original Message-
From: Bernd Adamowicz [mailto:bernd.adamow...@esailors.de] 
Sent: Montag, 18. November 2013 16:12
To: users@maven.apache.org
Subject: MavenEmbedder problem with 3.1.x

Hi all,

When switching from Maven 3.0.x to 3.1.x some of our projects where not able to 
execute anymore due to a problem with MavenEmbedder. Both projects are command 
line based, no Maven plugin around it.

I think the most important part of the stack trace is this:

37) No implementation for 
java.util.Setorg.eclipse.aether.spi.localrepo.LocalRepositoryManagerFactory 
was bound.
  while locating 
java.util.Setorg.eclipse.aether.spi.localrepo.LocalRepositoryManagerFactory
for parameter 0 at 
org.eclipse.aether.internal.impl.DefaultLocalRepositoryProvider.init(Unknown
...
37 errors
  role: org.apache.maven.execution.MavenExecutionRequestPopulator
  roleHint:
at com.google.inject.internal.InjectorImpl$3.get(InjectorImpl.java:974)
at org.eclipse.sisu.inject.LazyBeanEntry.getValue(LazyBeanEntry.java:82)
at org.eclipse.sisu.plexus.LazyPlexusBean.getValue(LazyPlexusBean.java:51)
at 
org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:260)
at 
org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:252)
at 
org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:246)
at hudson.maven.MavenEmbedder.lookup(MavenEmbedder.java:567)
at 
hudson.maven.MavenEmbedder.buildMavenExecutionRequest(MavenEmbedder.java:157)
at hudson.maven.MavenEmbedder.init(MavenEmbedder.java:120)
at hudson.maven.MavenEmbedder.init(MavenEmbedder.java:109)
at hudson.maven.MavenEmbedder.init(MavenEmbedder.java:136)
at test.embedder.AppTest.testLookup(AppTest.java:57)

I know this problem came when I changed my aether-dependencies from 
'org.sonatype.aether' to 'org.eclipse.aether' in order to work with Maven 3.1.x.

Fortunately this can be reproduced with a simple project which can be found 
here: https://dl.dropboxusercontent.com/u/86229859/embedder-test.tgz

Usage of the MavenEmbedder looks like this:

package test.embedder;
import hudson.maven.MavenEmbedder;
import hudson.maven.MavenEmbedderException;
import hudson.maven.MavenRequest;
import java.io.File;
import org.apache.maven.model.building.ModelBuildingRequest;
import org.apache.maven.project.MavenProject;

public class App {
private static final ClassLoadermavenClassLoader = 
App.class.getClassLoader();
private static final ThreadLocalMavenEmbedder embedder = new 
ThreadLocalMavenEmbedder() {

 @Override
 protected MavenEmbedder initialValue() {
 try {
 MavenRequest req = new MavenRequest();
 
req.setValidationLevel(ModelBuildingRequest.VALIDATION_LEVEL_MAVEN_3_1);
 return new MavenEmbedder(mavenClassLoader, req);
 } catch (MavenEmbedderException e) {
 throw new RuntimeException(
 Error creating MavenEmbedder, e);
 }
 }
 };

public static MavenProject getMavenProject(File pomFile) {
try {
return embedder.get().readProject(pomFile);
} catch (Exception e) {
throw new RuntimeException(Error parsing POM at  + pomFile, e);
}
}
}

This unit test will then trigger the error:

package test.embedder;
import static org.testng.AssertJUnit.assertEquals;
import static org.testng.AssertJUnit.assertNotNull;
import java.io.File;
import org.apache.commons.io.FileUtils;
import org.apache.maven.project.MavenProject;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;

public class AppTest {
private static File mvnUtilFolder = null;
@BeforeClass
public static void setUpBeforeClass() throws Exception {
mvnUtilFolder = 
FileUtils.toFile(AppTest.class.getClassLoader().getResource(mvnUtil));
}

@Test
public void testGetMavenProject() {
File mvnPom = new File(mvnUtilFolder.getAbsolutePath() + /pom.xml);
MavenProject mvnProject = App.getMavenProject(mvnPom);
assertNotNull(mvnProject);
assertEquals(3.5.2, mvnProject.getVersion());
}
}

For me all this looks like a 'simple' classloader issue when Guice tries to 
load the classes (e.g.:  
org.eclipse.aether.spi.localrepo.LocalRepositoryManagerFactory) but can't find 
them.

I've googled presumably all the places dealing with problems when switching 
from 3.0.x to 3.1.x and tried a lot of things without success. In particular:

* fixed all versions of plugins as described here: 
https://cwiki.apache.org/confluence/display/MAVEN/AetherClassNotFound
* changed dependencies to Ather as described here: http

RE: MavenEmbedder problem with 3.1.x

2013-11-20 Thread Bernd Adamowicz
Amazing! This works!

I tried so many permutations of dependency version, but obviously never got the 
right one. Thanks a lot Stuart!

-- 
Bernd Adamowicz


-Original Message-
From: Stuart McCulloch [mailto:mccu...@gmail.com] 
Sent: Mittwoch, 20. November 2013 16:04
To: Maven Users List
Subject: Re: MavenEmbedder problem with 3.1.x

Update the lib-jenkins-maven-embedder dependency to version 3.11, since this is 
the version that works with the latest aether/sisu dependencies.

On 20 Nov 2013, at 09:41, Bernd Adamowicz wrote:

 No answer so far. Should I file a bug? Any opinion?
 
 Bernd Adamowicz
 
 
 -Original Message-
 From: Bernd Adamowicz [mailto:bernd.adamow...@esailors.de]
 Sent: Montag, 18. November 2013 16:12
 To: users@maven.apache.org
 Subject: MavenEmbedder problem with 3.1.x
 
 Hi all,
 
 When switching from Maven 3.0.x to 3.1.x some of our projects where not able 
 to execute anymore due to a problem with MavenEmbedder. Both projects are 
 command line based, no Maven plugin around it.
 
 I think the most important part of the stack trace is this:
 
 37) No implementation for 
 java.util.Setorg.eclipse.aether.spi.localrepo.LocalRepositoryManagerFactory 
 was bound.
  while locating 
 java.util.Setorg.eclipse.aether.spi.localrepo.LocalRepositoryManagerFactory
for parameter 0 at 
 org.eclipse.aether.internal.impl.DefaultLocalRepositoryProvider.init
 (Unknown
 ...
 37 errors
  role: org.apache.maven.execution.MavenExecutionRequestPopulator
  roleHint:
at com.google.inject.internal.InjectorImpl$3.get(InjectorImpl.java:974)
at org.eclipse.sisu.inject.LazyBeanEntry.getValue(LazyBeanEntry.java:82)
at org.eclipse.sisu.plexus.LazyPlexusBean.getValue(LazyPlexusBean.java:51)
at 
 org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:260)
at 
 org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:252)
at 
 org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:246)
at hudson.maven.MavenEmbedder.lookup(MavenEmbedder.java:567)
at 
 hudson.maven.MavenEmbedder.buildMavenExecutionRequest(MavenEmbedder.java:157)
at hudson.maven.MavenEmbedder.init(MavenEmbedder.java:120)
at hudson.maven.MavenEmbedder.init(MavenEmbedder.java:109)
at hudson.maven.MavenEmbedder.init(MavenEmbedder.java:136)
at test.embedder.AppTest.testLookup(AppTest.java:57)
 
 I know this problem came when I changed my aether-dependencies from 
 'org.sonatype.aether' to 'org.eclipse.aether' in order to work with Maven 
 3.1.x.
 
 Fortunately this can be reproduced with a simple project which can be 
 found here: 
 https://dl.dropboxusercontent.com/u/86229859/embedder-test.tgz
 
 Usage of the MavenEmbedder looks like this:
 
 package test.embedder;
 import hudson.maven.MavenEmbedder;
 import hudson.maven.MavenEmbedderException;
 import hudson.maven.MavenRequest;
 import java.io.File;
 import org.apache.maven.model.building.ModelBuildingRequest;
 import org.apache.maven.project.MavenProject;
 
 public class App {
private static final ClassLoadermavenClassLoader = 
 App.class.getClassLoader();
private static final ThreadLocalMavenEmbedder embedder = new 
 ThreadLocalMavenEmbedder() {
 
 @Override
 protected MavenEmbedder initialValue() {
 try {
 MavenRequest req = new MavenRequest();
 
 req.setValidationLevel(ModelBuildingRequest.VALIDATION_LEVEL_MAVEN_3_1);
 return new MavenEmbedder(mavenClassLoader, req);
 } catch (MavenEmbedderException e) {
 throw new RuntimeException(
 Error creating MavenEmbedder, e);
 }
 }
 };
 
public static MavenProject getMavenProject(File pomFile) {
try {
return embedder.get().readProject(pomFile);
} catch (Exception e) {
throw new RuntimeException(Error parsing POM at  + pomFile, e);
}
}
 }
 
 This unit test will then trigger the error:
 
 package test.embedder;
 import static org.testng.AssertJUnit.assertEquals;
 import static org.testng.AssertJUnit.assertNotNull;
 import java.io.File;
 import org.apache.commons.io.FileUtils; import 
 org.apache.maven.project.MavenProject;
 import org.testng.annotations.BeforeClass;
 import org.testng.annotations.Test;
 
 public class AppTest {
private static File mvnUtilFolder = null;
@BeforeClass
public static void setUpBeforeClass() throws Exception {
mvnUtilFolder = 
 FileUtils.toFile(AppTest.class.getClassLoader().getResource(mvnUtil));
}
 
@Test
public void testGetMavenProject() {
File mvnPom = new File(mvnUtilFolder.getAbsolutePath() + /pom.xml);
MavenProject mvnProject = App.getMavenProject(mvnPom

MavenEmbedder problem with 3.1.x

2013-11-18 Thread Bernd Adamowicz
Hi all,

When switching from Maven 3.0.x to 3.1.x some of our projects where not able to 
execute anymore due to a problem with MavenEmbedder. Both projects are command 
line based, no Maven plugin around it.

I think the most important part of the stack trace is this:

37) No implementation for 
java.util.Setorg.eclipse.aether.spi.localrepo.LocalRepositoryManagerFactory 
was bound.
  while locating 
java.util.Setorg.eclipse.aether.spi.localrepo.LocalRepositoryManagerFactory
for parameter 0 at 
org.eclipse.aether.internal.impl.DefaultLocalRepositoryProvider.init(Unknown
...
37 errors
  role: org.apache.maven.execution.MavenExecutionRequestPopulator
  roleHint:
at com.google.inject.internal.InjectorImpl$3.get(InjectorImpl.java:974)
at org.eclipse.sisu.inject.LazyBeanEntry.getValue(LazyBeanEntry.java:82)
at org.eclipse.sisu.plexus.LazyPlexusBean.getValue(LazyPlexusBean.java:51)
at 
org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:260)
at 
org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:252)
at 
org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:246)
at hudson.maven.MavenEmbedder.lookup(MavenEmbedder.java:567)
at 
hudson.maven.MavenEmbedder.buildMavenExecutionRequest(MavenEmbedder.java:157)
at hudson.maven.MavenEmbedder.init(MavenEmbedder.java:120)
at hudson.maven.MavenEmbedder.init(MavenEmbedder.java:109)
at hudson.maven.MavenEmbedder.init(MavenEmbedder.java:136)
at test.embedder.AppTest.testLookup(AppTest.java:57)

I know this problem came when I changed my aether-dependencies from 
'org.sonatype.aether' to 'org.eclipse.aether' in order to work with Maven 3.1.x.

Fortunately this can be reproduced with a simple project which can be found 
here: https://dl.dropboxusercontent.com/u/86229859/embedder-test.tgz

Usage of the MavenEmbedder looks like this:

package test.embedder;
import hudson.maven.MavenEmbedder;
import hudson.maven.MavenEmbedderException;
import hudson.maven.MavenRequest;
import java.io.File;
import org.apache.maven.model.building.ModelBuildingRequest;
import org.apache.maven.project.MavenProject;

public class App {
private static final ClassLoadermavenClassLoader = 
App.class.getClassLoader();
private static final ThreadLocalMavenEmbedder embedder = new 
ThreadLocalMavenEmbedder() {

 @Override
 protected MavenEmbedder initialValue() {
 try {
 MavenRequest req = new MavenRequest();
 
req.setValidationLevel(ModelBuildingRequest.VALIDATION_LEVEL_MAVEN_3_1);
 return new MavenEmbedder(mavenClassLoader, req);
 } catch (MavenEmbedderException e) {
 throw new RuntimeException(
 Error creating MavenEmbedder, e);
 }
 }
 };

public static MavenProject getMavenProject(File pomFile) {
try {
return embedder.get().readProject(pomFile);
} catch (Exception e) {
throw new RuntimeException(Error parsing POM at  + pomFile, e);
}
}
}

This unit test will then trigger the error:

package test.embedder;
import static org.testng.AssertJUnit.assertEquals;
import static org.testng.AssertJUnit.assertNotNull;
import java.io.File;
import org.apache.commons.io.FileUtils;
import org.apache.maven.project.MavenProject;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;

public class AppTest {
private static File mvnUtilFolder = null;
@BeforeClass
public static void setUpBeforeClass() throws Exception {
mvnUtilFolder = 
FileUtils.toFile(AppTest.class.getClassLoader().getResource(mvnUtil));
}

@Test
public void testGetMavenProject() {
File mvnPom = new File(mvnUtilFolder.getAbsolutePath() + /pom.xml);
MavenProject mvnProject = App.getMavenProject(mvnPom);
assertNotNull(mvnProject);
assertEquals(3.5.2, mvnProject.getVersion());
}
}

For me all this looks like a 'simple' classloader issue when Guice tries to 
load the classes (e.g.:  
org.eclipse.aether.spi.localrepo.LocalRepositoryManagerFactory) but can't find 
them.

I've googled presumably all the places dealing with problems when switching 
from 3.0.x to 3.1.x and tried a lot of things without success. In particular:

* fixed all versions of plugins as described here: 
https://cwiki.apache.org/confluence/display/MAVEN/AetherClassNotFound
* changed dependencies to Ather as described here: http://eclipse.org/aether
* basically I implemented things the way they are done in the lib-jenkins 
implementation itself here: 
https://github.com/jenkinsci/lib-jenkins-maven-embedder/blob/master/src/test/java/hudson/maven/TestMavenEmbedderSimpleProject.java
* tried to deal 

Re: Artifacts missing in maven-aether-provider in Maven 3.1.0

2013-09-30 Thread Bernd Adamowicz

OK. Thanks for clarifying this!

However, one question remains about the missing classes:

* org.apache.maven.repository.internal.MavenRepositorySystemSession
* org.apache.maven.repository.internal.MavenServiceLocator

Have they been replaced by other classes or is there a migration path? We're 
using a plugin that depends on them.

Thanks,
Bernd

On Thu, 19 Sep 2013 23:52:20 +0200, Stuart McCulloch mccu...@gmail.com wrote:


Maven 3.1.0 was released after the Maven runtime project moved to git:

https://git-wip-us.apache.org/repos/asf?p=maven.git;a=summary

Specifically:


https://git-wip-us.apache.org/repos/asf?p=maven.git;a=tree;h=5a0e6574404b4964522d90c3438e25574a95466c;hb=893ca28a1da9d5f51ac03827af98bb730128f9f2

The tag you saw in svn is probably the leftover of an aborted release before 
the move to git.

On 19 Sep 2013, at 22:36, Bernd Adamowicz wrote:


Hi all!

When switching from 3.0.4 to 3.1.0 I encountered that obviously the classes

* org.apache.maven.repository.internal.MavenRepositorySystemSession
* org.apache.maven.repository.internal.MavenServiceLocator

are no longer there. Seems, the last version with these classes was 3.0.5.

However, if I check out maven-aether-provider from 
http://svn.apache.org/repos/asf/maven/maven-3/tags/maven-3.1.0/maven-aether-provider
 and have a look at the sources, the classes are there. The Jar after building 
the project also contains them. But the official Jar at Maven Central does not.

Tried to find a hint somewhere inside the release notes with no success. So, 
can anyone tell me what's going on here? Where are these classes?

Thanks for any help!
Bernd

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




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





--
Bernd Adamowicz
Softwaremanagement

Georg-Fahrbach-Straße 21
74653 Ingelfingen-Criesbach
Mobil: +49 (0)171 7278857
Mail: i...@bernd-adamowicz.de
http://www.bernd-adamowicz.de

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



Artifacts missing in maven-aether-provider in Maven 3.1.0

2013-09-19 Thread Bernd Adamowicz

Hi all!

When switching from 3.0.4 to 3.1.0 I encountered that obviously the classes

* org.apache.maven.repository.internal.MavenRepositorySystemSession
* org.apache.maven.repository.internal.MavenServiceLocator

are no longer there. Seems, the last version with these classes was 3.0.5.

However, if I check out maven-aether-provider from 
http://svn.apache.org/repos/asf/maven/maven-3/tags/maven-3.1.0/maven-aether-provider
 and have a look at the sources, the classes are there. The Jar after building 
the project also contains them. But the official Jar at Maven Central does not.

Tried to find a hint somewhere inside the release notes with no success. So, 
can anyone tell me what's going on here? Where are these classes?

Thanks for any help!
Bernd

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



Re: offline mode with in plugin

2010-03-05 Thread bernd . adamowicz
Of course:

 27 /**
 28  * @parameter expression=${session}
 29  */
 30 private MavenSession mavenSession;

Bernd




meier.krist...@gmail.com wrote on 05.03.2010 06:28:53:

 [image removed] 
 
 Re: offline mode with in plugin
 
 kristian 
 
 to:
 
 Maven Users List
 
 05.03.2010 06:29
 
 Sent by:
 
 meier.krist...@gmail.com
 
 Please respond to Maven Users List
 
 I saw this MavenSession object before but it is not a component
 
 /** @component */
 MavenSession session
 
 does not work. is it possible to get access to the MavenSession from
 with in a plugin ?


InterComponentWare AG:  
Vorstand: Peter Kirschbauer (Vors.), Jörg Stadler / Aufsichtsratsvors.: Prof. 
Dr. Christof Hettich  
Firmensitz: 69190 Walldorf, Industriestraße 41 / AG Mannheim HRB 351761 / 
USt.-IdNr.: DE 198388516  

RE: Read properties from pom.xml from Java

2010-02-05 Thread bernd . adamowicz
According to Maven's documentation here 
http://maven.apache.org/pom.html#Properties, this should work (I didn't 
try it):

settings.xml:

settings
  profiles
profile
  activation
activeByDefaulttrue/activeByDefault
  /activation
  properties
database.driveroracle.jdbc.driver.OracleDriver/database.driver
database.urljdbc:oracle:thin:@myhome:1521:orcl/database.url

pom.xml:

properties
  db.driveroracle.jdbc.OracleDriver/db.driver
  db.url${settings.database.url}/db.url

I don't know if the profile comes into play in this case or if the whole 
path is needed like 'settings.profiles.profile'. Just try it.

Bernd


Søren Krogh Neigaard soeren.krogh.neiga...@systematic.com wrote on 
05.02.2010 08:47:04:

 [image removed] 
 
 RE: Read properties from pom.xml from Java
 
 Søren Krogh Neigaard 
 
 to:
 
 Maven Users List
 
 05.02.2010 08:47
 
 Please respond to Maven Users List
 
 But I do use the @Before annotation, and I was planning to call my 
 database cleanup from here. But my problem is that the database 
 properties are not accessible to me (I think), and they are managed 
 by maven (are they not?).
 
 Med venlig hilsen / Kind regards 
 
 
 Søren Krogh Neigaard
 Systems Engineer
 
 Søren Frichs Vej 39, 8000 Aarhus C
 Denmark 
 
 Mobile +4541965252
 soeren.krogh.neiga...@systematic.com
 www.systematic.com


InterComponentWare AG:  
Vorstand: Peter Kirschbauer (Vors.), Jörg Stadler / Aufsichtsratsvors.: Prof. 
Dr. Christof Hettich  
Firmensitz: 69190 Walldorf, Industriestraße 41 / AG Mannheim HRB 351761 / 
USt.-IdNr.: DE 198388516  

Re: Read properties from pom.xml from Java

2010-02-04 Thread bernd . adamowicz
Sounds like this might help you:

- Create a Maven plugin which is executed in any phase bevore test, 
e.g. 'generate-test-resources'. This will make it possible to set up the 
database. This plugin might help for starting the database (only if you're 
using HSQL): 
http://gforge.openehealth.org/gf/project/development/wiki/?pagename=Documentation+HSQLDB+plugin
, but there are others, too.

- Reading of POM-properties inside a Maven plugin is easy and described 
here: 
http://www.sonatype.com/books/mvnref-book/reference/writing-plugins-sect-mojo-params.html#writing-plugins-sect-param-values

However, the scenario described by you clearly indicates that this is not 
a unit test instead it is an integration test where other rules/plugins 
might apply, e.g. maven-invoker-plugin. But this would recommend a 
restructuring of your project and might not be what you want. 

Bernd






Søren Krogh Neigaard soeren.krogh.neiga...@systematic.com wrote on 
04.02.2010 09:59:26:

 [image removed] 
 
 Read properties from pom.xml from Java
 
 Søren Krogh Neigaard 
 
 to:
 
 users
 
 04.02.2010 10:00
 
 Please respond to Maven Users List
 
 Hi
 
 
 
 I have been tossed into a maven controlled project. We run our junit
 tests from Eclipse and also on our build server. When ever they are 
 run, some maven magic happens so that username/password/driver/url 
 for the dabase is correctly set for the user pc or the buildserver. 
 However I need to make a small helper class for my junit tests that 
 wipes the database and loads some testdata on the database for every
 junit test.
 
 
 
 The username/password/driver/url for the database is set in the 
 pom.xml file by maven. How do I read these values from my Java helper 
class?
 
 
 
 Best regards
 
 Søren 
 
 
 



InterComponentWare AG:  
Vorstand: Peter Kirschbauer (Vors.), Jörg Stadler / Aufsichtsratsvors.: Prof. 
Dr. Christof Hettich  
Firmensitz: 69190 Walldorf, Industriestraße 41 / AG Mannheim HRB 351761 / 
USt.-IdNr.: DE 198388516  

Re: SUN Maven(2) repo changes? JMX, JMS, Mail, JMXTOOLS

2010-02-04 Thread bernd . adamowicz
We had the same problem with, I guess, a Fornax repository a few months 
ago and it was terrible. Question to Maven developers: Wouldn't  it be 
possible to treat a 301 (redirect) error the same way as a 40x error? This 
would prevent the POMs from beeing corrupted.

Bernd


Andy Jefferson andy_jeffer...@yahoo.com wrote on 04.02.2010 11:47:13:

 [image removed] 
 
 SUN Maven(2) repo changes? JMX, JMS, Mail, JMXTOOLS
 
 Andy Jefferson 
 
 to:
 
 users
 
 04.02.2010 11:58
 
 Please respond to Maven Users List
 
 For the last few hours I've been getting issues with Maven2 
 downloading jars/poms for the following SUN jars
 
 jmxtools-1.2.1
 jmxri-1.2.1
 mail-1.4
 jms-1.1
 
 Maven2 goes off to, for example,
 
 https://maven-repository.dev.java.net/nonav/repository/com.sun.jmx/
 poms/jmxri-1.2.1.pom
 
 which replies with HTML as follows
 
 !DOCTYPE HTML PUBLIC -//IETF//DTD HTML 2.0//EN
 htmlhead
 title301 Moved Permanently/title
 /headbody
 h1Moved Permanently/h1
 pThe document has moved a href=http://download.java.net/maven/1/
 com.sun.jdmk/poms/jmxtools-1.2.1.pomhere/a./p
 hr
 addressApache Server at maven-repository.dev.java.net Port 
443/address
 /body/html
 
 
 which is promptly stored in my local M2 repo as XXX.pom, and hell 
 follows after ...
 
 
 The location referred to in this file doesn't exist either.
 
 Can somebody who knows the people in charge of SUN's M2 repo please 
 advise them of this.
 
 --
 Andy
 
 
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
 For additional commands, e-mail: users-h...@maven.apache.org
 



InterComponentWare AG:  
Vorstand: Peter Kirschbauer (Vors.), Jörg Stadler / Aufsichtsratsvors.: Prof. 
Dr. Christof Hettich  
Firmensitz: 69190 Walldorf, Industriestraße 41 / AG Mannheim HRB 351761 / 
USt.-IdNr.: DE 198388516  

RE: Read properties from pom.xml from Java

2010-02-04 Thread bernd . adamowicz
Søren Krogh Neigaard soeren.krogh.neiga...@systematic.com wrote on 
05.02.2010 07:45:51:

 We are already using 
 the sql-maven-plugin to bootstrap the database, but it only gets run
 once before all junit tests are run, and that is not what I need, I 
 need it to run for every test to ensure a clean database.
 
 I can easily make some code that drops my tables and so on, but I 
 need the correct database properties from the correct settings.xml.
 
 Bernd you talked about making a plugin that gets called before every
 test, how can I do this?

Søren,

after reading this post from you I know that my suggestion is not what you 
want, since you already have it (starting the sql-maven-plugin once before 
all tests). If you need something to be done before every single test, 
you'll have to use Junit's '@Before' annotated methods. If you need some 
advice here, we should make this outside this list since this is no Maven 
issue at all.

Bernd

 
 Med venlig hilsen / Kind regards 
 
 
 Søren Krogh Neigaard
 Systems Engineer
 
 Søren Frichs Vej 39, 8000 Aarhus C
 Denmark 
 
 Mobile +4541965252
 soeren.krogh.neiga...@systematic.com
 www.systematic.com
 
 
 -Original Message-
 From: bernd.adamow...@external.icw-global.com [
 mailto:bernd.adamow...@external.icw-global.com] 
 Sent: 4. februar 2010 11:59
 To: Maven Users List
 Subject: Re: Read properties from pom.xml from Java
 
 Sounds like this might help you:
 
 - Create a Maven plugin which is executed in any phase bevore test, 
 e.g. 'generate-test-resources'. This will make it possible to set up the 

 database. This plugin might help for starting the database (only if 
you're 
 using HSQL): 
 http://gforge.openehealth.org/gf/project/development/wiki/?
 pagename=Documentation+HSQLDB+plugin
 , but there are others, too.
 
 - Reading of POM-properties inside a Maven plugin is easy and described 
 here: 
 http://www.sonatype.com/books/mvnref-book/reference/writing-plugins-
 sect-mojo-params.html#writing-plugins-sect-param-values
 
 However, the scenario described by you clearly indicates that this is 
not 
 a unit test instead it is an integration test where other rules/plugins 
 might apply, e.g. maven-invoker-plugin. But this would recommend a 
 restructuring of your project and might not be what you want. 
 
 Bernd
 
 
 
 
 
 
 Søren Krogh Neigaard soeren.krogh.neiga...@systematic.com wrote on 
 04.02.2010 09:59:26:
 
  [image removed] 
  
  Read properties from pom.xml from Java
  
  Søren Krogh Neigaard 
  
  to:
  
  users
  
  04.02.2010 10:00
  
  Please respond to Maven Users List
  
  Hi
  
  
  
  I have been tossed into a maven controlled project. We run our junit
  tests from Eclipse and also on our build server. When ever they are 
  run, some maven magic happens so that username/password/driver/url 
  for the dabase is correctly set for the user pc or the buildserver. 
  However I need to make a small helper class for my junit tests that 
  wipes the database and loads some testdata on the database for every
  junit test.
  
  
  
  The username/password/driver/url for the database is set in the 
  pom.xml file by maven. How do I read these values from my Java helper 
 class?
  
  
  
  Best regards
  
  Søren 
  
  
  
 
 
 
 InterComponentWare AG: 
 Vorstand: Peter Kirschbauer (Vors.), Jörg Stadler / 
 Aufsichtsratsvors.: Prof. Dr. Christof Hettich 
 Firmensitz: 69190 Walldorf, Industriestraße 41 / AG Mannheim HRB 
 351761 / USt.-IdNr.: DE 198388516  =
 
 -
 To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
 For additional commands, e-mail: users-h...@maven.apache.org
 


InterComponentWare AG:  
Vorstand: Peter Kirschbauer (Vors.), Jörg Stadler / Aufsichtsratsvors.: Prof. 
Dr. Christof Hettich  
Firmensitz: 69190 Walldorf, Industriestraße 41 / AG Mannheim HRB 351761 / 
USt.-IdNr.: DE 198388516  

Re: Adding variable in eclipse project

2010-01-28 Thread bernd . adamowicz
Add the build-helper-maven-plugin to your project's POM. This may look 
something like this:

 65 plugin
 66 groupIdorg.codehaus.mojo/groupId
 67 artifactIdbuild-helper-maven-plugin/artifactId
 68 version1.1/version
 69 executions
 70 execution
 71 idadd-source/id
 72 phasegenerate-sources/phase
 73 goals
 74 goaladd-source/goal
 75 /goals
 76 configuration
 77 sources
 78 source${basedir}path/to/your/keyfile.file/source
 79 /sources
 80 /configuration
 81 /execution
 82 /executions
 83 /plugin

Have a look at the documentation of this plugin because in your case it 
might be better to use the 'add-resourc' goal than the 'add-source'.

However, before doing this you should check if it isn't a better choice to 
place your file below 'src/main/resources' which will make it 
automatically available in the classpath without any change to the POM.

Bernd





roberto.cal...@embraer.com.br wrote on 28.01.2010 13:47:32:

 [image removed] 
 
 Adding variable in eclipse project
 
 roberto.caldas 
 
 to:
 
 users
 
 28.01.2010 16:17
 
 Please respond to Maven Users List
 
 I am using the eclipse plugin to generate eclipse projects but I have 
this 
 project wtih a dependency that uses a key file located in a certain 
 directory. So everytime I create the project I must manually add this 
path 
 as a variable using the build path option on the project properties on 
 eclipse. How do I add this in the pom file?
 Thank you.
 
 Roberto
 
 This message is intended solely for the use of its addressee and may 
 contain privileged or confidential information. All information 
contained 
 herein shall be treated as confidential and shall not be disclosed to 
any 
 third party without Embraer?s prior written approval. If you are not the 

 addressee you should not distribute, copy or file this message. In this 
 case, please notify the sender and destroy its contents immediately.
 Esta mensagem é para uso exclusivo de seu destinatário e pode conter 
 informações privilegiadas e confidenciais. Todas as informações aqui 
 contidas devem ser tratadas como confidenciais e não devem ser 
divulgadas 
 a terceiros sem o prévio consentimento por escrito da Embraer. Se você 
não 
 é o destinatário não deve distribuir, copiar ou arquivar a mensagem. 
Neste 
 caso, por favor, notifique o remetente da mesma e destrua imediatamente 
a 
 mensagem.


InterComponentWare AG:  
Vorstand: Peter Kirschbauer (Vors.), Jörg Stadler / Aufsichtsratsvors.: Prof. 
Dr. Christof Hettich  
Firmensitz: 69190 Walldorf, Industriestraße 41 / AG Mannheim HRB 351761 / 
USt.-IdNr.: DE 198388516