[jira] Commented: (MNG-2722) Create a strategy for providing sane default values in the MavenExecutionRequest

2007-02-19 Thread Aaron Digulla (JIRA)

[ 
http://jira.codehaus.org/browse/MNG-2722?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_87920
 ] 

Aaron Digulla commented on MNG-2722:


This seems to be fixed with the latest embedder sources (2.1.0.20070213-1647)

 Create a strategy for providing sane default values in the 
 MavenExecutionRequest
 

 Key: MNG-2722
 URL: http://jira.codehaus.org/browse/MNG-2722
 Project: Maven 2
  Issue Type: Task
  Components: Embedding
Reporter: Jason van Zyl
 Attachments: embedder-start-twice.patch


 Ideally an Embedder user should be able to do something like:
 MavenEmbedder embedder = new MavenEmbedder();
 MavenExecutionRequestion request = new DefaultMavenExecutionRequestion()
   .setBasedir( directory )
   .setGoals( Arrays.asList( new String[]{ package } ) );
 embedder.execute( request );
 And this should work.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira




[jira] Commented: (MNG-2722) Create a strategy for providing sane default values in the MavenExecutionRequest

2007-02-19 Thread Aaron Digulla (JIRA)

[ 
http://jira.codehaus.org/browse/MNG-2722?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_87921
 ] 

Aaron Digulla commented on MNG-2722:


Sorry, wrong issue. The path to the local repository is still not used when it 
is defined in the global settings. But a lot of other ClassWorld issues have 
been resolved with the latest embedder version.

 Create a strategy for providing sane default values in the 
 MavenExecutionRequest
 

 Key: MNG-2722
 URL: http://jira.codehaus.org/browse/MNG-2722
 Project: Maven 2
  Issue Type: Task
  Components: Embedding
Reporter: Jason van Zyl
 Attachments: embedder-start-twice.patch


 Ideally an Embedder user should be able to do something like:
 MavenEmbedder embedder = new MavenEmbedder();
 MavenExecutionRequestion request = new DefaultMavenExecutionRequestion()
   .setBasedir( directory )
   .setGoals( Arrays.asList( new String[]{ package } ) );
 embedder.execute( request );
 And this should work.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira




[jira] Commented: (MNG-2722) Create a strategy for providing sane default values in the MavenExecutionRequest

2007-01-26 Thread Aaron Digulla (JIRA)

[ 
http://jira.codehaus.org/browse/MNG-2722?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_86050
 ] 

Aaron Digulla commented on MNG-2722:


I've added a hack with the defaulsPopulator() to make localRepository work in 
MavenEmbedder:

 request = defaultsPopulator.populateDefaults( request );
+   request.setLocalRepository(getLocalRepository());
+   request.setLocalRepositoryPath(getLocalRepository().getBasedir());

This doesn't fix the NPE, though. After some more debugging, I've found this in 
the output after starting the embedder a second time:

[org.apache.maven:maven-plugin-tools-api:jar:2.0:runtime]
[ maven embedder DEBUG] Realm already exists for: 
org.apache.maven.plugins:maven-help-plugin. Skipping addition...

I guess this means that the embedder still has same garbage left from the last 
run so it won't load the plugin again even though it's now a different plugin 
(or, as in the test, the same plugin but from a different localRepository).

I see two solutions: Clean up the class realms when the embedder is started a 
second time (does that clear up static final variables?) or forbid to start it 
twice (as my patch does).

Just to prove my point, I've added a hack to start(MavenEmbedRequest):

classWorld = new ClassWorld( plexus.core, classLoader );

With this code, it's possible to start the embedder twice but then, you either 
have to remove the constructors which pass in a ClassWorld or you must patch 
ClassWorld to support some kind of reset() method to clean up an existing 
realm.

 Create a strategy for providing sane default values in the 
 MavenExecutionRequest
 

 Key: MNG-2722
 URL: http://jira.codehaus.org/browse/MNG-2722
 Project: Maven 2
  Issue Type: Task
  Components: Embedding
Reporter: Jason van Zyl
 Attachments: embedder-start-twice.patch


 Ideally an Embedder user should be able to do something like:
 MavenEmbedder embedder = new MavenEmbedder();
 MavenExecutionRequestion request = new DefaultMavenExecutionRequestion()
   .setBasedir( directory )
   .setGoals( Arrays.asList( new String[]{ package } ) );
 embedder.execute( request );
 And this should work.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira




[jira] Commented: (MNG-2722) Create a strategy for providing sane default values in the MavenExecutionRequest

2007-01-25 Thread Aaron Digulla (JIRA)

[ 
http://jira.codehaus.org/browse/MNG-2722?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_85989
 ] 

Aaron Digulla commented on MNG-2722:


After some more tests, my patch doesn't seem the fix the localRepository 
problem.

localRepository  is only read when it is specified in ~/.m2/settings.xml. If it 
is specified in the file specified with setGlobalSettingsFile(), it's ignored.

It also doesn't fix the issue MNGECLIPSE-231 as I had hoped :-(

All I can say is that defaultsPopulator doesn't fill in the correct local 
repository when it is called in MavenEmbedder.

 Create a strategy for providing sane default values in the 
 MavenExecutionRequest
 

 Key: MNG-2722
 URL: http://jira.codehaus.org/browse/MNG-2722
 Project: Maven 2
  Issue Type: Task
  Components: Embedding
Reporter: Jason van Zyl
 Attachments: embedder-start-twice.patch


 Ideally an Embedder user should be able to do something like:
 MavenEmbedder embedder = new MavenEmbedder();
 MavenExecutionRequestion request = new DefaultMavenExecutionRequestion()
   .setBasedir( directory )
   .setGoals( Arrays.asList( new String[]{ package } ) );
 embedder.execute( request );
 And this should work.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira