rename jsp file in target dir just before packing using maven

I ve got an maven based web project including the "normal" directory structure. I've the need to generate to war artifacts, one is the normal app, the other is an admin "version", which is realised by using 2 different maven-profiles. In case of the admin version I need to rename a JSP-file just before the war file is packaged.

How can I do this? Which maven-plugin fits this requirement?

Answers


IMHO you must use ant run to rename your files and attach this execution to prepare-package phase.


sorry, but to copy/rename the JSPs during prepare-package phase doesn't work, because the files are not yet in the target directory at this point.

sample code:

    <plugin>
  <artifactId>maven-antrun-plugin</artifactId>
   <version>1.7</version>
  <executions>
    <execution>
      <phase>prepare-package</phase>
      <configuration>
        <target>
          <copy file="${project.build.directory}\myProject\loginAdmin.jsp"
            tofile="${project.build.directory}\myProject\loginUser.jsp"/>
        </target>
      </configuration>
      <goals>
        <goal>run</goal>
      </goals>
    </execution>
  </executions>
</plugin>

Need Your Help

How to make realtime web with Rails?

html ruby-on-rails ruby real-time erb

I want to make realtime change in HTML documents.

manipulate mousedown object on drop jquery

javascript jquery html object

I'm trying to change the object that drops when it activates with mousedown. For example: