You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by lt...@apache.org on 2006/02/03 23:18:22 UTC
svn commit: r374761 -
/maven/maven-1/core/trunk/src/java/org/apache/maven/jelly/tags/maven/CopyResources.java
Author: ltheussl
Date: Fri Feb 3 14:18:21 2006
New Revision: 374761
URL: http://svn.apache.org/viewcvs?rev=374761&view=rev
Log:
PR: MAVEN-1708
NPE copying resources when no directory.
Only copy when a directory is specified.
Modified:
maven/maven-1/core/trunk/src/java/org/apache/maven/jelly/tags/maven/CopyResources.java
Modified: maven/maven-1/core/trunk/src/java/org/apache/maven/jelly/tags/maven/CopyResources.java
URL: http://svn.apache.org/viewcvs/maven/maven-1/core/trunk/src/java/org/apache/maven/jelly/tags/maven/CopyResources.java?rev=374761&r1=374760&r2=374761&view=diff
==============================================================================
--- maven/maven-1/core/trunk/src/java/org/apache/maven/jelly/tags/maven/CopyResources.java (original)
+++ maven/maven-1/core/trunk/src/java/org/apache/maven/jelly/tags/maven/CopyResources.java Fri Feb 3 14:18:21 2006
@@ -94,6 +94,10 @@
{
Resource resource = (Resource) iter.next();
String directoryName = resource.getDirectory();
+ if ( directoryName == null )
+ {
+ continue;
+ }
File directory = new File(directoryName);
if ( directory.exists() && directory.isDirectory() && directory.canRead() )
{
Re: svn commit: r374761 - /maven/maven-1/core/trunk/src/java/org/apache/maven/jelly/tags/maven/CopyResources.java
Posted by Brett Porter <br...@apache.org>.
Generated from maven-model in /maven/components/trunk
- Brett
Lukas Theussl wrote:
> Well, I tested with current trunk and it's not fixed.
>
> Btw, I can't find the source code for maven.project.Resource (which is
> in maven-model-3.0.1), where is it?
>
> -Lukas
>
>
> Brett Porter wrote:
>> Yes, it should be required - but for backwards compat with 1.0.2 it
>> needs to default to "." (which works just fine, you don't need to set it
>> to basedir).
>>
>> I really thought I fixed this... maybe in Project.java?
>>
>> Lukas Theussl wrote:
>>
>>> I wanted to ask you about that: shouldn't the <directory> element be
>>> required in the pom? It is not with the current xsd. But if you want to
>>> include resources in ${basedir}, one should at least include
>>> <directory>${basedir}</directory>.
>>>
>>> Otherwise, how can I access the basedir property from a
>>> maven.project.Resource?
>>>
>>> -Lukas
>>>
>>>
>>>
>>> Brett Porter wrote:
>>>
>>>> I think the backwards compatibile solution was to use ".", but I
>>>> thought
>>>> I already introduced that into mvaen-model.
>>>>
>>>> - Brett
>>>>
>>>> ltheussl@apache.org wrote:
>>>>
>>>>
>>>>> Author: ltheussl
>>>>> Date: Fri Feb 3 14:18:21 2006
>>>>> New Revision: 374761
>>>>>
>>>>> URL: http://svn.apache.org/viewcvs?rev=374761&view=rev
>>>>> Log:
>>>>> PR: MAVEN-1708
>>>>> NPE copying resources when no directory.
>>>>> Only copy when a directory is specified.
>>>>>
>>>>> Modified:
>>>>>
>>>>> maven/maven-1/core/trunk/src/java/org/apache/maven/jelly/tags/maven/CopyResources.java
>>>>>
>>>>>
>>>>>
>>>>> Modified:
>>>>> maven/maven-1/core/trunk/src/java/org/apache/maven/jelly/tags/maven/CopyResources.java
>>>>>
>>>>>
>>>>> URL:
>>>>> http://svn.apache.org/viewcvs/maven/maven-1/core/trunk/src/java/org/apache/maven/jelly/tags/maven/CopyResources.java?rev=374761&r1=374760&r2=374761&view=diff
>>>>>
>>>>>
>>>>> ==============================================================================
>>>>>
>>>>>
>>>>> ---
>>>>> maven/maven-1/core/trunk/src/java/org/apache/maven/jelly/tags/maven/CopyResources.java
>>>>>
>>>>> (original)
>>>>> +++
>>>>> maven/maven-1/core/trunk/src/java/org/apache/maven/jelly/tags/maven/CopyResources.java
>>>>>
>>>>> Fri Feb 3 14:18:21 2006
>>>>> @@ -94,6 +94,10 @@
>>>>> {
>>>>> Resource resource = (Resource) iter.next();
>>>>> String directoryName = resource.getDirectory();
>>>>> + if ( directoryName == null )
>>>>> + {
>>>>> + continue;
>>>>> + }
>>>>> File directory = new File(directoryName);
>>>>> if ( directory.exists() && directory.isDirectory() &&
>>>>> directory.canRead() )
>>>>> {
>>>>>
>>>>>
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>>>> For additional commands, e-mail: dev-help@maven.apache.org
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: dev-help@maven.apache.org
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>> For additional commands, e-mail: dev-help@maven.apache.org
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: svn commit: r374761 - /maven/maven-1/core/trunk/src/java/org/apache/maven/jelly/tags/maven/CopyResources.java
Posted by Lukas Theussl <lt...@apache.org>.
Well, I tested with current trunk and it's not fixed.
Btw, I can't find the source code for maven.project.Resource (which is
in maven-model-3.0.1), where is it?
-Lukas
Brett Porter wrote:
> Yes, it should be required - but for backwards compat with 1.0.2 it
> needs to default to "." (which works just fine, you don't need to set it
> to basedir).
>
> I really thought I fixed this... maybe in Project.java?
>
> Lukas Theussl wrote:
>
>>I wanted to ask you about that: shouldn't the <directory> element be
>>required in the pom? It is not with the current xsd. But if you want to
>>include resources in ${basedir}, one should at least include
>><directory>${basedir}</directory>.
>>
>>Otherwise, how can I access the basedir property from a
>>maven.project.Resource?
>>
>>-Lukas
>>
>>
>>
>>Brett Porter wrote:
>>
>>>I think the backwards compatibile solution was to use ".", but I thought
>>>I already introduced that into mvaen-model.
>>>
>>>- Brett
>>>
>>>ltheussl@apache.org wrote:
>>>
>>>
>>>>Author: ltheussl
>>>>Date: Fri Feb 3 14:18:21 2006
>>>>New Revision: 374761
>>>>
>>>>URL: http://svn.apache.org/viewcvs?rev=374761&view=rev
>>>>Log:
>>>>PR: MAVEN-1708
>>>>NPE copying resources when no directory.
>>>>Only copy when a directory is specified.
>>>>
>>>>Modified:
>>>>
>>>>maven/maven-1/core/trunk/src/java/org/apache/maven/jelly/tags/maven/CopyResources.java
>>>>
>>>>
>>>>Modified:
>>>>maven/maven-1/core/trunk/src/java/org/apache/maven/jelly/tags/maven/CopyResources.java
>>>>
>>>>URL:
>>>>http://svn.apache.org/viewcvs/maven/maven-1/core/trunk/src/java/org/apache/maven/jelly/tags/maven/CopyResources.java?rev=374761&r1=374760&r2=374761&view=diff
>>>>
>>>>==============================================================================
>>>>
>>>>---
>>>>maven/maven-1/core/trunk/src/java/org/apache/maven/jelly/tags/maven/CopyResources.java
>>>>(original)
>>>>+++
>>>>maven/maven-1/core/trunk/src/java/org/apache/maven/jelly/tags/maven/CopyResources.java
>>>>Fri Feb 3 14:18:21 2006
>>>>@@ -94,6 +94,10 @@
>>>> {
>>>> Resource resource = (Resource) iter.next();
>>>> String directoryName = resource.getDirectory();
>>>>+ if ( directoryName == null )
>>>>+ {
>>>>+ continue;
>>>>+ }
>>>> File directory = new File(directoryName);
>>>> if ( directory.exists() && directory.isDirectory() &&
>>>>directory.canRead() )
>>>> {
>>>>
>>>>
>>>
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>>>For additional commands, e-mail: dev-help@maven.apache.org
>>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>>For additional commands, e-mail: dev-help@maven.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: svn commit: r374761 - /maven/maven-1/core/trunk/src/java/org/apache/maven/jelly/tags/maven/CopyResources.java
Posted by Brett Porter <br...@apache.org>.
Yes, it should be required - but for backwards compat with 1.0.2 it
needs to default to "." (which works just fine, you don't need to set it
to basedir).
I really thought I fixed this... maybe in Project.java?
Lukas Theussl wrote:
> I wanted to ask you about that: shouldn't the <directory> element be
> required in the pom? It is not with the current xsd. But if you want to
> include resources in ${basedir}, one should at least include
> <directory>${basedir}</directory>.
>
> Otherwise, how can I access the basedir property from a
> maven.project.Resource?
>
> -Lukas
>
>
>
> Brett Porter wrote:
>> I think the backwards compatibile solution was to use ".", but I thought
>> I already introduced that into mvaen-model.
>>
>> - Brett
>>
>> ltheussl@apache.org wrote:
>>
>>> Author: ltheussl
>>> Date: Fri Feb 3 14:18:21 2006
>>> New Revision: 374761
>>>
>>> URL: http://svn.apache.org/viewcvs?rev=374761&view=rev
>>> Log:
>>> PR: MAVEN-1708
>>> NPE copying resources when no directory.
>>> Only copy when a directory is specified.
>>>
>>> Modified:
>>>
>>> maven/maven-1/core/trunk/src/java/org/apache/maven/jelly/tags/maven/CopyResources.java
>>>
>>>
>>> Modified:
>>> maven/maven-1/core/trunk/src/java/org/apache/maven/jelly/tags/maven/CopyResources.java
>>>
>>> URL:
>>> http://svn.apache.org/viewcvs/maven/maven-1/core/trunk/src/java/org/apache/maven/jelly/tags/maven/CopyResources.java?rev=374761&r1=374760&r2=374761&view=diff
>>>
>>> ==============================================================================
>>>
>>> ---
>>> maven/maven-1/core/trunk/src/java/org/apache/maven/jelly/tags/maven/CopyResources.java
>>> (original)
>>> +++
>>> maven/maven-1/core/trunk/src/java/org/apache/maven/jelly/tags/maven/CopyResources.java
>>> Fri Feb 3 14:18:21 2006
>>> @@ -94,6 +94,10 @@
>>> {
>>> Resource resource = (Resource) iter.next();
>>> String directoryName = resource.getDirectory();
>>> + if ( directoryName == null )
>>> + {
>>> + continue;
>>> + }
>>> File directory = new File(directoryName);
>>> if ( directory.exists() && directory.isDirectory() &&
>>> directory.canRead() )
>>> {
>>>
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>> For additional commands, e-mail: dev-help@maven.apache.org
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: svn commit: r374761 - /maven/maven-1/core/trunk/src/java/org/apache/maven/jelly/tags/maven/CopyResources.java
Posted by Lukas Theussl <lt...@apache.org>.
I wanted to ask you about that: shouldn't the <directory> element be
required in the pom? It is not with the current xsd. But if you want to
include resources in ${basedir}, one should at least include
<directory>${basedir}</directory>.
Otherwise, how can I access the basedir property from a
maven.project.Resource?
-Lukas
Brett Porter wrote:
> I think the backwards compatibile solution was to use ".", but I thought
> I already introduced that into mvaen-model.
>
> - Brett
>
> ltheussl@apache.org wrote:
>
>>Author: ltheussl
>>Date: Fri Feb 3 14:18:21 2006
>>New Revision: 374761
>>
>>URL: http://svn.apache.org/viewcvs?rev=374761&view=rev
>>Log:
>>PR: MAVEN-1708
>>NPE copying resources when no directory.
>>Only copy when a directory is specified.
>>
>>Modified:
>> maven/maven-1/core/trunk/src/java/org/apache/maven/jelly/tags/maven/CopyResources.java
>>
>>Modified: maven/maven-1/core/trunk/src/java/org/apache/maven/jelly/tags/maven/CopyResources.java
>>URL: http://svn.apache.org/viewcvs/maven/maven-1/core/trunk/src/java/org/apache/maven/jelly/tags/maven/CopyResources.java?rev=374761&r1=374760&r2=374761&view=diff
>>==============================================================================
>>--- maven/maven-1/core/trunk/src/java/org/apache/maven/jelly/tags/maven/CopyResources.java (original)
>>+++ maven/maven-1/core/trunk/src/java/org/apache/maven/jelly/tags/maven/CopyResources.java Fri Feb 3 14:18:21 2006
>>@@ -94,6 +94,10 @@
>> {
>> Resource resource = (Resource) iter.next();
>> String directoryName = resource.getDirectory();
>>+ if ( directoryName == null )
>>+ {
>>+ continue;
>>+ }
>> File directory = new File(directoryName);
>> if ( directory.exists() && directory.isDirectory() && directory.canRead() )
>> {
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: svn commit: r374761 - /maven/maven-1/core/trunk/src/java/org/apache/maven/jelly/tags/maven/CopyResources.java
Posted by Brett Porter <br...@apache.org>.
I think the backwards compatibile solution was to use ".", but I thought
I already introduced that into mvaen-model.
- Brett
ltheussl@apache.org wrote:
> Author: ltheussl
> Date: Fri Feb 3 14:18:21 2006
> New Revision: 374761
>
> URL: http://svn.apache.org/viewcvs?rev=374761&view=rev
> Log:
> PR: MAVEN-1708
> NPE copying resources when no directory.
> Only copy when a directory is specified.
>
> Modified:
> maven/maven-1/core/trunk/src/java/org/apache/maven/jelly/tags/maven/CopyResources.java
>
> Modified: maven/maven-1/core/trunk/src/java/org/apache/maven/jelly/tags/maven/CopyResources.java
> URL: http://svn.apache.org/viewcvs/maven/maven-1/core/trunk/src/java/org/apache/maven/jelly/tags/maven/CopyResources.java?rev=374761&r1=374760&r2=374761&view=diff
> ==============================================================================
> --- maven/maven-1/core/trunk/src/java/org/apache/maven/jelly/tags/maven/CopyResources.java (original)
> +++ maven/maven-1/core/trunk/src/java/org/apache/maven/jelly/tags/maven/CopyResources.java Fri Feb 3 14:18:21 2006
> @@ -94,6 +94,10 @@
> {
> Resource resource = (Resource) iter.next();
> String directoryName = resource.getDirectory();
> + if ( directoryName == null )
> + {
> + continue;
> + }
> File directory = new File(directoryName);
> if ( directory.exists() && directory.isDirectory() && directory.canRead() )
> {
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org