Win a copy of GANs in ActionE this week in the AI forum
or WebAssembly in Action in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
Sheriffs:
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Joe Ess
  • salvin francis
  • fred rosenberger

past files and directories appearing in new command line ant builds

 
Ranch Hand
Posts: 134
4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am working on CattleDrive Servlets assignment 4a.

When I execute the simple command-line command: "ant" to run the build.xml file, file folders and class files from previous builds keep appearing in the resulting .war file. The build.xml that I am using is from a file "video.zip" that comes with the assignment. http://www.javaranch.com/drive/servlet/index.jsp#videos

For example, I was trying out different packages for a minimal "User.java" class I wrote in order to help understand how to address and use java classes from a JSP. In one successful experiment, I used the package name "business" for "User.java" and was able to access this from my JSP. Then, I changed the package name to "com.javaranch.drive.video" and made the appropriate changes in the JSP and again was able to instantiate a "User" class.

What I'm wondering though is this: as I continue to do builds, the directory "business" from the first experiment continues to be build by Ant in the .war file, under "WEB-INF/classes" despite the fact that there is no longer any invocations of this directory in my source and no such file in the development area. "business" has been expunged from all package references. Why does this directory and a copy of User.class continue to appear in my .war file?

I have deleted the .war file and rerun the "ant" command, I have rebooted the system, but there continues to be some sort of cache or memory that is causing these old references to appear in new .war files. What command line instructions, or what actions do I have to take so that these obsolete items are not part of the build?
 
Phil Freihofner
Ranch Hand
Posts: 134
4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Further investigation: I discovered that there are files and folders in a "build" directory that are the source of the old files. Once these were deleted the .war file no longer included the obsolete past files.
 
Sheriff
Posts: 3034
12
Mac IntelliJ IDE Python VI Editor Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's what I was about to say. Ant doesn't have any hidden cache or anything like that, so any artifacts you see are coming from the file system. The way that build file is set up, "ant clean" will remove the build directory for you and let you start fresh.
 
Phil Freihofner
Ranch Hand
Posts: 134
4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks! That is what I was looking for.

Using the "clean" command will be easier and safer than deleting the files in the build directory via a file manager.
 
Hey, check out my mega multi devastator cannon. It's wicked. It makes this tiny ad look weak:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!