Home » Language IDEs » ServerTools (WTP) » How to consume JSPs, css, images from different module?
How to consume JSPs, css, images from different module? [message #143236] |
Wed, 12 October 2005 09:20  |
Eclipse User |
|
|
|
Hello all,
I have got two eclipse projects, both with JSPs, css and image files and
java-classes. Project B needs Project A, so I need in my .deployables
folder of Project B the java-classes AND the non java files from Project A.
The java-classes are not the problem because I can consume them as a
dependent-module.
But how can I consume all the non java stuff?
Maybe there is any possibilty to call an antscript from the .wtpmodules?
Thanks,
Marc
|
|
|
Re: How to consume JSPs, css, images from different module? [message #143424 is a reply to message #143236] |
Thu, 13 October 2005 08:01   |
Eclipse User |
|
|
|
This is a multi-part message in MIME format.
--------------050007070706020804060209
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit
Hi Marc,
We solved this problem on www.likemynds.com, as our site admin is a
project derived from the main site. [It would be much nicer to have WTP
projects derived from other WTP projects though, and for the WTP builder
to deal with the merging :O)]
What we have is two WTP dynamic web projects, the admin project (that
gets built to {adminModuleName}.war being dependend on our main site
project (that gets built to ROOT.war).
The way to get the Ant script working is to tie it in as a builder for
the Eclipse project (which you can do on any project, even non-Java
ones), and to set it's dependency and resources to refresh to the files
it depends on and modifies.
Attached are some files that'll give you a flavour of how we have gone
about it. The key thing is that our admin project merges files from our
ROOT project into its' .deployables directory.
NOTE: the WebsiteAdmin build.xml [builder].launch file should be saved
in the .externalToolBuilders directory.
All the best,
Neale
----------------------------------------
www.likemynds.com - What's on your Mynd?
Marc Baumgartner wrote:
> Hello all,
>
> I have got two eclipse projects, both with JSPs, css and image files and
> java-classes. Project B needs Project A, so I need in my .deployables
> folder of Project B the java-classes AND the non java files from Project A.
>
> The java-classes are not the problem because I can consume them as a
> dependent-module.
> But how can I consume all the non java stuff?
>
> Maybe there is any possibilty to call an antscript from the .wtpmodules?
>
> Thanks,
> Marc
>
--------------050007070706020804060209
Content-Type: text/xml;
name="build-user.xml"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="build-user.xml"
<target name="help">
<echo message="Please run: $ ant -v -projecthelp"/>
</target>
--------------050007070706020804060209
Content-Type: text/xml;
name=".project"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename=".project"
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>WebsiteAdmin</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name> org.eclipse.wst.common.modulecore.ComponentStructuralBuilder </name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.wst.validation.validationbuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name> org.eclipse.wst.common.modulecore.ComponentStructuralBuilder DependencyResolver </name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.ui.externaltools.ExternalToolBuilder</name >
<triggers>auto,full,incremental,</triggers>
<arguments>
<dictionary>
<key>LaunchConfigHandle</key>
<value><project>/.externalToolBuilders/WebsiteAdmin build.xml [Builder].launch</value>
</dictionary>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature >
</natures>
</projectDescription>
--------------050007070706020804060209
Content-Type: text/xml;
name=".wtpmodules"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename=".wtpmodules"
<?xml version="1.0" encoding="UTF-8"?>
<project-modules id="moduleCoreId">
<wb-module deploy-name="WebsiteAdmin">
<module-type module-type-id="jst.web">
<version>2.4</version>
<property name="context-root" value="SomeAdminModuleName" />
<property name="java-output-path" value="/bin/WebsiteAdmin/" />
</module-type>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src" />
<wb-resource deploy-path="/" source-path="/web" />
</wb-module>
</project-modules>
--------------050007070706020804060209
Content-Type: text/xml;
name="build.xml"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="build.xml"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE project [<!ENTITY buildfile SYSTEM "file:./build-user.xml">]>
<!-- WARNING: Eclipse autogenerated file.
Any modifications will be overwritten.
Please edit build-user.xml instead.
-->
<project basedir="." default="all" name="WebsiteAdmin">
&buildfile;
<property name="lib.location" value="C:/dev/workspace/lib" />
<property name="site.location" value="../site"/>
<target name="all" depends="wars,importFromSite,importdeployjars">
</target>
<!-- Import site as a baseline for admin.
All but web.xml and springapp-servlet.xml can be exported, as
there are otherwise no name clashes.
Compiled site classes are placed in admin's lib folder.
-->
<target name="importFromSite">
<copy todir=".deployables/${ant.project.name}/WEB-INF">
<fileset dir="${site.location}/site/WEB-INF"
excludes="springapp-servlet.xml,web.xml" />
</copy>
<copy todir=".deployables/${ant.project.name}/css">
<fileset dir="${site.location}/site/css"/>
</copy>
<copy todir=".deployables/${ant.project.name}/images">
<fileset dir="${site.location}/site/images"/>
</copy>
<jar destfile=" .deployables/${ant.project.name}/WEB-INF/lib/site_classes.ja r ">
<fileset dir="${site.location}/.deployables/site/WEB-INF/classes"/>
</jar>
</target>
<!-- Import debug jars into web app -->
<target name="importdebugjars">
<copy todir=".deployables/${ant.project.name}/WEB-INF/lib">
<fileset id="debugjars"
dir="${lib.location}/debug"
excludes="some.jar" />
</copy>
</target>
<!-- Import deploy jars into web app: THIS to be used for live deployment -->
<target name="importdeployjars">
<copy todir=".deployables/${ant.project.name}/WEB-INF/lib">
<fileset id="deployjars"
dir="${lib.location}/unsecure"
excludes="some.jar" />
</copy>
</target>
<!-- Beware: Above projects might import the debug jars which include source code -->
<target name="wars" depends="importdeployjars, importFromSite">
<zip
basedir=".deployables/${ant.project.name}"
destfile="../lib/admin.war"/>
</target>
</project>
--------------050007070706020804060209
Content-Type: text/xml;
name="WebsiteAdmin build.xml [Builder].launch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="WebsiteAdmin build.xml [Builder].launch"
<?xml version="1.0" encoding="UTF-8"?>
<launchConfiguration type="org.eclipse.ant.AntBuilderLaunchConfigurationType">
<stringAttribute key="process_factory_id" value="org.eclipse.ant.ui.remoteAntProcessFactory"/>
<booleanAttribute key="org.eclipse.debug.ui.ATTR_LAUNCH_IN_BACKGROUND" value="true"/>
<booleanAttribute key="org.eclipse.ant.ui.DEFAULT_VM_INSTALL" value="true"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.ant.internal.ui.antsupport.InternalAntRunner "/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_RUN_BUILD_KINDS" value="full,incremental,auto,"/>
<booleanAttribute key="org.eclipse.ant.ui.ATTR_TARGETS_UPDATED" value="true"/>
<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/>
<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED" value="true"/>
<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.ant.ui.AntClasspathProvider"/>
<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.ant.ui.AntClasspathProvider"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_BUILD_SCOPE" value="${working_set:<?xml version="1.0" encoding="UTF-8"?> 
 ;<launchConfigurationWorkingSet editPageId="org.eclipse.ui.resourceWorkingSetPage&a mp;quot; factoryID="org.eclipse.ui.internal.WorkingSetFactor y" name="workingSet"> 
 ;<item factoryID="org.eclipse.ui.internal.model.ResourceFa ctory" path="/WebsiteAdmin/.deployables" type="2"/> < ;item factoryID="org.eclipse.ui.internal.model.ResourceFa ctory" path="/WebsiteAdmin/build-user.xml" type="1"/> < ;item factoryID="org.eclipse.ui.internal.model.ResourceFa ctory" path="/WebsiteAdmin/build.xml" type="1"/> < ;/launchConfigurationWorkingSet>} "/>
<stringAttribute key="org.eclipse.jdt.launching.VM_INSTALL_TYPE_ID" value="org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType "/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="WebsiteAdmin"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_INSTALL_NAME" value="jdk1.5"/>
<stringAttribute key="org.eclipse.debug.core.ATTR_REFRESH_SCOPE" value="${working_set:<?xml version="1.0" encoding="UTF-8"?> 
 ;<launchConfigurationWorkingSet editPageId="org.eclipse.ui.resourceWorkingSetPage&a mp;quot; factoryID="org.eclipse.ui.internal.WorkingSetFactor y" name="working set"> <item factoryID="org.eclipse.ui.internal.model.ResourceFa ctory" path="/lib" type="4"/> < ;/launchConfigurationWorkingSet>} "/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${workspace_loc:/WebsiteAdmin/build.xml}"/>
<booleanAttribute key="org.eclipse.debug.core.ATTR_REFRESH_RECURSIVE" value="false"/>
</launchConfiguration>
--------------050007070706020804060209--
|
|
|
This approach is broken after 1.0M8 [message #144228 is a reply to message #143424] |
Mon, 17 October 2005 15:20  |
Eclipse User |
|
|
|
Originally posted by: neale.likemynds.com
Hi,
Just so this thread isn't painfully misleading.
After the 1.0M8 release, the approach I outlined above doesn't work.
Tim DeBoer seems to be the man to answer the question as to what to do
now, see my post from from earlier today for details.
Cheers,
Neale
Neale wrote:
> Hi Marc,
>
> We solved this problem on www.likemynds.com, as our site admin is a
> project derived from the main site. [It would be much nicer to have WTP
> projects derived from other WTP projects though, and for the WTP builder
> to deal with the merging :O)]
>
> What we have is two WTP dynamic web projects, the admin project (that
> gets built to {adminModuleName}.war being dependend on our main site
> project (that gets built to ROOT.war).
>
> The way to get the Ant script working is to tie it in as a builder for
> the Eclipse project (which you can do on any project, even non-Java
> ones), and to set it's dependency and resources to refresh to the files
> it depends on and modifies.
>
> Attached are some files that'll give you a flavour of how we have gone
> about it. The key thing is that our admin project merges files from our
> ROOT project into its' .deployables directory.
>
> NOTE: the WebsiteAdmin build.xml [builder].launch file should be saved
> in the .externalToolBuilders directory.
>
> All the best,
>
> Neale
> ----------------------------------------
> www.likemynds.com - What's on your Mynd?
>
>
> Marc Baumgartner wrote:
>
>> Hello all,
>>
>> I have got two eclipse projects, both with JSPs, css and image files
>> and java-classes. Project B needs Project A, so I need in my
>> .deployables folder of Project B the java-classes AND the non java
>> files from Project A.
>>
>> The java-classes are not the problem because I can consume them as a
>> dependent-module.
>> But how can I consume all the non java stuff?
>>
>> Maybe there is any possibilty to call an antscript from the .wtpmodules?
>>
>> Thanks,
>> Marc
>>
>
> ------------------------------------------------------------ ------------
>
> <target name="help">
> <echo message="Please run: $ ant -v -projecthelp"/>
> </target>
>
>
>
> ------------------------------------------------------------ ------------
>
> <?xml version="1.0" encoding="UTF-8"?>
> <projectDescription>
> <name>WebsiteAdmin</name>
> <comment></comment>
> <projects>
> </projects>
> <buildSpec>
> <buildCommand>
> <name> org.eclipse.wst.common.modulecore.ComponentStructuralBuilder </name>
> <arguments>
> </arguments>
> </buildCommand>
> <buildCommand>
> <name>org.eclipse.jdt.core.javabuilder</name>
> <arguments>
> </arguments>
> </buildCommand>
> <buildCommand>
> <name>org.eclipse.wst.validation.validationbuilder</name>
> <arguments>
> </arguments>
> </buildCommand>
> <buildCommand>
> <name> org.eclipse.wst.common.modulecore.ComponentStructuralBuilder DependencyResolver </name>
> <arguments>
> </arguments>
> </buildCommand>
> <buildCommand>
> <name>org.eclipse.ui.externaltools.ExternalToolBuilder</name >
> <triggers>auto,full,incremental,</triggers>
> <arguments>
> <dictionary>
> <key>LaunchConfigHandle</key>
> <value><project>/.externalToolBuilders/WebsiteAdmin build.xml [Builder].launch</value>
> </dictionary>
> </arguments>
> </buildCommand>
> </buildSpec>
> <natures>
> <nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
> <nature>org.eclipse.jdt.core.javanature</nature>
> <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature >
> </natures>
> </projectDescription>
>
>
> ------------------------------------------------------------ ------------
>
> <?xml version="1.0" encoding="UTF-8"?>
> <project-modules id="moduleCoreId">
>
>
> <wb-module deploy-name="WebsiteAdmin">
>
> <module-type module-type-id="jst.web">
> <version>2.4</version>
> <property name="context-root" value="SomeAdminModuleName" />
> <property name="java-output-path" value="/bin/WebsiteAdmin/" />
> </module-type>
>
> <wb-resource deploy-path="/WEB-INF/classes" source-path="/src" />
> <wb-resource deploy-path="/" source-path="/web" />
>
> </wb-module>
>
> </project-modules>
>
>
> ------------------------------------------------------------ ------------
>
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE project [<!ENTITY buildfile SYSTEM "file:./build-user.xml">]>
> <!-- WARNING: Eclipse autogenerated file.
> Any modifications will be overwritten.
> Please edit build-user.xml instead.
> -->
> <project basedir="." default="all" name="WebsiteAdmin">
> &buildfile;
> <property name="lib.location" value="C:/dev/workspace/lib" />
> <property name="site.location" value="../site"/>
>
>
> <target name="all" depends="wars,importFromSite,importdeployjars">
> </target>
>
>
> <!-- Import site as a baseline for admin.
> All but web.xml and springapp-servlet.xml can be exported, as
> there are otherwise no name clashes.
> Compiled site classes are placed in admin's lib folder.
> -->
> <target name="importFromSite">
> <copy todir=".deployables/${ant.project.name}/WEB-INF">
> <fileset dir="${site.location}/site/WEB-INF"
> excludes="springapp-servlet.xml,web.xml" />
> </copy>
> <copy todir=".deployables/${ant.project.name}/css">
> <fileset dir="${site.location}/site/css"/>
> </copy>
> <copy todir=".deployables/${ant.project.name}/images">
> <fileset dir="${site.location}/site/images"/>
> </copy>
>
> <jar destfile=" .deployables/${ant.project.name}/WEB-INF/lib/site_classes.ja r ">
> <fileset dir="${site.location}/.deployables/site/WEB-INF/classes"/>
> </jar>
>
> </target>
>
> <!-- Import debug jars into web app -->
> <target name="importdebugjars">
> <copy todir=".deployables/${ant.project.name}/WEB-INF/lib">
> <fileset id="debugjars"
> dir="${lib.location}/debug"
> excludes="some.jar" />
> </copy>
> </target>
>
>
> <!-- Import deploy jars into web app: THIS to be used for live deployment -->
> <target name="importdeployjars">
> <copy todir=".deployables/${ant.project.name}/WEB-INF/lib">
> <fileset id="deployjars"
> dir="${lib.location}/unsecure"
> excludes="some.jar" />
> </copy>
> </target>
>
>
> <!-- Beware: Above projects might import the debug jars which include source code -->
> <target name="wars" depends="importdeployjars, importFromSite">
> <zip
> basedir=".deployables/${ant.project.name}"
> destfile="../lib/admin.war"/>
> </target>
> </project>
>
>
> ------------------------------------------------------------ ------------
>
> <?xml version="1.0" encoding="UTF-8"?>
> <launchConfiguration type="org.eclipse.ant.AntBuilderLaunchConfigurationType">
> <stringAttribute key="process_factory_id" value="org.eclipse.ant.ui.remoteAntProcessFactory"/>
> <booleanAttribute key="org.eclipse.debug.ui.ATTR_LAUNCH_IN_BACKGROUND" value="true"/>
> <booleanAttribute key="org.eclipse.ant.ui.DEFAULT_VM_INSTALL" value="true"/>
> <stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.ant.internal.ui.antsupport.InternalAntRunner "/>
> <stringAttribute key="org.eclipse.ui.externaltools.ATTR_RUN_BUILD_KINDS" value="full,incremental,auto,"/>
> <booleanAttribute key="org.eclipse.ant.ui.ATTR_TARGETS_UPDATED" value="true"/>
> <booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/>
> <booleanAttribute key="org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED" value="true"/>
> <stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.ant.ui.AntClasspathProvider"/>
> <stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.ant.ui.AntClasspathProvider"/>
> <stringAttribute key="org.eclipse.ui.externaltools.ATTR_BUILD_SCOPE" value="${working_set:<?xml version="1.0" encoding="UTF-8"?> 
 ;<launchConfigurationWorkingSet editPageId="org.eclipse.ui.resourceWorkingSetPage&a mp;quot; factoryID="org.eclipse.ui.internal.WorkingSetFactor y" name="workingSet"> 
 ;<item factoryID="org.eclipse.ui.internal.model.ResourceFa ctory" path="/WebsiteAdmin/.deployables" type="2"/> < ;item factoryID="org.eclipse.ui.internal.model.ResourceFa ctory" path="/WebsiteAdmin/build-user.xml" type="1"/> < ;item factoryID="org.eclipse.ui.internal.model.ResourceFa ctory" path="/WebsiteAdmin/build.xml" type="1"/> < ;/launchConfigurationWorkingSet>} "/>
> <stringAttribute key="org.eclipse.jdt.launching.VM_INSTALL_TYPE_ID" value="org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType "/>
> <stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="WebsiteAdmin"/>
> <stringAttribute key="org.eclipse.jdt.launching.VM_INSTALL_NAME" value="jdk1.5"/>
> <stringAttribute key="org.eclipse.debug.core.ATTR_REFRESH_SCOPE" value="${working_set:<?xml version="1.0" encoding="UTF-8"?> 
 ;<launchConfigurationWorkingSet editPageId="org.eclipse.ui.resourceWorkingSetPage&a mp;quot; factoryID="org.eclipse.ui.internal.WorkingSetFactor y" name="working set"> <item factoryID="org.eclipse.ui.internal.model.ResourceFa ctory" path="/lib" type="4"/> < ;/launchConfigurationWorkingSet>} "/>
> <stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${workspace_loc:/WebsiteAdmin/build.xml}"/>
> <booleanAttribute key="org.eclipse.debug.core.ATTR_REFRESH_RECURSIVE" value="false"/>
> </launchConfiguration>
|
|
|
Goto Forum:
Current Time: Thu Apr 24 23:49:36 EDT 2025
Powered by FUDForum. Page generated in 0.02869 seconds
|