[jira] Commented: (MECLIPSE-548) MECLIPSE-442 should be reverted. Classpath container entries should come before 3rd party jars in .classpath

2009-06-15 Thread Joe Freeman (JIRA)

[ 
http://jira.codehaus.org/browse/MECLIPSE-548?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=180352#action_180352
 ] 

Joe Freeman commented on MECLIPSE-548:
--

How many votes does this have to have before it makes a release.  Version 2.7 
just came out and it still has the same incorrect classpath ordering for the 
JDK/JRE :-(

 MECLIPSE-442 should be reverted. Classpath container entries should come 
 before 3rd party jars in .classpath
 

 Key: MECLIPSE-548
 URL: http://jira.codehaus.org/browse/MECLIPSE-548
 Project: Maven 2.x Eclipse Plugin
  Issue Type: Bug
  Components: Core : Dependencies resolution and build path 
 (.classpath)
Affects Versions: 2.6
 Environment: all
Reporter: Joe Freeman
Priority: Critical

 A patch was accepted into maven 2.6 as part of jiraMECLIPSE-442  that 
 configures eclipse to compile with a different order than the jre will load 
 with.  This patch moved the container classpaths to the end of the classpath 
 in eclipse.  This behavior is incorrect.  The JRE's jar files should come 
 before any 3rd party libraries on the classpath because those classes will be 
 loaded before any of the 3rd party jars and because the JRE's classes cannot 
 be overridden by classes in a 3rd party jar.  
 I understand why MECLIPSE-442 wanted to reverse the order so they could pick 
 up the properties files. The best way to do this was to create properties 
 files in the indvidual projects if he needed at run time or in the 
 test/resources directory if it was only needed for unit  testing. project 
 resources come before everything in eclipse
 With this patch added to maven 2.6, we have a situation where eclipse tells 
 us we have compiler error when maven command line compilations do not.  

-- 
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] Created: (MECLIPSE-548) MECLIPSE-442 should be reverted. Classpath container entries should come before 3rd party jars in .classpath

2009-04-07 Thread Joe Freeman (JIRA)
MECLIPSE-442 should be reverted. Classpath container entries should come before 
3rd party jars in .classpath


 Key: MECLIPSE-548
 URL: http://jira.codehaus.org/browse/MECLIPSE-548
 Project: Maven 2.x Eclipse Plugin
  Issue Type: Bug
  Components: Core : Dependencies resolution and build path (.classpath)
Affects Versions: 2.6
 Environment: all
Reporter: Joe Freeman
Priority: Critical


A patch was accepted into maven 2.6 as part of jira  MECLIPSE-442  that 
configures eclipse to compile with a different order than the jre will load 
with.  This patch moved the container classpaths to the end of the classpath in 
eclipse.  This behavior is incorrect.  The JRE's jar files should come before 
any 3rd party libraries on the classpath because those classes will be loaded 
before any of the 3rd party jars and because the JRE's classes cannot be 
overridden by classes in a 3rd party jar.  

I understand why MECLIPSE-442 wanted to reverse the order so they could pick up 
the properties files. The best way to do this was to create properties files in 
the indvidual projects if he needed at run time or in the test/resources 
directory if it was only needed for unit  testing. project resources come 
before everything in eclipse

With this patch added to maven 2.6, we have a situation where eclipse tells us 
we have compiler error when maven command line compilations do not.  



-- 
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: (MECLIPSE-442) Classpath container entries should come last in .classpath

2009-04-07 Thread Joe Freeman (JIRA)

[ 
http://jira.codehaus.org/browse/MECLIPSE-442?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=172322#action_172322
 ] 

Joe Freeman commented on MECLIPSE-442:
--

This patch should be pulled back out. 

http://jira.codehaus.org/browse/MECLIPSE-548


 Classpath container entries should come last in .classpath
 --

 Key: MECLIPSE-442
 URL: http://jira.codehaus.org/browse/MECLIPSE-442
 Project: Maven 2.x Eclipse Plugin
  Issue Type: Improvement
  Components: Core : Dependencies resolution and build path 
 (.classpath)
Affects Versions: 2.5.1
Reporter: Michael Johns
Assignee: Barrie Treloar
Priority: Minor
 Fix For: 2.6

 Attachments: MECLIPSE-442.patch


 It would be nice if the classpath container entries (kind=con) came last in 
 the .classpath file.  There are situations where the container I'm using 
 defines configuration that I'd like to override (commons-logging.properties, 
 for example).  If the container comes first, there's no way for me to do 
 this.  If they come last, then my configuration is found first, allowing me 
 to override the container configuration.

-- 
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] Updated: (MECLIPSE-445) myeclipse target doesn't generate spring bean files for hierarchical projects.

2008-04-30 Thread Joe Freeman (JIRA)

 [ 
http://jira.codehaus.org/browse/MECLIPSE-445?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Joe Freeman updated MECLIPSE-445:
-

Attachment: MECLIPSE-445.zip

The modified SpringBeanWriter can now find spring config files using the 
project root as the starting point for the search rather than the current 
working directory. The MyEclipse test case has been changed log each test to 
it's own file in the same way the rad and Eclipse tests do.  There is also a 
test case that shows that this works.  The eclipse-plugin testing framework 
does not recurse down to sub projects/modules when comparing results so the 
test results must be compared manually.

 myeclipse target doesn't generate spring bean files for hierarchical projects.
 --

 Key: MECLIPSE-445
 URL: http://jira.codehaus.org/browse/MECLIPSE-445
 Project: Maven 2.x Eclipse Plugin
  Issue Type: Bug
  Components: MyEclipse support
Affects Versions: 2.5.1
Reporter: Joe Freeman
Assignee: Arnaud Heritier
 Fix For: 2.5.2

 Attachments: MECLIPSE-445.zip


 The spring bean file creation code doesn't works only when the current 
 working directory is the same as the project directory.  This means it works 
 fine for single level projects.  We have an n-deep hierarchy of projects 
 where we run the eclipse:eclipse and eclipse:myeclipse targets from the top.  
 In this situation, the cwd doesn't change as it traverses the hierarchy so 
 absolute paths must be used for navigation and then trimmed when the actual 
 fiile references are put in the spring beans file.  I have a patch for this 
 but don't yet have a standalone test case.

-- 
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: (MECLIPSE-445) myeclipse target doesn't generate spring bean files for hierarchical projects.

2008-04-29 Thread Joe Freeman (JIRA)

[ 
http://jira.codehaus.org/browse/MECLIPSE-445?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=133045#action_133045
 ] 

Joe Freeman commented on MECLIPSE-445:
--

It looks like the multi-level test cases are only validating the files at the 
top level.  project-34 in the test case suite should be failing because the 
expected results in multymodule-1 do not match the generated files.  A 
.classpath is generated that is not in the expected directory and the generated 
.project file does not match the one in the expected directory. 

The test case should call compareDirectoryContent() on each sub-module.



 myeclipse target doesn't generate spring bean files for hierarchical projects.
 --

 Key: MECLIPSE-445
 URL: http://jira.codehaus.org/browse/MECLIPSE-445
 Project: Maven 2.x Eclipse Plugin
  Issue Type: Bug
  Components: MyEclipse support
Affects Versions: 2.5.1
Reporter: Joe Freeman
Assignee: Arnaud Heritier
 Fix For: 2.5.2


 The spring bean file creation code doesn't works only when the current 
 working directory is the same as the project directory.  This means it works 
 fine for single level projects.  We have an n-deep hierarchy of projects 
 where we run the eclipse:eclipse and eclipse:myeclipse targets from the top.  
 In this situation, the cwd doesn't change as it traverses the hierarchy so 
 absolute paths must be used for navigation and then trimmed when the actual 
 fiile references are put in the spring beans file.  I have a patch for this 
 but don't yet have a standalone test case.

-- 
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] Updated: (MECLIPSE-427) .springBeans definition throws NullPointer if BaseDir does not exist

