You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-user@james.apache.org by Eric Charles <er...@apache.org> on 2010/10/08 18:59:52 UTC

MailetDocs Maven Plugin Usage

Hi,

I have defined in server-mailet pom.xml the mailetdocs plugin according to
http://james.apache.org/mailet/maven-mailetdocs-plugin/plugin-info.html

I have also added the outputDirectory configuration 
(http://james.apache.org/mailet/maven-mailetdocs-plugin/mailetdocs-mojo.html)

When i run 'mvn mailetdocs:mailetdocs', I've got some log (see after), 
but have no file generated (nor in target, nor anywhere else).

Any idea?

Tks,
Eric

(snipped)

<br />
<br />
Typically, IListServCommands will format some text to reply with based 
off of resource files
and calls to {@link org.apache.james.util.XMLResources#getString(String)}

This allows you to customize the messages sent by these commands by 
editing text files and no
  *
  * @version CVS $Revision: 883484 $ $Date: 2009-11-23 21:22:51 +0100 
(lun. 23 nov. 2009) $
  * @since 2.2.0
  * @see ICommandListservManager
  */
public interface IListServCommand {

         /**
          * The name of this command
specified by the 'name' parameter.
eg:
<pre>
&lt;command name="subscribe" class="Subscribe"/&gt;
</pre>
          *
          * @return the name of this command
          */
         public java.lang.String getCommandName();

         /**
          * Perform any required initialization
          *
          * @param configuration
          * @throws ConfigurationException
          */
         public void 
init(org.apache.james.transport.mailets.ICommandListservManager commandLi

         /**
          * Process this command to your hearts content
          *
          * @param mail
          * @throws MessagingException
          */
         public void onCommand(org.apache.mailet.Mail mail) throws 
javax.mail.MessagingExcepti

}

[INFO] Executing Mailets/Matchers Report
[INFO] 
------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] 
------------------------------------------------------------------------
[INFO] Total time: 11.485s
[INFO] Finished at: Fri Oct 08 18:55:02 CEST 2010
[INFO] Final Memory: 14M/618M
[INFO] 
------------------------------------------------------------------------

---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


Re: MailetDocs Maven Plugin Usage

Posted by Stefano Bagnara <ap...@bago.org>.
Hi Eric,

sorry but I don't understand part of this message. What's the role of
"IListServCommand" in the issue? It is an interface and mailetdocs is
about documenting mailets...
What maven version are you using?

Stefano

2010/10/8 Eric Charles <er...@apache.org>:
> Hi,
>
> I have defined in server-mailet pom.xml the mailetdocs plugin according to
> http://james.apache.org/mailet/maven-mailetdocs-plugin/plugin-info.html
>
> I have also added the outputDirectory configuration
> (http://james.apache.org/mailet/maven-mailetdocs-plugin/mailetdocs-mojo.html)
>
> When i run 'mvn mailetdocs:mailetdocs', I've got some log (see after), but
> have no file generated (nor in target, nor anywhere else).
>
> Any idea?
>
> Tks,
> Eric
>
> (snipped)
>
> <br />
> <br />
> Typically, IListServCommands will format some text to reply with based off
> of resource files
> and calls to {@link org.apache.james.util.XMLResources#getString(String)}
>
> This allows you to customize the messages sent by these commands by editing
> text files and no
>  *
>  * @version CVS $Revision: 883484 $ $Date: 2009-11-23 21:22:51 +0100 (lun.
> 23 nov. 2009) $
>  * @since 2.2.0
>  * @see ICommandListservManager
>  */
> public interface IListServCommand {
>
>        /**
>         * The name of this command
> specified by the 'name' parameter.
> eg:
> <pre>
> &lt;command name="subscribe" class="Subscribe"/&gt;
> </pre>
>         *
>         * @return the name of this command
>         */
>        public java.lang.String getCommandName();
>
>        /**
>         * Perform any required initialization
>         *
>         * @param configuration
>         * @throws ConfigurationException
>         */
>        public void
> init(org.apache.james.transport.mailets.ICommandListservManager commandLi
>
>        /**
>         * Process this command to your hearts content
>         *
>         * @param mail
>         * @throws MessagingException
>         */
>        public void onCommand(org.apache.mailet.Mail mail) throws
> javax.mail.MessagingExcepti
>
> }
>
> [INFO] Executing Mailets/Matchers Report
> [INFO]
> ------------------------------------------------------------------------
> [INFO] BUILD SUCCESS
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Total time: 11.485s
> [INFO] Finished at: Fri Oct 08 18:55:02 CEST 2010
> [INFO] Final Memory: 14M/618M
> [INFO]
> ------------------------------------------------------------------------
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
> For additional commands, e-mail: server-user-help@james.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


Re: MailetDocs Maven Plugin Usage

Posted by Stefano Bagnara <ap...@bago.org>.
Looking at mailetdocs sources it seems the error is that it uses a
classloader to load the class and it cannot find the class.

In debug you should have some:
log.debug("CPE: " + cpes.get(k));
log.debug("DEP: " + i.next());

The above logs (CPE, DEP) should log the classpath it uses. Do you
have such logs?

Another thing that come to my mind is that mailetdocs try to lookup
ancestor of each classes searching for "Mailet" or "Matcher". It
currently try to load the 2 classes using the same classloader. So you
have to make sure you have Mailet.class and Matcher.class in the
*compile* scoped jars...

Last: mailetdocs should be run after the build (it looks for compiled
mailets too).

Stefano

2010/10/9 Eric Charles <er...@apache.org>:
> Hi Stefano,
>
> I was using maven 3-beta1, but result is the same with 2.2.1 and 2.0.11.
> I have copied after the mail the beginning of the log where you have on the
> first line [ERROR] NotFound:
> org.apache.james.transport.matchers.RemoteAddrNotInNetwork
>
> So it knows there's a matcher RemoteAddrNotInNetwork class in the project
> server-mailets, that's good, but  it can't find it...
> I've defined mailetdocs plugin 1.0 in build/pluginManagement, build/plugins
> and reporting/plugins.
>
> Running with -X, does not give more info, but you can see for example
> [DEBUG] Class: org.apache.james.transport.mailets.WhiteListManager
> [ERROR] NotFound: org.apache.james.transport.mailets.WhiteListManager
> [DEBUG] Class: org.apache.james.transport.mailets.AvalonListservManager
> [ERROR] NotFound: org.apache.james.transport.mailets.AvalonListservManager
> [DEBUG] Class:
> org.apache.james.transport.mailets.AbstractRedirect$AddressMarker
> ...
>
> I also saw in the debug log (${project} is not a know maven property I
> think, but I only defined outputDirectory in the configuration)
> [DEBUG] Configuration: <?xml version="1.0" encoding="UTF-8"?>
> <configuration>
> <outputDirectory>report</outputDirectory>
> <project>${project}</project>
> </configuration>
>
> Tks,
>
> Eric
>
>
> C:\wrk\apache\james\server\mailets>mvn mailetdocs:mailetdocs
> [INFO] Scanning for projects...
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Building Apache James Server Mailets
> [INFO]    task-segment: [mailetdocs:mailetdocs]
> [INFO]
> ------------------------------------------------------------------------
> [INFO] [mailetdocs:mailetdocs {execution: default-cli}]
> [ERROR] NotFound: org.apache.james.transport.matchers.RemoteAddrNotInNetwork
> [ERROR] NotFound: org.apache.james.transport.matchers.NESSpamCheck
> [ERROR] NotFound: org.apache.james.transport.matchers.SenderInFakeDomain
> [ERROR] NotFound: org.apache.james.transport.mailets.listservcommands.Owner
> [INFO] I: /**
>  * IListServCommand is the interface that all pluggable list serv commands
> must implement.
> The lifecycle of a IListServCommand will be controlled by the {@link
> ICommandListservManager}
>
> <br />
> <br />
> Requests sent to the CommandListservManager take the form of:
> <pre>
> &lt;listName&gt;-&lt;commandName&gt;@domain
> </pre>
> and if the commandName matches the command's name, then the {@link
> #onCommand} will be invoked.
>
> <br />
> <br />
> A typical command is configured:
> <pre>
> &lt;command name="subscribe" class="Subscribe"/&gt;
> </pre>
>
> <br />
> <br />
> Typically, IListServCommands will format some text to reply with based off
> of resource files
> and calls to {@link org.apache.james.util.XMLResources#getString(String)}
>
> This allows you to customize the messages sent by these commands by editing
> text files and not editing the javacode.
>
>
>
> On 8/10/2010 19:36, Stefano Bagnara wrote:
>>
>> Hi Eric,
>>
>> sorry but I don't understand part of this message. What's the role of
>> "IListServCommand" in the issue? It is an interface and mailetdocs is
>> about documenting mailets...
>> What maven version are you using?
>>
>> Stefano
>>
>> 2010/10/8 Eric Charles<er...@apache.org>:
>>>
>>> Hi,
>>>
>>> I have defined in server-mailet pom.xml the mailetdocs plugin according
>>> to
>>> http://james.apache.org/mailet/maven-mailetdocs-plugin/plugin-info.html
>>>
>>> I have also added the outputDirectory configuration
>>>
>>> (http://james.apache.org/mailet/maven-mailetdocs-plugin/mailetdocs-mojo.html)
>>>
>>> When i run 'mvn mailetdocs:mailetdocs', I've got some log (see after),
>>> but
>>> have no file generated (nor in target, nor anywhere else).
>>>
>>> Any idea?
>>>
>>> Tks,
>>> Eric
>>>
>>> (snipped)
>>>
>>> <br />
>>> <br />
>>> Typically, IListServCommands will format some text to reply with based
>>> off
>>> of resource files
>>> and calls to {@link org.apache.james.util.XMLResources#getString(String)}
>>>
>>> This allows you to customize the messages sent by these commands by
>>> editing
>>> text files and no
>>>  *
>>>  * @version CVS $Revision: 883484 $ $Date: 2009-11-23 21:22:51 +0100
>>> (lun.
>>> 23 nov. 2009) $
>>>  * @since 2.2.0
>>>  * @see ICommandListservManager
>>>  */
>>> public interface IListServCommand {
>>>
>>>        /**
>>>         * The name of this command
>>> specified by the 'name' parameter.
>>> eg:
>>> <pre>
>>> &lt;command name="subscribe" class="Subscribe"/&gt;
>>> </pre>
>>>         *
>>>         * @return the name of this command
>>>         */
>>>        public java.lang.String getCommandName();
>>>
>>>        /**
>>>         * Perform any required initialization
>>>         *
>>>         * @param configuration
>>>         * @throws ConfigurationException
>>>         */
>>>        public void
>>> init(org.apache.james.transport.mailets.ICommandListservManager commandLi
>>>
>>>        /**
>>>         * Process this command to your hearts content
>>>         *
>>>         * @param mail
>>>         * @throws MessagingException
>>>         */
>>>        public void onCommand(org.apache.mailet.Mail mail) throws
>>> javax.mail.MessagingExcepti
>>>
>>> }
>>>
>>> [INFO] Executing Mailets/Matchers Report
>>> [INFO]
>>> ------------------------------------------------------------------------
>>> [INFO] BUILD SUCCESS
>>> [INFO]
>>> ------------------------------------------------------------------------
>>> [INFO] Total time: 11.485s
>>> [INFO] Finished at: Fri Oct 08 18:55:02 CEST 2010
>>> [INFO] Final Memory: 14M/618M
>>> [INFO]
>>> ------------------------------------------------------------------------
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
>>> For additional commands, e-mail: server-user-help@james.apache.org
>>>
>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
>> For additional commands, e-mail: server-user-help@james.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
> For additional commands, e-mail: server-user-help@james.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


Re: MailetDocs Maven Plugin Usage

Posted by Stefano Bagnara <ap...@bago.org>.
2010/10/10 Eric Charles <er...@apache.org>:
> I first compiled with mvn compile, and now it's better.
> mvn mailetdocs:mailetdocs doesn't give exception and finds the mailet
> classes.
> But it doesn't generate any file.
> I tried different values for the outputDirectory, pre-creating also the
> directory, but it didn't make it.

I tried the same thing, with the same result :-(
Unfortunately I have no time to investigate on this. This was my first
and only maven plugin and I probably did something specific to that
specific maven version / site plugin version I had and when I saw it
working I stopped working on it.
I've had a fast look at the code but I didn't find any obvious issue:
there is a lot of magic behind maven plugins...

Stefano

> It ends with
> [INFO] Executing Mailets/Matchers Report
> [INFO]
> ------------------------------------------------------------------------
> [INFO] BUILD SUCCESS
> [INFO]
> ------------------------------------------------------------------------
>
> without any exception.
> Tks,
>
> Eric
>
>
> On 9/10/2010 12:06, Stefano Bagnara wrote:
>>
>> Looking at mailetdocs sources it seems the error is that it uses a
>> classloader to load the class and it cannot find the class.
>>
>> In debug you should have some:
>> log.debug("CPE: " + cpes.get(k));
>> log.debug("DEP: " + i.next());
>>
>> The above logs (CPE, DEP) should log the classpath it uses. Do you
>> have such logs?
>>
>> Another thing that come to my mind is that mailetdocs try to lookup
>> ancestor of each classes searching for "Mailet" or "Matcher". It
>> currently try to load the 2 classes using the same classloader. So you
>> have to make sure you have Mailet.class and Matcher.class in the
>> *compile* scoped jars...
>>
>> Last: mailetdocs should be run after the build (it looks for compiled
>> mailets too).
>>
>> Stefano
>>
>> 2010/10/9 Eric Charles<er...@apache.org>:
>>>
>>> Hi Stefano,
>>>
>>> I was using maven 3-beta1, but result is the same with 2.2.1 and 2.0.11.
>>> I have copied after the mail the beginning of the log where you have on
>>> the
>>> first line [ERROR] NotFound:
>>> org.apache.james.transport.matchers.RemoteAddrNotInNetwork
>>>
>>> So it knows there's a matcher RemoteAddrNotInNetwork class in the project
>>> server-mailets, that's good, but  it can't find it...
>>> I've defined mailetdocs plugin 1.0 in build/pluginManagement,
>>> build/plugins
>>> and reporting/plugins.
>>>
>>> Running with -X, does not give more info, but you can see for example
>>> [DEBUG] Class: org.apache.james.transport.mailets.WhiteListManager
>>> [ERROR] NotFound: org.apache.james.transport.mailets.WhiteListManager
>>> [DEBUG] Class: org.apache.james.transport.mailets.AvalonListservManager
>>> [ERROR] NotFound:
>>> org.apache.james.transport.mailets.AvalonListservManager
>>> [DEBUG] Class:
>>> org.apache.james.transport.mailets.AbstractRedirect$AddressMarker
>>> ...
>>>
>>> I also saw in the debug log (${project} is not a know maven property I
>>> think, but I only defined outputDirectory in the configuration)
>>> [DEBUG] Configuration:<?xml version="1.0" encoding="UTF-8"?>
>>> <configuration>
>>> <outputDirectory>report</outputDirectory>
>>> <project>${project}</project>
>>> </configuration>
>>>
>>> Tks,
>>>
>>> Eric
>>>
>>>
>>> C:\wrk\apache\james\server\mailets>mvn mailetdocs:mailetdocs
>>> [INFO] Scanning for projects...
>>> [INFO]
>>> ------------------------------------------------------------------------
>>> [INFO] Building Apache James Server Mailets
>>> [INFO]    task-segment: [mailetdocs:mailetdocs]
>>> [INFO]
>>> ------------------------------------------------------------------------
>>> [INFO] [mailetdocs:mailetdocs {execution: default-cli}]
>>> [ERROR] NotFound:
>>> org.apache.james.transport.matchers.RemoteAddrNotInNetwork
>>> [ERROR] NotFound: org.apache.james.transport.matchers.NESSpamCheck
>>> [ERROR] NotFound: org.apache.james.transport.matchers.SenderInFakeDomain
>>> [ERROR] NotFound:
>>> org.apache.james.transport.mailets.listservcommands.Owner
>>> [INFO] I: /**
>>>  * IListServCommand is the interface that all pluggable list serv
>>> commands
>>> must implement.
>>> The lifecycle of a IListServCommand will be controlled by the {@link
>>> ICommandListservManager}
>>>
>>> <br />
>>> <br />
>>> Requests sent to the CommandListservManager take the form of:
>>> <pre>
>>> &lt;listName&gt;-&lt;commandName&gt;@domain
>>> </pre>
>>> and if the commandName matches the command's name, then the {@link
>>> #onCommand} will be invoked.
>>>
>>> <br />
>>> <br />
>>> A typical command is configured:
>>> <pre>
>>> &lt;command name="subscribe" class="Subscribe"/&gt;
>>> </pre>
>>>
>>> <br />
>>> <br />
>>> Typically, IListServCommands will format some text to reply with based
>>> off
>>> of resource files
>>> and calls to {@link org.apache.james.util.XMLResources#getString(String)}
>>>
>>> This allows you to customize the messages sent by these commands by
>>> editing
>>> text files and not editing the javacode.
>>>
>>>
>>>
>>> On 8/10/2010 19:36, Stefano Bagnara wrote:
>>>>
>>>> Hi Eric,
>>>>
>>>> sorry but I don't understand part of this message. What's the role of
>>>> "IListServCommand" in the issue? It is an interface and mailetdocs is
>>>> about documenting mailets...
>>>> What maven version are you using?
>>>>
>>>> Stefano
>>>>
>>>> 2010/10/8 Eric Charles<er...@apache.org>:
>>>>>
>>>>> Hi,
>>>>>
>>>>> I have defined in server-mailet pom.xml the mailetdocs plugin according
>>>>> to
>>>>> http://james.apache.org/mailet/maven-mailetdocs-plugin/plugin-info.html
>>>>>
>>>>> I have also added the outputDirectory configuration
>>>>>
>>>>>
>>>>> (http://james.apache.org/mailet/maven-mailetdocs-plugin/mailetdocs-mojo.html)
>>>>>
>>>>> When i run 'mvn mailetdocs:mailetdocs', I've got some log (see after),
>>>>> but
>>>>> have no file generated (nor in target, nor anywhere else).
>>>>>
>>>>> Any idea?
>>>>>
>>>>> Tks,
>>>>> Eric
>>>>>
>>>>> (snipped)
>>>>>
>>>>> <br />
>>>>> <br />
>>>>> Typically, IListServCommands will format some text to reply with based
>>>>> off
>>>>> of resource files
>>>>> and calls to {@link
>>>>> org.apache.james.util.XMLResources#getString(String)}
>>>>>
>>>>> This allows you to customize the messages sent by these commands by
>>>>> editing
>>>>> text files and no
>>>>>  *
>>>>>  * @version CVS $Revision: 883484 $ $Date: 2009-11-23 21:22:51 +0100
>>>>> (lun.
>>>>> 23 nov. 2009) $
>>>>>  * @since 2.2.0
>>>>>  * @see ICommandListservManager
>>>>>  */
>>>>> public interface IListServCommand {
>>>>>
>>>>>        /**
>>>>>         * The name of this command
>>>>> specified by the 'name' parameter.
>>>>> eg:
>>>>> <pre>
>>>>> &lt;command name="subscribe" class="Subscribe"/&gt;
>>>>> </pre>
>>>>>         *
>>>>>         * @return the name of this command
>>>>>         */
>>>>>        public java.lang.String getCommandName();
>>>>>
>>>>>        /**
>>>>>         * Perform any required initialization
>>>>>         *
>>>>>         * @param configuration
>>>>>         * @throws ConfigurationException
>>>>>         */
>>>>>        public void
>>>>> init(org.apache.james.transport.mailets.ICommandListservManager
>>>>> commandLi
>>>>>
>>>>>        /**
>>>>>         * Process this command to your hearts content
>>>>>         *
>>>>>         * @param mail
>>>>>         * @throws MessagingException
>>>>>         */
>>>>>        public void onCommand(org.apache.mailet.Mail mail) throws
>>>>> javax.mail.MessagingExcepti
>>>>>
>>>>> }
>>>>>
>>>>> [INFO] Executing Mailets/Matchers Report
>>>>> [INFO]
>>>>>
>>>>> ------------------------------------------------------------------------
>>>>> [INFO] BUILD SUCCESS
>>>>> [INFO]
>>>>>
>>>>> ------------------------------------------------------------------------
>>>>> [INFO] Total time: 11.485s
>>>>> [INFO] Finished at: Fri Oct 08 18:55:02 CEST 2010
>>>>> [INFO] Final Memory: 14M/618M
>>>>> [INFO]
>>>>>
>>>>> ------------------------------------------------------------------------
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
>>>>> For additional commands, e-mail: server-user-help@james.apache.org
>>>>>
>>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
>>>> For additional commands, e-mail: server-user-help@james.apache.org
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
>>> For additional commands, e-mail: server-user-help@james.apache.org
>>>
>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
>> For additional commands, e-mail: server-user-help@james.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
> For additional commands, e-mail: server-user-help@james.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


Re: MailetDocs Maven Plugin Usage

Posted by Eric Charles <er...@apache.org>.
Hi Stefano,
Tks for your reply.
I will try to go in the src and see what could happen.
Bye,
Eric

On 13/10/2010 00:30, Stefano Bagnara wrote:
> 2010/10/10 Eric Charles<er...@apache.org>:
>> I first compiled with mvn compile, and now it's better.
>> mvn mailetdocs:mailetdocs doesn't give exception and finds the mailet
>> classes.
>> But it doesn't generate any file.
>> I tried different values for the outputDirectory, pre-creating also the
>> directory, but it didn't make it.
> I tried the same thing, with the same result :-(
> Unfortunately I have no time to investigate on this. This was my first
> and only maven plugin and I probably did something specific to that
> specific maven version / site plugin version I had and when I saw it
> working I stopped working on it.
> I've had a fast look at the code but I didn't find any obvious issue:
> there is a lot of magic behind maven plugins...
>
> Stefano
>
>> It ends with
>> [INFO] Executing Mailets/Matchers Report
>> [INFO]
>> ------------------------------------------------------------------------
>> [INFO] BUILD SUCCESS
>> [INFO]
>> ------------------------------------------------------------------------
>>
>> without any exception.
>> Tks,
>>
>> Eric
>>
>>
>> On 9/10/2010 12:06, Stefano Bagnara wrote:
>>> Looking at mailetdocs sources it seems the error is that it uses a
>>> classloader to load the class and it cannot find the class.
>>>
>>> In debug you should have some:
>>> log.debug("CPE: " + cpes.get(k));
>>> log.debug("DEP: " + i.next());
>>>
>>> The above logs (CPE, DEP) should log the classpath it uses. Do you
>>> have such logs?
>>>
>>> Another thing that come to my mind is that mailetdocs try to lookup
>>> ancestor of each classes searching for "Mailet" or "Matcher". It
>>> currently try to load the 2 classes using the same classloader. So you
>>> have to make sure you have Mailet.class and Matcher.class in the
>>> *compile* scoped jars...
>>>
>>> Last: mailetdocs should be run after the build (it looks for compiled
>>> mailets too).
>>>
>>> Stefano
>>>
>>> 2010/10/9 Eric Charles<er...@apache.org>:
>>>> Hi Stefano,
>>>>
>>>> I was using maven 3-beta1, but result is the same with 2.2.1 and 2.0.11.
>>>> I have copied after the mail the beginning of the log where you have on
>>>> the
>>>> first line [ERROR] NotFound:
>>>> org.apache.james.transport.matchers.RemoteAddrNotInNetwork
>>>>
>>>> So it knows there's a matcher RemoteAddrNotInNetwork class in the project
>>>> server-mailets, that's good, but  it can't find it...
>>>> I've defined mailetdocs plugin 1.0 in build/pluginManagement,
>>>> build/plugins
>>>> and reporting/plugins.
>>>>
>>>> Running with -X, does not give more info, but you can see for example
>>>> [DEBUG] Class: org.apache.james.transport.mailets.WhiteListManager
>>>> [ERROR] NotFound: org.apache.james.transport.mailets.WhiteListManager
>>>> [DEBUG] Class: org.apache.james.transport.mailets.AvalonListservManager
>>>> [ERROR] NotFound:
>>>> org.apache.james.transport.mailets.AvalonListservManager
>>>> [DEBUG] Class:
>>>> org.apache.james.transport.mailets.AbstractRedirect$AddressMarker
>>>> ...
>>>>
>>>> I also saw in the debug log (${project} is not a know maven property I
>>>> think, but I only defined outputDirectory in the configuration)
>>>> [DEBUG] Configuration:<?xml version="1.0" encoding="UTF-8"?>
>>>> <configuration>
>>>> <outputDirectory>report</outputDirectory>
>>>> <project>${project}</project>
>>>> </configuration>
>>>>
>>>> Tks,
>>>>
>>>> Eric
>>>>
>>>>
>>>> C:\wrk\apache\james\server\mailets>mvn mailetdocs:mailetdocs
>>>> [INFO] Scanning for projects...
>>>> [INFO]
>>>> ------------------------------------------------------------------------
>>>> [INFO] Building Apache James Server Mailets
>>>> [INFO]    task-segment: [mailetdocs:mailetdocs]
>>>> [INFO]
>>>> ------------------------------------------------------------------------
>>>> [INFO] [mailetdocs:mailetdocs {execution: default-cli}]
>>>> [ERROR] NotFound:
>>>> org.apache.james.transport.matchers.RemoteAddrNotInNetwork
>>>> [ERROR] NotFound: org.apache.james.transport.matchers.NESSpamCheck
>>>> [ERROR] NotFound: org.apache.james.transport.matchers.SenderInFakeDomain
>>>> [ERROR] NotFound:
>>>> org.apache.james.transport.mailets.listservcommands.Owner
>>>> [INFO] I: /**
>>>>   * IListServCommand is the interface that all pluggable list serv
>>>> commands
>>>> must implement.
>>>> The lifecycle of a IListServCommand will be controlled by the {@link
>>>> ICommandListservManager}
>>>>
>>>> <br />
>>>> <br />
>>>> Requests sent to the CommandListservManager take the form of:
>>>> <pre>
>>>> &lt;listName&gt;-&lt;commandName&gt;@domain
>>>> </pre>
>>>> and if the commandName matches the command's name, then the {@link
>>>> #onCommand} will be invoked.
>>>>
>>>> <br />
>>>> <br />
>>>> A typical command is configured:
>>>> <pre>
>>>> &lt;command name="subscribe" class="Subscribe"/&gt;
>>>> </pre>
>>>>
>>>> <br />
>>>> <br />
>>>> Typically, IListServCommands will format some text to reply with based
>>>> off
>>>> of resource files
>>>> and calls to {@link org.apache.james.util.XMLResources#getString(String)}
>>>>
>>>> This allows you to customize the messages sent by these commands by
>>>> editing
>>>> text files and not editing the javacode.
>>>>
>>>>
>>>>
>>>> On 8/10/2010 19:36, Stefano Bagnara wrote:
>>>>> Hi Eric,
>>>>>
>>>>> sorry but I don't understand part of this message. What's the role of
>>>>> "IListServCommand" in the issue? It is an interface and mailetdocs is
>>>>> about documenting mailets...
>>>>> What maven version are you using?
>>>>>
>>>>> Stefano
>>>>>
>>>>> 2010/10/8 Eric Charles<er...@apache.org>:
>>>>>> Hi,
>>>>>>
>>>>>> I have defined in server-mailet pom.xml the mailetdocs plugin according
>>>>>> to
>>>>>> http://james.apache.org/mailet/maven-mailetdocs-plugin/plugin-info.html
>>>>>>
>>>>>> I have also added the outputDirectory configuration
>>>>>>
>>>>>>
>>>>>> (http://james.apache.org/mailet/maven-mailetdocs-plugin/mailetdocs-mojo.html)
>>>>>>
>>>>>> When i run 'mvn mailetdocs:mailetdocs', I've got some log (see after),
>>>>>> but
>>>>>> have no file generated (nor in target, nor anywhere else).
>>>>>>
>>>>>> Any idea?
>>>>>>
>>>>>> Tks,
>>>>>> Eric
>>>>>>
>>>>>> (snipped)
>>>>>>
>>>>>> <br />
>>>>>> <br />
>>>>>> Typically, IListServCommands will format some text to reply with based
>>>>>> off
>>>>>> of resource files
>>>>>> and calls to {@link
>>>>>> org.apache.james.util.XMLResources#getString(String)}
>>>>>>
>>>>>> This allows you to customize the messages sent by these commands by
>>>>>> editing
>>>>>> text files and no
>>>>>>   *
>>>>>>   * @version CVS $Revision: 883484 $ $Date: 2009-11-23 21:22:51 +0100
>>>>>> (lun.
>>>>>> 23 nov. 2009) $
>>>>>>   * @since 2.2.0
>>>>>>   * @see ICommandListservManager
>>>>>>   */
>>>>>> public interface IListServCommand {
>>>>>>
>>>>>>         /**
>>>>>>          * The name of this command
>>>>>> specified by the 'name' parameter.
>>>>>> eg:
>>>>>> <pre>
>>>>>> &lt;command name="subscribe" class="Subscribe"/&gt;
>>>>>> </pre>
>>>>>>          *
>>>>>>          * @return the name of this command
>>>>>>          */
>>>>>>         public java.lang.String getCommandName();
>>>>>>
>>>>>>         /**
>>>>>>          * Perform any required initialization
>>>>>>          *
>>>>>>          * @param configuration
>>>>>>          * @throws ConfigurationException
>>>>>>          */
>>>>>>         public void
>>>>>> init(org.apache.james.transport.mailets.ICommandListservManager
>>>>>> commandLi
>>>>>>
>>>>>>         /**
>>>>>>          * Process this command to your hearts content
>>>>>>          *
>>>>>>          * @param mail
>>>>>>          * @throws MessagingException
>>>>>>          */
>>>>>>         public void onCommand(org.apache.mailet.Mail mail) throws
>>>>>> javax.mail.MessagingExcepti
>>>>>>
>>>>>> }
>>>>>>
>>>>>> [INFO] Executing Mailets/Matchers Report
>>>>>> [INFO]
>>>>>>
>>>>>> ------------------------------------------------------------------------
>>>>>> [INFO] BUILD SUCCESS
>>>>>> [INFO]
>>>>>>
>>>>>> ------------------------------------------------------------------------
>>>>>> [INFO] Total time: 11.485s
>>>>>> [INFO] Finished at: Fri Oct 08 18:55:02 CEST 2010
>>>>>> [INFO] Final Memory: 14M/618M
>>>>>> [INFO]
>>>>>>
>>>>>> ------------------------------------------------------------------------
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
>>>>>> For additional commands, e-mail: server-user-help@james.apache.org
>>>>>>
>>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
>>>>> For additional commands, e-mail: server-user-help@james.apache.org
>>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
>>>> For additional commands, e-mail: server-user-help@james.apache.org
>>>>
>>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
>>> For additional commands, e-mail: server-user-help@james.apache.org
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
>> For additional commands, e-mail: server-user-help@james.apache.org
>>
>>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
> For additional commands, e-mail: server-user-help@james.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


Re: MailetDocs Maven Plugin Usage

Posted by Eric Charles <er...@apache.org>.
I first compiled with mvn compile, and now it's better.
mvn mailetdocs:mailetdocs doesn't give exception and finds the mailet 
classes.
But it doesn't generate any file.
I tried different values for the outputDirectory, pre-creating also the 
directory, but it didn't make it.

It ends with
[INFO] Executing Mailets/Matchers Report
[INFO] 
------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] 
------------------------------------------------------------------------

without any exception.
Tks,

Eric


On 9/10/2010 12:06, Stefano Bagnara wrote:
> Looking at mailetdocs sources it seems the error is that it uses a
> classloader to load the class and it cannot find the class.
>
> In debug you should have some:
> log.debug("CPE: " + cpes.get(k));
> log.debug("DEP: " + i.next());
>
> The above logs (CPE, DEP) should log the classpath it uses. Do you
> have such logs?
>
> Another thing that come to my mind is that mailetdocs try to lookup
> ancestor of each classes searching for "Mailet" or "Matcher". It
> currently try to load the 2 classes using the same classloader. So you
> have to make sure you have Mailet.class and Matcher.class in the
> *compile* scoped jars...
>
> Last: mailetdocs should be run after the build (it looks for compiled
> mailets too).
>
> Stefano
>
> 2010/10/9 Eric Charles<er...@apache.org>:
>> Hi Stefano,
>>
>> I was using maven 3-beta1, but result is the same with 2.2.1 and 2.0.11.
>> I have copied after the mail the beginning of the log where you have on the
>> first line [ERROR] NotFound:
>> org.apache.james.transport.matchers.RemoteAddrNotInNetwork
>>
>> So it knows there's a matcher RemoteAddrNotInNetwork class in the project
>> server-mailets, that's good, but  it can't find it...
>> I've defined mailetdocs plugin 1.0 in build/pluginManagement, build/plugins
>> and reporting/plugins.
>>
>> Running with -X, does not give more info, but you can see for example
>> [DEBUG] Class: org.apache.james.transport.mailets.WhiteListManager
>> [ERROR] NotFound: org.apache.james.transport.mailets.WhiteListManager
>> [DEBUG] Class: org.apache.james.transport.mailets.AvalonListservManager
>> [ERROR] NotFound: org.apache.james.transport.mailets.AvalonListservManager
>> [DEBUG] Class:
>> org.apache.james.transport.mailets.AbstractRedirect$AddressMarker
>> ...
>>
>> I also saw in the debug log (${project} is not a know maven property I
>> think, but I only defined outputDirectory in the configuration)
>> [DEBUG] Configuration:<?xml version="1.0" encoding="UTF-8"?>
>> <configuration>
>> <outputDirectory>report</outputDirectory>
>> <project>${project}</project>
>> </configuration>
>>
>> Tks,
>>
>> Eric
>>
>>
>> C:\wrk\apache\james\server\mailets>mvn mailetdocs:mailetdocs
>> [INFO] Scanning for projects...
>> [INFO]
>> ------------------------------------------------------------------------
>> [INFO] Building Apache James Server Mailets
>> [INFO]    task-segment: [mailetdocs:mailetdocs]
>> [INFO]
>> ------------------------------------------------------------------------
>> [INFO] [mailetdocs:mailetdocs {execution: default-cli}]
>> [ERROR] NotFound: org.apache.james.transport.matchers.RemoteAddrNotInNetwork
>> [ERROR] NotFound: org.apache.james.transport.matchers.NESSpamCheck
>> [ERROR] NotFound: org.apache.james.transport.matchers.SenderInFakeDomain
>> [ERROR] NotFound: org.apache.james.transport.mailets.listservcommands.Owner
>> [INFO] I: /**
>>   * IListServCommand is the interface that all pluggable list serv commands
>> must implement.
>> The lifecycle of a IListServCommand will be controlled by the {@link
>> ICommandListservManager}
>>
>> <br />
>> <br />
>> Requests sent to the CommandListservManager take the form of:
>> <pre>
>> &lt;listName&gt;-&lt;commandName&gt;@domain
>> </pre>
>> and if the commandName matches the command's name, then the {@link
>> #onCommand} will be invoked.
>>
>> <br />
>> <br />
>> A typical command is configured:
>> <pre>
>> &lt;command name="subscribe" class="Subscribe"/&gt;
>> </pre>
>>
>> <br />
>> <br />
>> Typically, IListServCommands will format some text to reply with based off
>> of resource files
>> and calls to {@link org.apache.james.util.XMLResources#getString(String)}
>>
>> This allows you to customize the messages sent by these commands by editing
>> text files and not editing the javacode.
>>
>>
>>
>> On 8/10/2010 19:36, Stefano Bagnara wrote:
>>> Hi Eric,
>>>
>>> sorry but I don't understand part of this message. What's the role of
>>> "IListServCommand" in the issue? It is an interface and mailetdocs is
>>> about documenting mailets...
>>> What maven version are you using?
>>>
>>> Stefano
>>>
>>> 2010/10/8 Eric Charles<er...@apache.org>:
>>>> Hi,
>>>>
>>>> I have defined in server-mailet pom.xml the mailetdocs plugin according
>>>> to
>>>> http://james.apache.org/mailet/maven-mailetdocs-plugin/plugin-info.html
>>>>
>>>> I have also added the outputDirectory configuration
>>>>
>>>> (http://james.apache.org/mailet/maven-mailetdocs-plugin/mailetdocs-mojo.html)
>>>>
>>>> When i run 'mvn mailetdocs:mailetdocs', I've got some log (see after),
>>>> but
>>>> have no file generated (nor in target, nor anywhere else).
>>>>
>>>> Any idea?
>>>>
>>>> Tks,
>>>> Eric
>>>>
>>>> (snipped)
>>>>
>>>> <br />
>>>> <br />
>>>> Typically, IListServCommands will format some text to reply with based
>>>> off
>>>> of resource files
>>>> and calls to {@link org.apache.james.util.XMLResources#getString(String)}
>>>>
>>>> This allows you to customize the messages sent by these commands by
>>>> editing
>>>> text files and no
>>>>   *
>>>>   * @version CVS $Revision: 883484 $ $Date: 2009-11-23 21:22:51 +0100
>>>> (lun.
>>>> 23 nov. 2009) $
>>>>   * @since 2.2.0
>>>>   * @see ICommandListservManager
>>>>   */
>>>> public interface IListServCommand {
>>>>
>>>>         /**
>>>>          * The name of this command
>>>> specified by the 'name' parameter.
>>>> eg:
>>>> <pre>
>>>> &lt;command name="subscribe" class="Subscribe"/&gt;
>>>> </pre>
>>>>          *
>>>>          * @return the name of this command
>>>>          */
>>>>         public java.lang.String getCommandName();
>>>>
>>>>         /**
>>>>          * Perform any required initialization
>>>>          *
>>>>          * @param configuration
>>>>          * @throws ConfigurationException
>>>>          */
>>>>         public void
>>>> init(org.apache.james.transport.mailets.ICommandListservManager commandLi
>>>>
>>>>         /**
>>>>          * Process this command to your hearts content
>>>>          *
>>>>          * @param mail
>>>>          * @throws MessagingException
>>>>          */
>>>>         public void onCommand(org.apache.mailet.Mail mail) throws
>>>> javax.mail.MessagingExcepti
>>>>
>>>> }
>>>>
>>>> [INFO] Executing Mailets/Matchers Report
>>>> [INFO]
>>>> ------------------------------------------------------------------------
>>>> [INFO] BUILD SUCCESS
>>>> [INFO]
>>>> ------------------------------------------------------------------------
>>>> [INFO] Total time: 11.485s
>>>> [INFO] Finished at: Fri Oct 08 18:55:02 CEST 2010
>>>> [INFO] Final Memory: 14M/618M
>>>> [INFO]
>>>> ------------------------------------------------------------------------
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
>>>> For additional commands, e-mail: server-user-help@james.apache.org
>>>>
>>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
>>> For additional commands, e-mail: server-user-help@james.apache.org
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
>> For additional commands, e-mail: server-user-help@james.apache.org
>>
>>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
> For additional commands, e-mail: server-user-help@james.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


Re: MailetDocs Maven Plugin Usage

Posted by Eric Charles <er...@apache.org>.
Hi Stefano,

I was using maven 3-beta1, but result is the same with 2.2.1 and 2.0.11.
I have copied after the mail the beginning of the log where you have on 
the first line [ERROR] NotFound: 
org.apache.james.transport.matchers.RemoteAddrNotInNetwork

So it knows there's a matcher RemoteAddrNotInNetwork class in the 
project server-mailets, that's good, but  it can't find it...
I've defined mailetdocs plugin 1.0 in build/pluginManagement, 
build/plugins and reporting/plugins.

Running with -X, does not give more info, but you can see for example
[DEBUG] Class: org.apache.james.transport.mailets.WhiteListManager
[ERROR] NotFound: org.apache.james.transport.mailets.WhiteListManager
[DEBUG] Class: org.apache.james.transport.mailets.AvalonListservManager
[ERROR] NotFound: org.apache.james.transport.mailets.AvalonListservManager
[DEBUG] Class: 
org.apache.james.transport.mailets.AbstractRedirect$AddressMarker
...

I also saw in the debug log (${project} is not a know maven property I 
think, but I only defined outputDirectory in the configuration)
[DEBUG] Configuration: <?xml version="1.0" encoding="UTF-8"?>
<configuration>
<outputDirectory>report</outputDirectory>
<project>${project}</project>
</configuration>

Tks,

Eric


C:\wrk\apache\james\server\mailets>mvn mailetdocs:mailetdocs
[INFO] Scanning for projects...
[INFO] 
------------------------------------------------------------------------
[INFO] Building Apache James Server Mailets
[INFO]    task-segment: [mailetdocs:mailetdocs]
[INFO] 
------------------------------------------------------------------------
[INFO] [mailetdocs:mailetdocs {execution: default-cli}]
[ERROR] NotFound: org.apache.james.transport.matchers.RemoteAddrNotInNetwork
[ERROR] NotFound: org.apache.james.transport.matchers.NESSpamCheck
[ERROR] NotFound: org.apache.james.transport.matchers.SenderInFakeDomain
[ERROR] NotFound: org.apache.james.transport.mailets.listservcommands.Owner
[INFO] I: /**
  * IListServCommand is the interface that all pluggable list serv 
commands must implement.
The lifecycle of a IListServCommand will be controlled by the {@link 
ICommandListservManager}

<br />
<br />
Requests sent to the CommandListservManager take the form of:
<pre>
&lt;listName&gt;-&lt;commandName&gt;@domain
</pre>
and if the commandName matches the command's name, then the {@link 
#onCommand} will be invoked.

<br />
<br />
A typical command is configured:
<pre>
&lt;command name="subscribe" class="Subscribe"/&gt;
</pre>

<br />
<br />
Typically, IListServCommands will format some text to reply with based 
off of resource files
and calls to {@link org.apache.james.util.XMLResources#getString(String)}

This allows you to customize the messages sent by these commands by 
editing text files and not editing the javacode.



On 8/10/2010 19:36, Stefano Bagnara wrote:
> Hi Eric,
>
> sorry but I don't understand part of this message. What's the role of
> "IListServCommand" in the issue? It is an interface and mailetdocs is
> about documenting mailets...
> What maven version are you using?
>
> Stefano
>
> 2010/10/8 Eric Charles<er...@apache.org>:
>> Hi,
>>
>> I have defined in server-mailet pom.xml the mailetdocs plugin according to
>> http://james.apache.org/mailet/maven-mailetdocs-plugin/plugin-info.html
>>
>> I have also added the outputDirectory configuration
>> (http://james.apache.org/mailet/maven-mailetdocs-plugin/mailetdocs-mojo.html)
>>
>> When i run 'mvn mailetdocs:mailetdocs', I've got some log (see after), but
>> have no file generated (nor in target, nor anywhere else).
>>
>> Any idea?
>>
>> Tks,
>> Eric
>>
>> (snipped)
>>
>> <br />
>> <br />
>> Typically, IListServCommands will format some text to reply with based off
>> of resource files
>> and calls to {@link org.apache.james.util.XMLResources#getString(String)}
>>
>> This allows you to customize the messages sent by these commands by editing
>> text files and no
>>   *
>>   * @version CVS $Revision: 883484 $ $Date: 2009-11-23 21:22:51 +0100 (lun.
>> 23 nov. 2009) $
>>   * @since 2.2.0
>>   * @see ICommandListservManager
>>   */
>> public interface IListServCommand {
>>
>>         /**
>>          * The name of this command
>> specified by the 'name' parameter.
>> eg:
>> <pre>
>> &lt;command name="subscribe" class="Subscribe"/&gt;
>> </pre>
>>          *
>>          * @return the name of this command
>>          */
>>         public java.lang.String getCommandName();
>>
>>         /**
>>          * Perform any required initialization
>>          *
>>          * @param configuration
>>          * @throws ConfigurationException
>>          */
>>         public void
>> init(org.apache.james.transport.mailets.ICommandListservManager commandLi
>>
>>         /**
>>          * Process this command to your hearts content
>>          *
>>          * @param mail
>>          * @throws MessagingException
>>          */
>>         public void onCommand(org.apache.mailet.Mail mail) throws
>> javax.mail.MessagingExcepti
>>
>> }
>>
>> [INFO] Executing Mailets/Matchers Report
>> [INFO]
>> ------------------------------------------------------------------------
>> [INFO] BUILD SUCCESS
>> [INFO]
>> ------------------------------------------------------------------------
>> [INFO] Total time: 11.485s
>> [INFO] Finished at: Fri Oct 08 18:55:02 CEST 2010
>> [INFO] Final Memory: 14M/618M
>> [INFO]
>> ------------------------------------------------------------------------
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
>> For additional commands, e-mail: server-user-help@james.apache.org
>>
>>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
> For additional commands, e-mail: server-user-help@james.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org