tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dain Sundstrom <d...@iq80.com>
Subject Re: Antwort: Re: Antwort: Re: Re: maven build of openEJB3 [Virus checked]
Date Tue, 10 Jun 2008 18:20:27 GMT
Excellent.  I applied the patch and published a new snapshot.

Let me know if you have any more problems, and thank you for the patch.

-dain

On Jun 10, 2008, at 12:44 AM, Wolfgang.Schrecker@atosorigin.com wrote:

> Here is the source with my tiny change in bold face:
> ------------------------------------------------------------------------------------------------------
> package com.envoisolutions.sxc.jaxb.maven;
>
> import java.io.File;
> import java.net.MalformedURLException;
> import java.net.URL;
> import java.net.URLClassLoader;
> import java.util.Arrays;
> import java.util.Map;
> import javax.xml.bind.JAXBException;
>
> import com.envoisolutions.sxc.jaxb.JAXBGenerator;
> import org.apache.maven.plugin.AbstractMojo;
> import org.apache.maven.plugin.MojoExecutionException;
> import org.apache.maven.project.MavenProject;
>
> /**
> * @goal generate
> * @description Generates SXC JaxB implementation
> * @phase process-classes
> * @requiresDependencyResolution runtime
> */
> public class SxcJaxbPlugin extends AbstractMojo {
>    /**
>     * @parameter expression="${project}"
>     * @required
>     */
>    private MavenProject project;
>
>    /**
>     * Directory source files will be written.
>     *
>     * @parameter expression="${project.build.directory}/sxc"
>     * @required
>     */
>    private File sourceOutputDirectory;
>
>    /**
>     * Directory class files will be written.
>     *
>     * @parameter expression="${project.build.directory}/classes"
>     * @required
>     */
>    private File classesOutputDirectory;
>
>    /**
>     * @parameter
>     * @required
>     */
>    private String[] classes;
>
>    /**
>     * @parameter
>     */
>    private Map<String,String> properties;
>
>    public void execute() throws MojoExecutionException {
>        try {
>            JAXBGenerator jaxbGenerator = new JAXBGenerator();
>
> jaxbGenerator
> .setSourceOutputDirectory(sourceOutputDirectory.getAbsolutePath());
>
> jaxbGenerator
> .setClassesOutputDirectory(classesOutputDirectory.getAbsolutePath());
>            jaxbGenerator.getClasses().addAll(Arrays.asList(classes));
>            if (properties != null) {
>                jaxbGenerator.getProperties().putAll(properties);
>            }
>
>            // need to manually create the classloader since maven  
> won't
> give me one
>            String directory = project.getBuild().getOutputDirectory();
>            ClassLoader classLoader =
> Thread.currentThread().getContextClassLoader();
>            if (classLoader == null) classLoader =
> getClass().getClassLoader();
>
>            classLoader = new URLClassLoader(new URL[] {(new
> File(directory)).toURI().toURL()}, classLoader);
>            jaxbGenerator.setClassLoader(classLoader);
>
>            jaxbGenerator.generate();
>        } catch (JAXBException e) {
>            throw new MojoExecutionException("Error generating JaxB  
> parser:
> " + e.getMessage(), e);
>        } catch (MalformedURLException e) {
>            throw new MojoExecutionException("Invalid build  
> outputDirectory
> " + project.getBuild().getOutputDirectory());
>        }
>    }
>
>    public File getSourceOutputDirectory() {
>        return sourceOutputDirectory;
>    }
>
>    public void setSourceOutputDirectory(File sourceOutputDirectory) {
>        this.sourceOutputDirectory = sourceOutputDirectory;
>    }
>
>    public File getClassesOutputDirectory() {
>        return classesOutputDirectory;
>    }
>
>    public void setClassesOutputDirectory(File  
> classesOutputDirectory) {
>        this.classesOutputDirectory = classesOutputDirectory;
>    }
>
>    public String[] getClasses() {
>        return classes;
>    }
>
>    public void setClasses(String[] classes) {
>        this.classes = classes;
>    }
>
>    public Map<String, String> getProperties() {
>        return properties;
>    }
>
>    public void setProperties(Map<String, String> properties) {
>        this.properties = properties;
>    }
> }
> ------------------------------------------------------------------------------------------------------
>
> The idea is that URI and URL are so close, but NOT identical.
> The difference is the characters allowed: toURI converts what is
> permissible in file names, to what is permissible in URL
> (e.g. converts blanks to %20..)
>
> mit freundlichen Grüßen/best regards
>
> Wolfgang Schrecker
>
> "Der Inhalt eines Begriffs nimmt ab, wenn sein Umfang zunimmt; wird  
> dieser
> allumfassend, so muß der Inhalt ganz verloren gehen."
> from G. Frege: Die Grundlagen der Arithmetik S. 40
>
>
>
> --
> --------------------------------------------------
>
> Atos Worldline Processing GmbH
> Hahnstrasse 25
> 60528 Frankfurt/Main
> Germany
> Phone: +49 69/6657-1176
> mailto:Wolfgang.Schrecker@atosorigin.com
> http://www.atosworldline.com
>
> Geschäftsführer: Erik Munk Koefoed
> Aufsichtsratsvorsitzender: Didier Dhennin
> Sitz der Gesellschaft: Frankfurt/Main
> Handelsregister: Frankfurt/Main HRB 40 417
>
>
>
>             Dain Sundstrom
>             <dain@iq80.com>
>                                                                        An
>             09.06.2008 21:43           users@openejb.apache.org
>                                                                      
> Kopie
>
>              Bitte antworten                                         
> Thema
>                    an                  Re: Antwort: Re: Re: maven  
> build
>             users@openejb.apa          of openEJB3 [Virus checked]
>                  che.org
>
>
>
>
>
>
>
>
>
> I wrote the plugin.  Do you have a stack trace (use -e or -X to
> generate)?  That will help me narrow down the problem.
>
> Thanks,
>
> -dain
>
> On Jun 9, 2008, at 6:16 AM, Wolfgang.Schrecker@atosorigin.com wrote:
>
>> That was a quick answer ! Thanks !
>>
>> I think you 're right:  it is a problem with spaces, and the solution
>> should not be complicated,
>>
>> change: (new File(directory)).toURL() to: (new
>> File(directory)).toURI().toURL()
>>
>> in the maven plugin com.envoisolutions.sxc.jabc.maven.SxJaxbPlugin
>> if you
>> have the source
>> or ask, whoever can do this.
>>
>> I have seen this many times and anyway ... toURI().toURL() is the
>> good way
>> to do this!
>>
>> Let me know, what happens, please ...
>>
>> mit freundlichen Grüßen/best regards
>>
>> Wolfgang Schrecker
>>
>> "Der Inhalt eines Begriffs nimmt ab, wenn sein Umfang zunimmt; wird
>> dieser
>> allumfassend, so muß der Inhalt ganz verloren gehen."
>> from G. Frege: Die Grundlagen der Arithmetik S. 40
>>
>>
>>
>> --
>> --------------------------------------------------
>>
>> Atos Worldline Processing GmbH
>> Hahnstrasse 25
>> 60528 Frankfurt/Main
>> Germany
>> Phone: +49 69/6657-1176
>> mailto:Wolfgang.Schrecker@atosorigin.com
>> http://www.atosworldline.com
>>
>> Geschäftsführer: Erik Munk Koefoed
>> Aufsichtsratsvorsitzender: Didier Dhennin
>> Sitz der Gesellschaft: Frankfurt/Main
>> Handelsregister: Frankfurt/Main HRB 40 417
>>
>>
>>
>>            "Mohammad Nour
>>            El-Din"
>>
>> <nour.mohammad@gm                                          An
>>            ail.com>                   users@openejb.apache.org
>>
>> Kopie
>>            09.06.2008 14:57
>>
>> Thema
>>                                       Re: Re: maven build of openEJB3
>>             Bitte antworten           [Virus checked]
>>                   an
>>            users@openejb.apa
>>                 che.org
>>
>>
>>
>>
>>
>>
>>
>> Does it work now, if not please start from a clean Maven local repo
>> and if it still not working try not to use a repo path with spaces,
>> and please tell us what you got :).
>>
>> On Mon, Jun 9, 2008 at 10:17 AM,  <Wolfgang.Schrecker@atosorigin.com>
>> wrote:
>>> Hi Mohammad Nour,
>>>
>>> I downloaded openEJB3.0 from the subversion repository
>>> and use MAVEN 2.0.8 on a Windows machine.
>>>
>>> I first suspected that it has to do with blanks in my path to the
>>> local
>>> maven repository.
>>>
>>> mit freundlichen Grüßen/best regards
>>>
>>> Wolfgang Schrecker
>>>
>>> "Der Inhalt eines Begriffs nimmt ab, wenn sein Umfang zunimmt; wird
>> dieser
>>> allumfassend, so muß der Inhalt ganz verloren gehen."
>>> from G. Frege: Die Grundlagen der Arithmetik S. 40
>>>
>>>
>>>
>>> --
>>> --------------------------------------------------
>>>
>>> Atos Worldline Processing GmbH
>>> Hahnstrasse 25
>>> 60528 Frankfurt/Main
>>> Germany
>>> Phone: +49 69/6657-1176
>>> mailto:Wolfgang.Schrecker@atosorigin.com
>>> http://www.atosworldline.com
>>>
>>> Geschäftsführer: Erik Munk Koefoed
>>> Aufsichtsratsvorsitzender: Didier Dhennin
>>> Sitz der Gesellschaft: Frankfurt/Main
>>> Handelsregister: Frankfurt/Main HRB 40 417
>>>
>>> --------------------------------------------------
>>>
>>> Atos Worldline Processing GmbH
>>> Hahnstraße 25
>>> 60528 Frankfurt/Main
>>> Germany
>>> Phone: +49 69/6657-1176
>>> Fax :
>>> mailto: Wolfgang.Schrecker@atosorigin.com
>>> http://www.atosworldline.com
>>>
>>> Geschäftsführer: Erik Munk Koefoed
>>> Aufsichtsratsvorsitzender: Didier Dhennin
>>> Sitz der Gesellschaft: Frankfurt/Main
>>> Handelsregister: Frankfurt/Main HRB 40 417
>>>
>>>
>>> * * * * * * * * L E G A L    D I S C L A I M E R * * * * * * * *
>>> This e-mail is destined for the above mentioned recipient. In case
>>> you
>>> received this e-mail by accident, we would appreciate it if you  
>>> could
>>> contact the sender and delete all copies stored on your computer.
>>> Please be aware that the security and confidentiality of electronic
>>> data
>>> transmitted by e-mail is not completely guaranteed and that data
>>> may be
>> seen,
>>> copied, downloaded or changed by third persons during transmission.
>>> Atos Origin accepts no liability for the security and
>>> confidentiality of
>>> data and documents sent by e-mail. Please make sure that all
>>> important
>>> messages will be confirmed in writing by means of a telefax or a
>>> letter.
>>> * * * * * * * * L E G A L    D I S C L A I M E R * * * * * * * *
>>>
>>
>>
>>
>> --
>> Thanks
>> - Mohammad Nour
>>
>>
>>
>> --------------------------------------------------
>>
>> Atos Worldline Processing GmbH
>> Hahnstraße 25
>> 60528 Frankfurt/Main
>> Germany
>> Phone: +49 69/6657-1176
>> Fax :
>> mailto: Wolfgang.Schrecker@atosorigin.com
>> http://www.atosworldline.com
>>
>> Geschäftsführer: Erik Munk Koefoed
>> Aufsichtsratsvorsitzender: Didier Dhennin
>> Sitz der Gesellschaft: Frankfurt/Main
>> Handelsregister: Frankfurt/Main HRB 40 417
>>
>>
>> * * * * * * * * L E G A L    D I S C L A I M E R * * * * * * * *
>> This e-mail is destined for the above mentioned recipient. In case  
>> you
>> received this e-mail by accident, we would appreciate it if you could
>> contact the sender and delete all copies stored on your computer.
>> Please be aware that the security and confidentiality of electronic
>> data
>> transmitted by e-mail is not completely guaranteed and that data may
>> be seen,
>> copied, downloaded or changed by third persons during transmission.
>> Atos Origin accepts no liability for the security and
>> confidentiality of
>> data and documents sent by e-mail. Please make sure that all  
>> important
>> messages will be confirmed in writing by means of a telefax or a
>> letter.
>> * * * * * * * * L E G A L    D I S C L A I M E R * * * * * * * *
>
>
>
>
> --------------------------------------------------
>
> Atos Worldline Processing GmbH
> Hahnstraße 25
> 60528 Frankfurt/Main
> Germany
> Phone: +49 69/6657-1176
> Fax :
> mailto: Wolfgang.Schrecker@atosorigin.com
> http://www.atosworldline.com
>
> Geschäftsführer: Erik Munk Koefoed
> Aufsichtsratsvorsitzender: Didier Dhennin
> Sitz der Gesellschaft: Frankfurt/Main
> Handelsregister: Frankfurt/Main HRB 40 417
>
>
> * * * * * * * * L E G A L    D I S C L A I M E R * * * * * * * *
> This e-mail is destined for the above mentioned recipient. In case you
> received this e-mail by accident, we would appreciate it if you could
> contact the sender and delete all copies stored on your computer.
> Please be aware that the security and confidentiality of electronic  
> data
> transmitted by e-mail is not completely guaranteed and that data may  
> be seen,
> copied, downloaded or changed by third persons during transmission.
> Atos Origin accepts no liability for the security and  
> confidentiality of
> data and documents sent by e-mail. Please make sure that all important
> messages will be confirmed in writing by means of a telefax or a  
> letter.
> * * * * * * * * L E G A L    D I S C L A I M E R * * * * * * * *


Mime
View raw message