2008-04-26 Thread Joe Freeman (JIRA)

 [ 
http://jira.codehaus.org/browse/MECLIPSE-427?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Joe Freeman updated MECLIPSE-427:
-

Attachment: MECLIPSE-427.patch

This is the patch to the SpringBeansWriter, test case and messages file and 
part of a test case. The whole test case will be uploaded in a zip file that 
follows.

 .springBeans definition throws NullPointer if BaseDir does not exist
 

 Key: MECLIPSE-427
 URL: http://jira.codehaus.org/browse/MECLIPSE-427
 Project: Maven 2.x Eclipse Plugin
  Issue Type: Bug
  Components: MyEclipse support
Affects Versions: 2.5, 2.5.1
Reporter: Joe Freeman
 Attachments: MECLIPSE-427.patch


 This is related to the fix submitted for MECLIPSE-359
 We have an application with 40 eclipse projects in it.  About  half of them 
 have spring beans and 1/2 don't. The top level pom describes how the eclipse 
 plugin should function and includes the Spring configuration component for 
 the myeclipse target.  A null pointer is thrown when running 
 eclipse:myeclipse when the base dir doesn't exist, in our case in one of the 
 projects that doesn't have any spring components.  Our pom.xml fragment looks 
 like
 spring
 version2.0/version
 file-pattern*.xml/file-pattern
 basedirsrc/main/resources/conf/basedir
 /spring
 The exception stack trace looks like
 java.lang.NullPointerException
 at 
 org.apache.maven.plugin.eclipse.writers.myeclipse.MyEclipseSpringBeansWriter.getConfigurationFilesList(MyEclipseSpringBeansWriter.java:142)
 at 
 org.apache.maven.plugin.eclipse.writers.myeclipse.MyEclipseSpringBeansWriter.write(MyEclipseSpringBeansWriter.java:93)
 The following code block with the problem throws NullPointer when 
 directory.listFiles() returns a null into subdirs. Wrap the for() loop in a 
 nullcheck
try
 {
 File directory = new File( basedir );
 File[] subdirs = directory.listFiles( new FileFilter()
 {
 public boolean accept( File pathname )
 {
 return pathname.isDirectory();
 }
 } );
 for ( int i = 0; i  subdirs.length; i++ )
 {
 configFiles.addAll( getConfigurationFilesList( 
 subdirs[i].getPath(), pattern ) );
 }
 configFiles.addAll( FileUtils.getFileNames( directory, pattern, 
 null, true ) );
 }
 Testing:
 Take one of the test cases and remove the directory that is pointed to by the 
 basedir attribute.

-- 
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] Updated: (MECLIPSE-427) .springBeans definition throws NullPointer if BaseDir does not exist

2008-04-26 Thread Joe Freeman (JIRA)

 [ 
http://jira.codehaus.org/browse/MECLIPSE-427?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Joe Freeman updated MECLIPSE-427:
-

Attachment: testcase-project-meclipse-MECLIPSE-427.zip

This contains the complete test case. I couldn't attach the whole test case as 
part of the patch file because the svn patch tool won't include empty files in 
the patch.  The test case includes empty placeholder files like the other 
myeclipse test cases.

 .springBeans definition throws NullPointer if BaseDir does not exist
 

 Key: MECLIPSE-427
 URL: http://jira.codehaus.org/browse/MECLIPSE-427
 Project: Maven 2.x Eclipse Plugin
  Issue Type: Bug
  Components: MyEclipse support
Affects Versions: 2.5, 2.5.1
Reporter: Joe Freeman
 Attachments: MECLIPSE-427.patch, 
 testcase-project-meclipse-MECLIPSE-427.zip


 This is related to the fix submitted for MECLIPSE-359
 We have an application with 40 eclipse projects in it.  About  half of them 
 have spring beans and 1/2 don't. The top level pom describes how the eclipse 
 plugin should function and includes the Spring configuration component for 
 the myeclipse target.  A null pointer is thrown when running 
 eclipse:myeclipse when the base dir doesn't exist, in our case in one of the 
 projects that doesn't have any spring components.  Our pom.xml fragment looks 
 like
 spring
 version2.0/version
 file-pattern*.xml/file-pattern
 basedirsrc/main/resources/conf/basedir
 /spring
 The exception stack trace looks like
 java.lang.NullPointerException
 at 
 org.apache.maven.plugin.eclipse.writers.myeclipse.MyEclipseSpringBeansWriter.getConfigurationFilesList(MyEclipseSpringBeansWriter.java:142)
 at 
 org.apache.maven.plugin.eclipse.writers.myeclipse.MyEclipseSpringBeansWriter.write(MyEclipseSpringBeansWriter.java:93)
 The following code block with the problem throws NullPointer when 
 directory.listFiles() returns a null into subdirs. Wrap the for() loop in a 
 nullcheck
try
 {
 File directory = new File( basedir );
 File[] subdirs = directory.listFiles( new FileFilter()
 {
 public boolean accept( File pathname )
 {
 return pathname.isDirectory();
 }
 } );
 for ( int i = 0; i  subdirs.length; i++ )
 {
 configFiles.addAll( getConfigurationFilesList( 
 subdirs[i].getPath(), pattern ) );
 }
 configFiles.addAll( FileUtils.getFileNames( directory, pattern, 
 null, true ) );
 }
 Testing:
 Take one of the test cases and remove the directory that is pointed to by the 
 basedir attribute.

-- 
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] Created: (MECLIPSE-445) myeclipse target doesn't generate spring bean files for hierarchical projects.

