You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Rutton <Ru...@web.de> on 2009/07/22 15:44:21 UTC

Source dependency problem between ejb-jar and gwt-war

    Hello,
I ran into a difficulty with compiling and/or packaging a
gwt/remoting/ejb application for jboss. What I have is the following:
    A main project (pom)
       - a subproject "jar" (java-server code packaged into an ejb-jar)
       - a subproject "war" (gwt-generated code, packaged into a war)
       - a subproject "ear" (jboss-ear, packaging the "jar" and the
"war" subproject)

The "war"-subproject has a (source) dependency to the "jar"-subproject
as it depends partially on source (just some types) from the ejb-jar.
Its just that the gwt compiler needs a few modules from there.
That compiles fine as long as the sources from the "jar" tree are
included into the created ejb-jars. But I don't want the sources of the
modules "jar" included into the deployed ejb-jar.

What I tried to do is to use the generateClient option of the
maven-ejb-plugin to generate a client-jar with the sources (that just
serves the purpose to provide the sources for the gwt-compiler with the
"war"-subproject) and a server-jar without the sources that actually
gets deployed.

I added my try (the significant part of the pom-file of the
jar-subproject) at the bottom, but that doesn't work. The sources are
always included in both jar (client and server) independent of the
exclude directive

Does someone have an idea why my try (excluding the *.java files from
the server jar) isn't working? Or does someone know if there is a way to
introduce a "source-only" and compile-time dependency between two
subprojects? Or is there any other way to solve this?

    Regards,
    Rutton.

<build>
        <resources>
            <resource>
                <directory>src/main/java</directory>
            </resource>
            <resource>
                <directory>src/main/resources</directory>
            </resource>
        </resources>

        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.5</source>
                    <target>1.5</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-ejb-plugin</artifactId>
                <configuration>
                    <ejbVersion>3.0</ejbVersion>
                    <archive>
                        <manifest>
                            <!-- addClasspath>true</addClasspath -->

                        </manifest>
                    </archive>
                    <excludes>
                        <exclude>**/*.java</exclude>
                        <exclude>**/*.gwt.xml</exclude>
                    </excludes>
                    <generateClient>true</generateClient>
                    <clientIncludes>
                        <clientInclude>**/*.java</clientInclude>
                         <clientInclude>**/*.class</clientInclude>
                      </clientIncludes>
                    <clientExcludes>
                        <clientExclude>**/*Impl.*</clientExclude>
                    </clientExcludes>
                </configuration>
            </plugin>
        </plugins>
    </build>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Source dependency problem between ejb-jar and gwt-war

Posted by Rutton <Ru...@web.de>.
nicolas de loof wrote:

> > The plugin has a resource goal that can detect the necessary gwt source code
> > to include (based on gtw.xml module file), and avoid your jar to contain ALL
> > server-side code
> >   
>   
Hmm. All the gwt-multiproject setup examples just copy all source code
resources to the jar.
See here:
http://mojo.codehaus.org/gwt-maven-plugin/user-guide/multiproject.html
Perhaps you can tell me how to configure the gwt:resources goal to reach out to a distinct maven-ejb-project. But only snapping sources from a distinct project without explicit depdendency definition is what I would call a hack.

Actually I solved the problem myself. I configured the maven-source-plugin to generate a source-only-jar and included that via
a dependency with <classifier>sources</classifier> in the gwt-war pom.xml and the gwt-compiler is happy with that. Unfortunately, afaik, this works only if the source-jar is installed in the repository, so mvn install in the ejb subproject needs to be called.




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Source dependency problem between ejb-jar and gwt-war

Posted by nicolas de loof <ni...@gmail.com>.
The plugin has a resource goal that can detect the necessary gwt source code
to include (based on gtw.xml module file), and avoid your jar to contain ALL
server-side code

2009/7/22 Rutton <Ru...@web.de>

>    Hi,
>
> nicolas de loof wrote:
> > A gwt lib MUST include the sources and a a gwt.xml module descriptor
> > Any hack of using some java sources from another project just for
> > convenience is ... just a hack !
> >
> I am of course not just using the java sources. The generated jar-file
> *contains* the gwt.xml module descriptor *and* contains the sources. And
> the gwt-compiler is fine with getting supplied this jar and is able to
> resolve all the "inherits" dependencies to the jar defined in the
> gwt.xml main-module descriptor. But that is needed for gwt during
> compile-time only, not during runtime. Its just that I don't want to
> deploy this jar that contains the whole server code.
> So, still any suggestions to get that solved?
>
> > 2009/7/22 Rutton <Ru...@web.de>
> >
> >
> >>    Hello,
> >> I ran into a difficulty with compiling and/or packaging a
> >> gwt/remoting/ejb application for jboss. What I have is the following:
> >>    A main project (pom)
> >>       - a subproject "jar" (java-server code packaged into an ejb-jar)
> >>       - a subproject "war" (gwt-generated code, packaged into a war)
> >>       - a subproject "ear" (jboss-ear, packaging the "jar" and the
> >> "war" subproject)
> >>
> >> The "war"-subproject has a (source) dependency to the "jar"-subproject
> >> as it depends partially on source (just some types) from the ejb-jar.
> >> Its just that the gwt compiler needs a few modules from there.
> >> That compiles fine as long as the sources from the "jar" tree are
> >> included into the created ejb-jars. But I don't want the sources of the
> >> modules "jar" included into the deployed ejb-jar.
> >>
> >> What I tried to do is to use the generateClient option of the
> >> maven-ejb-plugin to generate a client-jar with the sources (that just
> >> serves the purpose to provide the sources for the gwt-compiler with the
> >> "war"-subproject) and a server-jar without the sources that actually
> >> gets deployed.
> >>
> >> I added my try (the significant part of the pom-file of the
> >> jar-subproject) at the bottom, but that doesn't work. The sources are
> >> always included in both jar (client and server) independent of the
> >> exclude directive
> >>
> >> Does someone have an idea why my try (excluding the *.java files from
> >> the server jar) isn't working? Or does someone know if there is a way to
> >> introduce a "source-only" and compile-time dependency between two
> >> subprojects? Or is there any other way to solve this?
> >>
> >>    Regards,
> >>    Rutton.
> >>
> >> <build>
> >>        <resources>
> >>            <resource>
> >>                <directory>src/main/java</directory>
> >>            </resource>
> >>            <resource>
> >>                <directory>src/main/resources</directory>
> >>            </resource>
> >>        </resources>
> >>
> >>        <plugins>
> >>            <plugin>
> >>                <groupId>org.apache.maven.plugins</groupId>
> >>                <artifactId>maven-compiler-plugin</artifactId>
> >>                <configuration>
> >>                    <source>1.5</source>
> >>                    <target>1.5</target>
> >>                </configuration>
> >>            </plugin>
> >>            <plugin>
> >>                <groupId>org.apache.maven.plugins</groupId>
> >>                <artifactId>maven-ejb-plugin</artifactId>
> >>                <configuration>
> >>                    <ejbVersion>3.0</ejbVersion>
> >>                    <archive>
> >>                        <manifest>
> >>                            <!-- addClasspath>true</addClasspath -->
> >>
> >>                        </manifest>
> >>                    </archive>
> >>                    <excludes>
> >>                        <exclude>**/*.java</exclude>
> >>                        <exclude>**/*.gwt.xml</exclude>
> >>                    </excludes>
> >>                    <generateClient>true</generateClient>
> >>                    <clientIncludes>
> >>                        <clientInclude>**/*.java</clientInclude>
> >>                         <clientInclude>**/*.class</clientInclude>
> >>                      </clientIncludes>
> >>                    <clientExcludes>
> >>                        <clientExclude>**/*Impl.*</clientExclude>
> >>                    </clientExcludes>
> >>                </configuration>
> >>            </plugin>
> >>        </plugins>
> >>    </build>
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >> For additional commands, e-mail: users-help@maven.apache.org
> >>
> >>
> >>
> >
> >
>
>

