Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » Control published files and folders in app classes folder in wtpwebapps
Control published files and folders in app classes folder in wtpwebapps [message #742539] Thu, 20 October 2011 15:32 Go to next message
Mahmoud Saleh is currently offline Mahmoud SalehFriend
Messages: 23
Registered: September 2011
Junior Member
hi, i am using eclipse helios 3.6.1 and WTP 3.2 with tomcat 7
and i am using maven 2 as build tool, m2eclipse plugin
when trying to run project on server, i get endless exceptions
this is opposite to running my project from maven tomcat plugin, everything works very fine

so i compared between the extracted war in target folder generated in my project (workspace/project/target/warFolder/classes)

and the extracted war in (wtpwebapps/myapp/WEB-INF/classes)

and here are the contents:

1- (workspace/project/target/warFolder/classes) contents:

com
messages
MET-INF
import.sql
log4j.properties

2- (wtpwebapps/myapp/WEB-INF/classes)

com
messages
MET-INF
import.sql
log4j.properties

.settings
src
target
.classpath
.project
file.txt
pom.xml


BTW, the published project folder contain only one folder which is WEB-INF and it doesn't contain resources folder (styles-images-scripts) and doesn't contain the META_INF too.
why it generates those additional unneeded folders?
when i remove those additional folders and try to run project on server from eclipse it runs fine

so question is how to control eclipse not to generate those folders, and why i get them in first place.


UPDATE: POM file plugins


<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<configuration>
					<source>1.6</source>
					<target>1.6</target>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-dependency-plugin</artifactId>
				<executions>
					<execution>
						<id>install</id>
						<phase>install</phase>
						<goals>
							<goal>sources</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			
			<plugin>
               <groupId>org.apache.maven.plugins</groupId>
               <artifactId>maven-resources-plugin</artifactId>
               <version>2.5</version>
               <configuration>
               <encoding>UTF-8</encoding>
               </configuration>
            </plugin>
            
            <plugin>
               
               <groupId>org.apache.tomcat.maven</groupId>
               <artifactId>tomcat7-maven-plugin</artifactId>
               <version>2.0-SNAPSHOT</version>
               <configuration>
               <path>/${project.build.finalName}</path>
               </configuration>
               
               
            </plugin>
            
		</plugins>
Re: Control published files and folders in app classes folder in wtpwebapps [message #742610 is a reply to message #742539] Thu, 20 October 2011 16:49 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry IsaacsFriend
Messages: 1354
Registered: July 2009
Senior Member
It would appear that your project has a Java Source folder whose output
is mapped to the root of the project. This has the side effect of
making most everything in your project appear as build output to WTP,
causing to be included in the Web application. You should be able to
correct this on the Source tab of the Java Build Path page in the
project's Properties dialog.

I don't use maven or m2eclipse, so I can't say how well m2eclipse keeps
the Dynamic Web Project's configuration in sync with how it will build
the war. For this project, it appears some manual intervention is
required so that WTP will assemble the Web application with the same
resources that the maven build will.

Cheers,
Larry

On 10/20/2011 11:32 AM, Mahmoud Saleh wrote:
> hi, i am using eclipse helios 3.6.1 and WTP 3.2 with tomcat 7
> and i am using maven 2 as build tool, m2eclipse plugin
> when trying to run project on server, i get endless exceptions
> this is opposite to running my project from maven tomcat plugin,
> everything works very fine
>
> so i compared between the extracted war in target folder generated in my
> project (workspace/project/target/warFolder/classes)
>
> and the extracted war in (wtpwebapps/myapp/WEB-INF/classes)
>
> and here are the contents:
>
> 1- (workspace/project/target/warFolder/classes) contents:
>
> com
> messages
> MET-INF
> import.sql
> log4j.properties
>
> 2- (wtpwebapps/myapp/WEB-INF/classes)
>
> com
> messages
> MET-INF
> import.sql
> log4j.properties
>
> settings
> src
> target
> classpath
> project
> file.txt
> pom.xml
>
> BTW, the published project folder contain only one folder which is
> WEB-INF and it doesn't contain resources folder (styles-images-scripts)
> and doesn't contain the META_INF too.
> why it generates those additional unneeded folders?
> when i remove those additional folders and try to run project on server
> from eclipse it runs fine
>
> so question is how to control eclipse not to generate those folders, and
> why i get them in first place.
>
>
> UPDATE: POM file plugins
>
>
> <plugins>
> <plugin>
> <groupId>org.apache.maven.plugins</groupId>
> <artifactId>maven-compiler-plugin</artifactId>
> <configuration>
> <source>1.6</source>
> <target>1.6</target>
> </configuration>
> </plugin>
> <plugin>
> <groupId>org.apache.maven.plugins</groupId>
> <artifactId>maven-dependency-plugin</artifactId>
> <executions>
> <execution>
> <id>install</id>
> <phase>install</phase>
> <goals>
> <goal>sources</goal>
> </goals>
> </execution>
> </executions>
> </plugin>
>
> <plugin>
> <groupId>org.apache.maven.plugins</groupId>
> <artifactId>maven-resources-plugin</artifactId>
> <version>2.5</version>
> <configuration>
> <encoding>UTF-8</encoding>
> </configuration>
> </plugin>
> <plugin>
> <groupId>org.apache.tomcat.maven</groupId>
> <artifactId>tomcat7-maven-plugin</artifactId>
> <version>2.0-SNAPSHOT</version>
> <configuration>
> <path>/${project.build.finalName}</path>
> </configuration>
> </plugin>
> </plugins>
Re: Control published files and folders in app classes folder in wtpwebapps [message #746199 is a reply to message #742610] Sun, 23 October 2011 08:59 Go to previous messageGo to next message
Mahmoud Saleh is currently offline Mahmoud SalehFriend
Messages: 23
Registered: September 2011
Junior Member
well i noticed the following in Deployment Assembly:

Source: / Deploy Path:WEB-INF/classes
Source: /src/main/java Deploy Path: WEB-INF/classes
Source: /src/main/resources Deploy Path: WEB-INF/classes
Source: /src/main/webapp Deploy Path: /
Source: Maven Dependencies Deploy Path: WEB-INF/lib

any ideas ?

[Updated on: Sun, 23 October 2011 09:00]

Report message to a moderator

Re: Control published files and folders in app classes folder in wtpwebapps [message #746212 is a reply to message #746199] Sun, 23 October 2011 09:11 Go to previous messageGo to next message
Mahmoud Saleh is currently offline Mahmoud SalehFriend
Messages: 23
Registered: September 2011
Junior Member
well issue is solved now after removing this entry from deployment assembly:

Source: / Deploy Path:WEB-INF/classes

but any ideas why i had such entry in first place ?
Re: Control published files and folders in app classes folder in wtpwebapps [message #748146 is a reply to message #746212] Mon, 24 October 2011 14:13 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry IsaacsFriend
Messages: 1354
Registered: July 2009
Senior Member
On 10/23/2011 5:11 AM, Mahmoud Saleh wrote:
> well issue is solved now after removing this entry from deployment
> assembly:
>
> Source: / Deploy Path:WEB-INF/classes
>
> but any ideas why i had such entry in first place ?

You are correct that this entry is likely a "mistake". I don't know
specifically why it's there, but I would guess it occurred
"accidentally" when the project was created. Something could have
changed or been added in WTP that affects the programmatic creation of
projects, which m2eclipse doesn't quite handle yet.

You might also check the Source tab in the Java Build Path page to make
sure you don't also have a "leftover/unused" Java Source folder whose
output folder is the root of the project. The presence of something
like that could trigger the creation of an entry like this.

Cheers,
Larry
Re: Control published files and folders in app classes folder in wtpwebapps [message #753050 is a reply to message #742539] Wed, 26 October 2011 16:08 Go to previous messageGo to next message
Mahmoud Saleh is currently offline Mahmoud SalehFriend
Messages: 23
Registered: September 2011
Junior Member
one more question please:
what's the default (Web Deployment Assembly) packaging structure for Java EE Web Application project ?

following structure, is what i have right now, and works fine with me, do you have any comments or feedback about this structure ?


Source: /src/main/java Deploy Path: WEB-INF/classes
Source: /src/main/resources Deploy Path: WEB-INF/classes
Source: /src/main/webapp Deploy Path: /
Source: /src/test/java Deploy Path: WEB-INF/classes
Source: Maven Dependencies Deploy Path: WEB-INF/lib

BTW sometimes Maven Dependencies gets removed from the Web Deployment Assembly, specially when updating project configuration, any ideas why ?

[Updated on: Wed, 26 October 2011 16:17]

Report message to a moderator

Re: Control published files and folders in app classes folder in wtpwebapps [message #753115 is a reply to message #753050] Wed, 26 October 2011 16:35 Go to previous message
Larry Isaacs is currently offline Larry IsaacsFriend
Messages: 1354
Registered: July 2009
Senior Member
On 10/26/2011 12:08 PM, Mahmoud Saleh wrote:
> one more question please:
> what's the default (Web Deployment Assembly) packaging structure for
> Java EE Web Application project
>
>
> Source: /src/main/java Deploy Path: WEB-INF/classes
> Source: /src/main/resources Deploy Path: WEB-INF/classes
> Source: /src/main/webapp Deploy Path: /
> Source: /src/test/java Deploy Path: WEB-INF/classes
> Source: Maven Dependencies Deploy Path: WEB-INF/lib
>
> above is what i have right now, and works fine with me, do you have any
> comments or feedback about this structure ?

What you have makes sense. A default Dynamic Web Project (feel free to
create one and see) would give you a "src" Java Source folder mapped to
"WEB-INF/classes" and a "WebContent" folder mapped to "/". There is
also a classpath container called "Web App Libraries" that is similar to
the "Maven Dependencies" that deals with jars destined for the project's
classpath and "WEB-INF/lib". WTP doesn't bother to list in the
Deployment Assembly page since it's not something you can alter.

Cheers,
Larry
Previous Topic:Documentation on WTP Runtime framework?
Next Topic:Adding custom tags to Web page editor's palette
Goto Forum:
  


Current Time: Fri Mar 29 06:44:00 GMT 2024

Powered by FUDForum. Page generated in 0.02343 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top