2008-04-26 Thread Joe Freeman (JIRA)
myeclipse target doesn't generate spring bean files for hierarchical projects.
--

 Key: MECLIPSE-445
 URL: http://jira.codehaus.org/browse/MECLIPSE-445
 Project: Maven 2.x Eclipse Plugin
  Issue Type: Bug
Affects Versions: 2.5.1
Reporter: Joe Freeman


The spring bean file creation code doesn't works only when the current working 
directory is the same as the project directory.  This means it works fine for 
single level projects.  We have an n-deep hierarchy of projects where we run 
the eclipse:eclipse and eclipse:myeclipse targets from the top.  In this 
situation, the cwd doesn't change as it traverses the hierarchy so absolute 
paths must be used for navigation and then trimmed when the actual fiile 
references are put in the spring beans file.  I have a patch for this but don't 
yet have a standalone test case.

-- 
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: (MECLIPSE-445) myeclipse target doesn't generate spring bean files for hierarchical projects.

2008-04-26 Thread Joe Freeman (JIRA)

[ 
http://jira.codehaus.org/browse/MECLIPSE-445?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=132767#action_132767
 ] 

Joe Freeman commented on MECLIPSE-445:
--

The component should have been set to myeclipse

 myeclipse target doesn't generate spring bean files for hierarchical projects.
 --

 Key: MECLIPSE-445
 URL: http://jira.codehaus.org/browse/MECLIPSE-445
 Project: Maven 2.x Eclipse Plugin
  Issue Type: Bug
Affects Versions: 2.5.1
Reporter: Joe Freeman

 The spring bean file creation code doesn't works only when the current 
 working directory is the same as the project directory.  This means it works 
 fine for single level projects.  We have an n-deep hierarchy of projects 
 where we run the eclipse:eclipse and eclipse:myeclipse targets from the top.  
 In this situation, the cwd doesn't change as it traverses the hierarchy so 
 absolute paths must be used for navigation and then trimmed when the actual 
 fiile references are put in the spring beans file.  I have a patch for this 
 but don't yet have a standalone test case.

-- 
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] Updated: (MECLIPSE-427) .springBeans definition throws NullPointer if BaseDir does not exist

2008-04-16 Thread Joe Freeman (JIRA)

 [ 
http://jira.codehaus.org/browse/MECLIPSE-427?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Joe Freeman updated MECLIPSE-427:
-

Attachment: MyEclipseSpringBeansWriter.java

 .springBeans definition throws NullPointer if BaseDir does not exist
 

 Key: MECLIPSE-427
 URL: http://jira.codehaus.org/browse/MECLIPSE-427
 Project: Maven 2.x Eclipse Plugin
  Issue Type: Bug
  Components: MyEclipse support
Affects Versions: 2.5, 2.5.1
Reporter: Joe Freeman
 Attachments: MyEclipseSpringBeansWriter.java, 
 MyEclipseSpringBeansWriter.java


 This is related to the fix submitted for MECLIPSE-359
 We have an application with 40 eclipse projects in it.  About  half of them 
 have spring beans and 1/2 don't. The top level pom describes how the eclipse 
 plugin should function and includes the Spring configuration component for 
 the myeclipse target.  A null pointer is thrown when running 
 eclipse:myeclipse when the base dir doesn't exist, in our case in one of the 
 projects that doesn't have any spring components.  Our pom.xml fragment looks 
 like
 spring
 version2.0/version
 file-pattern*.xml/file-pattern
 basedirsrc/main/resources/conf/basedir
 /spring
 The exception stack trace looks like
 java.lang.NullPointerException
 at 
 org.apache.maven.plugin.eclipse.writers.myeclipse.MyEclipseSpringBeansWriter.getConfigurationFilesList(MyEclipseSpringBeansWriter.java:142)
 at 
 org.apache.maven.plugin.eclipse.writers.myeclipse.MyEclipseSpringBeansWriter.write(MyEclipseSpringBeansWriter.java:93)
 The following code block with the problem throws NullPointer when 
 directory.listFiles() returns a null into subdirs. Wrap the for() loop in a 
 nullcheck
try
 {
 File directory = new File( basedir );
 File[] subdirs = directory.listFiles( new FileFilter()
 {
 public boolean accept( File pathname )
 {
 return pathname.isDirectory();
 }
 } );
 for ( int i = 0; i  subdirs.length; i++ )
 {
 configFiles.addAll( getConfigurationFilesList( 
 subdirs[i].getPath(), pattern ) );
 }
 configFiles.addAll( FileUtils.getFileNames( directory, pattern, 
 null, true ) );
 }
 Testing:
 Take one of the test cases and remove the directory that is pointed to by the 
 basedir attribute.

-- 
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] Updated: (MECLIPSE-427) .springBeans definition throws NullPointer if BaseDir does not exist