Re: Source dependency problem between ejb-jar and gwt-war

Posted by Rutton <Ru...@web.de>.
    Hi,

nicolas de loof wrote:
> A gwt lib MUST include the sources and a a gwt.xml module descriptor
> Any hack of using some java sources from another project just for
> convenience is ... just a hack !
>   
I am of course not just using the java sources. The generated jar-file
*contains* the gwt.xml module descriptor *and* contains the sources. And
the gwt-compiler is fine with getting supplied this jar and is able to
resolve all the "inherits" dependencies to the jar defined in the
gwt.xml main-module descriptor. But that is needed for gwt during
compile-time only, not during runtime. Its just that I don't want to
deploy this jar that contains the whole server code.
So, still any suggestions to get that solved?

> 2009/7/22 Rutton <Ru...@web.de>
>
>   
>>    Hello,
>> I ran into a difficulty with compiling and/or packaging a
>> gwt/remoting/ejb application for jboss. What I have is the following:
>>    A main project (pom)
>>       - a subproject "jar" (java-server code packaged into an ejb-jar)
>>       - a subproject "war" (gwt-generated code, packaged into a war)
>>       - a subproject "ear" (jboss-ear, packaging the "jar" and the
>> "war" subproject)
>>
>> The "war"-subproject has a (source) dependency to the "jar"-subproject
>> as it depends partially on source (just some types) from the ejb-jar.
>> Its just that the gwt compiler needs a few modules from there.
>> That compiles fine as long as the sources from the "jar" tree are
>> included into the created ejb-jars. But I don't want the sources of the
>> modules "jar" included into the deployed ejb-jar.
>>
>> What I tried to do is to use the generateClient option of the
>> maven-ejb-plugin to generate a client-jar with the sources (that just
>> serves the purpose to provide the sources for the gwt-compiler with the
>> "war"-subproject) and a server-jar without the sources that actually
>> gets deployed.
>>
>> I added my try (the significant part of the pom-file of the
>> jar-subproject) at the bottom, but that doesn't work. The sources are
>> always included in both jar (client and server) independent of the
>> exclude directive
>>
>> Does someone have an idea why my try (excluding the *.java files from
>> the server jar) isn't working? Or does someone know if there is a way to
>> introduce a "source-only" and compile-time dependency between two
>> subprojects? Or is there any other way to solve this?
>>
>>    Regards,
>>    Rutton.
>>
>> <build>
>>        <resources>
>>            <resource>
>>                <directory>src/main/java</directory>
>>            </resource>
>>            <resource>
>>                <directory>src/main/resources</directory>
>>            </resource>
>>        </resources>
>>
>>        <plugins>
>>            <plugin>
>>                <groupId>org.apache.maven.plugins</groupId>
>>                <artifactId>maven-compiler-plugin</artifactId>
>>                <configuration>
>>                    <source>1.5</source>
>>                    <target>1.5</target>
>>                </configuration>
>>            </plugin>
>>            <plugin>
>>                <groupId>org.apache.maven.plugins</groupId>
>>                <artifactId>maven-ejb-plugin</artifactId>
>>                <configuration>
>>                    <ejbVersion>3.0</ejbVersion>
>>                    <archive>
>>                        <manifest>
>>                            <!-- addClasspath>true</addClasspath -->
>>
>>                        </manifest>
>>                    </archive>
>>                    <excludes>
>>                        <exclude>**/*.java</exclude>
>>                        <exclude>**/*.gwt.xml</exclude>
>>                    </excludes>
>>                    <generateClient>true</generateClient>
>>                    <clientIncludes>
>>                        <clientInclude>**/*.java</clientInclude>
>>                         <clientInclude>**/*.class</clientInclude>
>>                      </clientIncludes>
>>                    <clientExcludes>
>>                        <clientExclude>**/*Impl.*</clientExclude>
>>                    </clientExcludes>
>>                </configuration>
>>            </plugin>
>>        </plugins>
>>    </build>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>>     
>
>   


Re: Source dependency problem between ejb-jar and gwt-war

Posted by nicolas de loof <ni...@gmail.com>.
A gwt lib MUST include the sources and a a gwt.xml module descriptor
Any hack of using some java sources from another project just for
convenience is ... just a hack !


2009/7/22 Rutton <Ru...@web.de>

>    Hello,
> I ran into a difficulty with compiling and/or packaging a
> gwt/remoting/ejb application for jboss. What I have is the following:
>    A main project (pom)
>       - a subproject "jar" (java-server code packaged into an ejb-jar)
>       - a subproject "war" (gwt-generated code, packaged into a war)
>       - a subproject "ear" (jboss-ear, packaging the "jar" and the
> "war" subproject)
>
> The "war"-subproject has a (source) dependency to the "jar"-subproject
> as it depends partially on source (just some types) from the ejb-jar.
> Its just that the gwt compiler needs a few modules from there.
> That compiles fine as long as the sources from the "jar" tree are
> included into the created ejb-jars. But I don't want the sources of the
> modules "jar" included into the deployed ejb-jar.
>
> What I tried to do is to use the generateClient option of the
> maven-ejb-plugin to generate a client-jar with the sources (that just
> serves the purpose to provide the sources for the gwt-compiler with the
> "war"-subproject) and a server-jar without the sources that actually
> gets deployed.
>
> I added my try (the significant part of the pom-file of the
> jar-subproject) at the bottom, but that doesn't work. The sources are
> always included in both jar (client and server) independent of the
> exclude directive
>
> Does someone have an idea why my try (excluding the *.java files from
> the server jar) isn't working? Or does someone know if there is a way to
> introduce a "source-only" and compile-time dependency between two
> subprojects? Or is there any other way to solve this?
>
>    Regards,
>    Rutton.
>
> <build>
>        <resources>
>            <resource>
>                <directory>src/main/java</directory>
>            </resource>
>            <resource>
>                <directory>src/main/resources</directory>
>            </resource>
>        </resources>
>
>        <plugins>
>            <plugin>
>                <groupId>org.apache.maven.plugins</groupId>
>                <artifactId>maven-compiler-plugin</artifactId>
>                <configuration>
>                    <source>1.5</source>
>                    <target>1.5</target>
>                </configuration>
>            </plugin>
>            <plugin>
>                <groupId>org.apache.maven.plugins</groupId>
>                <artifactId>maven-ejb-plugin</artifactId>
>                <configuration>
>                    <ejbVersion>3.0</ejbVersion>
>                    <archive>
>                        <manifest>
>                            <!-- addClasspath>true</addClasspath -->
>
>                        </manifest>
>                    </archive>
>                    <excludes>
>                        <exclude>**/*.java</exclude>
>                        <exclude>**/*.gwt.xml</exclude>
>                    </excludes>
>                    <generateClient>true</generateClient>
>                    <clientIncludes>
>                        <clientInclude>**/*.java</clientInclude>
>                         <clientInclude>**/*.class</clientInclude>
>                      </clientIncludes>
>                    <clientExcludes>
>                        <clientExclude>**/*Impl.*</clientExclude>
>                    </clientExcludes>
>                </configuration>
>            </plugin>
>        </plugins>
>    </build>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>