2008-04-15 Thread Joe Freeman (JIRA)

 [ 
http://jira.codehaus.org/browse/MECLIPSE-427?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Joe Freeman updated MECLIPSE-427:
-

Attachment: MyEclipseSpringBeansWriter.java

This file fixes two problems in our build.

1)  It eliminates the null pointer exception that occurs when the build path is 
pointed to a place that doesn't exist.

2)  The spring beans writer only worked if your current working directory was 
the root of the project that you were building a .springBeans file in.  It 
didn't work if you had multiple, hierarchical, projects where the current 
working directory stays at the top.  The Spring Bean Writer now works for 
project where it is sitting outside the root of any one code project.

I don't have time to create test cases at this time even though they should be 
easy.

1)  Create a project where the spring basedir for the searching for spring 
beans doesn't exist.  You will get a null pointer exception.

2)  Create two hierarchical projects where all the spring files exist in the 
lower level project.  Put the eclipse configuration with spring/spring in 
the top level pom.  Then run mvn eclipse:myeclipse.  The .springBeans file 
will be created but with no spring files listed.  Use the patch and you get a 
.springBeans file with the spring xml files listed in it.

I'm not sure if the path manipulation I did is the approved maven way of fixing 
this.  Another way to fix this would be to have maven cd down into the 
directory being investigated so that the project root is the current working 
directory.

 .springBeans definition throws NullPointer if BaseDir does not exist
 

 Key: MECLIPSE-427
 URL: http://jira.codehaus.org/browse/MECLIPSE-427
 Project: Maven 2.x Eclipse Plugin
  Issue Type: Bug
  Components: MyEclipse support
Affects Versions: 2.5, 2.5.1
Reporter: Joe Freeman
 Attachments: MyEclipseSpringBeansWriter.java


 This is related to the fix submitted for MECLIPSE-359
 We have an application with 40 eclipse projects in it.  About  half of them 
 have spring beans and 1/2 don't. The top level pom describes how the eclipse 
 plugin should function and includes the Spring configuration component for 
 the myeclipse target.  A null pointer is thrown when running 
 eclipse:myeclipse when the base dir doesn't exist, in our case in one of the 
 projects that doesn't have any spring components.  Our pom.xml fragment looks 
 like
 spring
 version2.0/version
 file-pattern*.xml/file-pattern
 basedirsrc/main/resources/conf/basedir
 /spring
 The exception stack trace looks like
 java.lang.NullPointerException
 at 
 org.apache.maven.plugin.eclipse.writers.myeclipse.MyEclipseSpringBeansWriter.getConfigurationFilesList(MyEclipseSpringBeansWriter.java:142)
 at 
 org.apache.maven.plugin.eclipse.writers.myeclipse.MyEclipseSpringBeansWriter.write(MyEclipseSpringBeansWriter.java:93)
 The following code block with the problem throws NullPointer when 
 directory.listFiles() returns a null into subdirs. Wrap the for() loop in a 
 nullcheck
try
 {
 File directory = new File( basedir );
 File[] subdirs = directory.listFiles( new FileFilter()
 {
 public boolean accept( File pathname )
 {
 return pathname.isDirectory();
 }
 } );
 for ( int i = 0; i  subdirs.length; i++ )
 {
 configFiles.addAll( getConfigurationFilesList( 
 subdirs[i].getPath(), pattern ) );
 }
 configFiles.addAll( FileUtils.getFileNames( directory, pattern, 
 null, true ) );
 }
 Testing:
 Take one of the test cases and remove the directory that is pointed to by the 
 basedir attribute.

-- 
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: (MECLIPSE-427) .springBeans definition throws NullPointer if BaseDir does not exist

2008-04-14 Thread Joe Freeman (JIRA)

[ 
http://jira.codehaus.org/browse/MECLIPSE-427?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=130726#action_130726
 ] 

Joe Freeman commented on MECLIPSE-427:
--

The spring definitions file generator should be pulled out of the myeclipse 
mojo because it doesn't have any MyEclipse dependencies.


 .springBeans definition throws NullPointer if BaseDir does not exist
 

 Key: MECLIPSE-427
 URL: http://jira.codehaus.org/browse/MECLIPSE-427
 Project: Maven 2.x Eclipse Plugin
  Issue Type: Bug
  Components: MyEclipse support
Affects Versions: 2.5, 2.5.1
Reporter: Joe Freeman

 This is related to the fix submitted for MECLIPSE-359
 We have an application with 40 eclipse projects in it.  About  half of them 
 have spring beans and 1/2 don't. The top level pom describes how the eclipse 
 plugin should function and includes the Spring configuration component for 
 the myeclipse target.  A null pointer is thrown when running 
 eclipse:myeclipse when the base dir doesn't exist, in our case in one of the 
 projects that doesn't have any spring components.  Our pom.xml fragment looks 
 like
 spring
 version2.0/version
 file-pattern*.xml/file-pattern
 basedirsrc/main/resources/conf/basedir
 /spring
 The exception stack trace looks like
 java.lang.NullPointerException
 at 
 org.apache.maven.plugin.eclipse.writers.myeclipse.MyEclipseSpringBeansWriter.getConfigurationFilesList(MyEclipseSpringBeansWriter.java:142)
 at 
 org.apache.maven.plugin.eclipse.writers.myeclipse.MyEclipseSpringBeansWriter.write(MyEclipseSpringBeansWriter.java:93)
 The following code block with the problem throws NullPointer when 
 directory.listFiles() returns a null into subdirs. Wrap the for() loop in a 
 nullcheck
try
 {
 File directory = new File( basedir );
 File[] subdirs = directory.listFiles( new FileFilter()
 {
 public boolean accept( File pathname )
 {
 return pathname.isDirectory();
 }
 } );
 for ( int i = 0; i  subdirs.length; i++ )
 {
 configFiles.addAll( getConfigurationFilesList( 
 subdirs[i].getPath(), pattern ) );
 }
 configFiles.addAll( FileUtils.getFileNames( directory, pattern, 
 null, true ) );
 }
 Testing:
 Take one of the test cases and remove the directory that is pointed to by the 
 basedir attribute.

-- 
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] Created: (MECLIPSE-427) .springBeans definition throws NullPointer if BaseDir does not exist

2008-04-09 Thread Joe Freeman (JIRA)
.springBeans definition throws NullPointer if BaseDir does not exist


 Key: MECLIPSE-427
 URL: http://jira.codehaus.org/browse/MECLIPSE-427
 Project: Maven 2.x Eclipse Plugin
  Issue Type: Bug
  Components: MyEclipse support
Affects Versions: 2.5.1, 2.5
Reporter: Joe Freeman


This is related to the fix submitted for MECLIPSE-359
We have an application with 40 eclipse projects in it.  About  half of them 
have spring beans and 1/2 don't. The top level pom describes how the eclipse 
plugin should function and includes the Spring configuration component for the 
myeclipse target.  A null pointer is thrown when running eclipse:myeclipse when 
the base dir doesn't exist, in our case in one of the projects that doesn't 
have any spring components.  Our pom.xml fragment looks like

spring
version2.0/version
file-pattern*.xml/file-pattern
basedirsrc/main/resources/conf/basedir
/spring

The exception stack trace looks like

java.lang.NullPointerException
at 
org.apache.maven.plugin.eclipse.writers.myeclipse.MyEclipseSpringBeansWriter.getConfigurationFilesList(MyEclipseSpringBeansWriter.java:142)
at 
org.apache.maven.plugin.eclipse.writers.myeclipse.MyEclipseSpringBeansWriter.write(MyEclipseSpringBeansWriter.java:93)

The following code block with the problem throws NullPointer when 
directory.listFiles() returns a null into subdirs. Wrap the for() loop in a 
nullcheck

   try
{
File directory = new File( basedir );

File[] subdirs = directory.listFiles( new FileFilter()
{
public boolean accept( File pathname )
{
return pathname.isDirectory();
}
} );

for ( int i = 0; i  subdirs.length; i++ )
{
configFiles.addAll( getConfigurationFilesList( 
subdirs[i].getPath(), pattern ) );
}

configFiles.addAll( FileUtils.getFileNames( directory, pattern, 
null, true ) );
}


Testing:

Take one of the test cases and remove the directory that is pointed to by the 
basedir attribute.




-- 
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