Maven War: Filename of deployment descriptorHow can I create an executable JAR with dependencies using Maven?How to add local jar files to a Maven project?How to set up manifest class-path properly in maven-war-pluginmissing jars when publishing a web app to glassfish with eclipse juno and maven integrationWhat is the maven-shade-plugin used for, and why would you want to relocate Java packages?How to migrate from a jar-Jetty combination to a war-JBoss deployment with a maven project?Deploying a war file created by maven to a glassfish server, determine the order of the classpath?Building .war file using maven. Missing files and directoriesHot deployment / incremental Java deployment using Maven & Eclipse & Glassfish 4?How to deploy a Maven web application to a local-installed Glassfish?

How does strength of boric acid solution increase in presence of salicylic acid?

Writing rule stating superpower from different root cause is bad writing

What is the offset in a seaplane's hull?

Prove that NP is closed under karp reduction?

Risk of getting Chronic Wasting Disease (CWD) in the United States?

Is it tax fraud for an individual to declare non-taxable revenue as taxable income? (US tax laws)

Can divisibility rules for digits be generalized to sum of digits

What defenses are there against being summoned by the Gate spell?

How much RAM could one put in a typical 80386 setup?

How to say job offer in Mandarin/Cantonese?

Fencing style for blades that can attack from a distance

LaTeX closing $ signs makes cursor jump

Why do I get two different answers for this counting problem?

To string or not to string

What do you call a Matrix-like slowdown and camera movement effect?

What do the dots in this tr command do: tr .............A-Z A-ZA-Z <<< "JVPQBOV" (with 13 dots)

"You are your self first supporter", a more proper way to say it

the place where lots of roads meet

Why can't I see bouncing of a switch on an oscilloscope?

"to be prejudice towards/against someone" vs "to be prejudiced against/towards someone"

How can I make my BBEG immortal short of making them a Lich or Vampire?

strToHex ( string to its hex representation as string)

Why dont electromagnetic waves interact with each other?

How to find program name(s) of an installed package?



Maven War: Filename of deployment descriptor


How can I create an executable JAR with dependencies using Maven?How to add local jar files to a Maven project?How to set up manifest class-path properly in maven-war-pluginmissing jars when publishing a web app to glassfish with eclipse juno and maven integrationWhat is the maven-shade-plugin used for, and why would you want to relocate Java packages?How to migrate from a jar-Jetty combination to a war-JBoss deployment with a maven project?Deploying a war file created by maven to a glassfish server, determine the order of the classpath?Building .war file using maven. Missing files and directoriesHot deployment / incremental Java deployment using Maven & Eclipse & Glassfish 4?How to deploy a Maven web application to a local-installed Glassfish?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















So I've added the maven-war-plugin to my pom.xml and added:



<configuration>
<webXml>WEB-INF/glassfish-web.xml</webXml>
</configuration>


Now when I package my app this descriptor gets renamed to web.xml which causes a failure when trying to deploy my application to my glassfish server, since the server thinks the web.xml is malformatted I guess.
So how can I tell maven to leave the file name untouched?










share|improve this question




























    0















    So I've added the maven-war-plugin to my pom.xml and added:



    <configuration>
    <webXml>WEB-INF/glassfish-web.xml</webXml>
    </configuration>


    Now when I package my app this descriptor gets renamed to web.xml which causes a failure when trying to deploy my application to my glassfish server, since the server thinks the web.xml is malformatted I guess.
    So how can I tell maven to leave the file name untouched?










    share|improve this question
























      0












      0








      0








      So I've added the maven-war-plugin to my pom.xml and added:



      <configuration>
      <webXml>WEB-INF/glassfish-web.xml</webXml>
      </configuration>


      Now when I package my app this descriptor gets renamed to web.xml which causes a failure when trying to deploy my application to my glassfish server, since the server thinks the web.xml is malformatted I guess.
      So how can I tell maven to leave the file name untouched?










      share|improve this question














      So I've added the maven-war-plugin to my pom.xml and added:



      <configuration>
      <webXml>WEB-INF/glassfish-web.xml</webXml>
      </configuration>


      Now when I package my app this descriptor gets renamed to web.xml which causes a failure when trying to deploy my application to my glassfish server, since the server thinks the web.xml is malformatted I guess.
      So how can I tell maven to leave the file name untouched?







      java maven glassfish






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 21 at 23:59









      yakmirasyakmiras

      204




      204






















          1 Answer
          1






          active

          oldest

          votes


















          0














          <webXml> configuration isn't mandatory for maven-war-plugin. So, If you don't explicitly mention the webXml, It won't rename the file. You will get the expected behaviour if you remove this webXml entry from your pom.xml



          Edit 1



          I don't think there is an option to skip webXml file renaming. You can try copy-resources task in maven-resources plugin. You can configure a resource file/directory mappings from Project dir to War archive.



           <plugins>
          <-- other plugin configurations.... -->
          <plugin>
          <artifactId>maven-resources-plugin</artifactId>
          <version>3.1.0</version>
          <executions>
          <execution>
          <id>copy-resources</id>
          <phase>prepare-package</phase>
          <goals>
          <goal>copy-resources</goal>
          </goals>
          <configuration>
          <outputDirectory>
          $basedir/target/app/WEB-INF
          </outputDirectory>
          <resources>
          <resource>
          <directory>WEB-INF</directory>
          <includes>glassfish-web.xml</includes>
          </resource>
          <resource>
          <directory>another directory from where all files are copied
          </directory>
          </resource>
          <resource>
          <directory>
          another directory from where, all but test.properties are copied
          </directory>
          <excludes>test.properties</excludes>
          </resource>
          </resources>
          </configuration>
          </execution>
          </executions>
          </plugin>
          <plugins/>





          share|improve this answer

























          • If I remove the <webXml> entry in the configuration section of the war-plugin then it works ONLY IF I move the glassfish-web.xml to the following location: src/main/webapp/WEB-INF/glassfish-web.xml What if my project structure deviates from this? I want to have my WEB-INF folder at the top level of my application. The <webXml> tag seems to be there for exactly this reason, so you can reference a deployment descriptor in a location other than the default one. So I'm still looking for a way to prevent maven from renaming.

            – yakmiras
            Mar 22 at 9:58












          • I've updated the answer. What if my project structure deviates from this? I think it is the purpose of copy-resources

            – Maran Subburayan
            Mar 22 at 14:29












          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55290945%2fmaven-war-filename-of-deployment-descriptor%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          <webXml> configuration isn't mandatory for maven-war-plugin. So, If you don't explicitly mention the webXml, It won't rename the file. You will get the expected behaviour if you remove this webXml entry from your pom.xml



          Edit 1



          I don't think there is an option to skip webXml file renaming. You can try copy-resources task in maven-resources plugin. You can configure a resource file/directory mappings from Project dir to War archive.



           <plugins>
          <-- other plugin configurations.... -->
          <plugin>
          <artifactId>maven-resources-plugin</artifactId>
          <version>3.1.0</version>
          <executions>
          <execution>
          <id>copy-resources</id>
          <phase>prepare-package</phase>
          <goals>
          <goal>copy-resources</goal>
          </goals>
          <configuration>
          <outputDirectory>
          $basedir/target/app/WEB-INF
          </outputDirectory>
          <resources>
          <resource>
          <directory>WEB-INF</directory>
          <includes>glassfish-web.xml</includes>
          </resource>
          <resource>
          <directory>another directory from where all files are copied
          </directory>
          </resource>
          <resource>
          <directory>
          another directory from where, all but test.properties are copied
          </directory>
          <excludes>test.properties</excludes>
          </resource>
          </resources>
          </configuration>
          </execution>
          </executions>
          </plugin>
          <plugins/>





          share|improve this answer

























          • If I remove the <webXml> entry in the configuration section of the war-plugin then it works ONLY IF I move the glassfish-web.xml to the following location: src/main/webapp/WEB-INF/glassfish-web.xml What if my project structure deviates from this? I want to have my WEB-INF folder at the top level of my application. The <webXml> tag seems to be there for exactly this reason, so you can reference a deployment descriptor in a location other than the default one. So I'm still looking for a way to prevent maven from renaming.

            – yakmiras
            Mar 22 at 9:58












          • I've updated the answer. What if my project structure deviates from this? I think it is the purpose of copy-resources

            – Maran Subburayan
            Mar 22 at 14:29
















          0














          <webXml> configuration isn't mandatory for maven-war-plugin. So, If you don't explicitly mention the webXml, It won't rename the file. You will get the expected behaviour if you remove this webXml entry from your pom.xml



          Edit 1



          I don't think there is an option to skip webXml file renaming. You can try copy-resources task in maven-resources plugin. You can configure a resource file/directory mappings from Project dir to War archive.



           <plugins>
          <-- other plugin configurations.... -->
          <plugin>
          <artifactId>maven-resources-plugin</artifactId>
          <version>3.1.0</version>
          <executions>
          <execution>
          <id>copy-resources</id>
          <phase>prepare-package</phase>
          <goals>
          <goal>copy-resources</goal>
          </goals>
          <configuration>
          <outputDirectory>
          $basedir/target/app/WEB-INF
          </outputDirectory>
          <resources>
          <resource>
          <directory>WEB-INF</directory>
          <includes>glassfish-web.xml</includes>
          </resource>
          <resource>
          <directory>another directory from where all files are copied
          </directory>
          </resource>
          <resource>
          <directory>
          another directory from where, all but test.properties are copied
          </directory>
          <excludes>test.properties</excludes>
          </resource>
          </resources>
          </configuration>
          </execution>
          </executions>
          </plugin>
          <plugins/>





          share|improve this answer

























          • If I remove the <webXml> entry in the configuration section of the war-plugin then it works ONLY IF I move the glassfish-web.xml to the following location: src/main/webapp/WEB-INF/glassfish-web.xml What if my project structure deviates from this? I want to have my WEB-INF folder at the top level of my application. The <webXml> tag seems to be there for exactly this reason, so you can reference a deployment descriptor in a location other than the default one. So I'm still looking for a way to prevent maven from renaming.

            – yakmiras
            Mar 22 at 9:58












          • I've updated the answer. What if my project structure deviates from this? I think it is the purpose of copy-resources

            – Maran Subburayan
            Mar 22 at 14:29














          0












          0








          0







          <webXml> configuration isn't mandatory for maven-war-plugin. So, If you don't explicitly mention the webXml, It won't rename the file. You will get the expected behaviour if you remove this webXml entry from your pom.xml



          Edit 1



          I don't think there is an option to skip webXml file renaming. You can try copy-resources task in maven-resources plugin. You can configure a resource file/directory mappings from Project dir to War archive.



           <plugins>
          <-- other plugin configurations.... -->
          <plugin>
          <artifactId>maven-resources-plugin</artifactId>
          <version>3.1.0</version>
          <executions>
          <execution>
          <id>copy-resources</id>
          <phase>prepare-package</phase>
          <goals>
          <goal>copy-resources</goal>
          </goals>
          <configuration>
          <outputDirectory>
          $basedir/target/app/WEB-INF
          </outputDirectory>
          <resources>
          <resource>
          <directory>WEB-INF</directory>
          <includes>glassfish-web.xml</includes>
          </resource>
          <resource>
          <directory>another directory from where all files are copied
          </directory>
          </resource>
          <resource>
          <directory>
          another directory from where, all but test.properties are copied
          </directory>
          <excludes>test.properties</excludes>
          </resource>
          </resources>
          </configuration>
          </execution>
          </executions>
          </plugin>
          <plugins/>





          share|improve this answer















          <webXml> configuration isn't mandatory for maven-war-plugin. So, If you don't explicitly mention the webXml, It won't rename the file. You will get the expected behaviour if you remove this webXml entry from your pom.xml



          Edit 1



          I don't think there is an option to skip webXml file renaming. You can try copy-resources task in maven-resources plugin. You can configure a resource file/directory mappings from Project dir to War archive.



           <plugins>
          <-- other plugin configurations.... -->
          <plugin>
          <artifactId>maven-resources-plugin</artifactId>
          <version>3.1.0</version>
          <executions>
          <execution>
          <id>copy-resources</id>
          <phase>prepare-package</phase>
          <goals>
          <goal>copy-resources</goal>
          </goals>
          <configuration>
          <outputDirectory>
          $basedir/target/app/WEB-INF
          </outputDirectory>
          <resources>
          <resource>
          <directory>WEB-INF</directory>
          <includes>glassfish-web.xml</includes>
          </resource>
          <resource>
          <directory>another directory from where all files are copied
          </directory>
          </resource>
          <resource>
          <directory>
          another directory from where, all but test.properties are copied
          </directory>
          <excludes>test.properties</excludes>
          </resource>
          </resources>
          </configuration>
          </execution>
          </executions>
          </plugin>
          <plugins/>






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Mar 22 at 14:27

























          answered Mar 22 at 0:50









          Maran SubburayanMaran Subburayan

          9118




          9118












          • If I remove the <webXml> entry in the configuration section of the war-plugin then it works ONLY IF I move the glassfish-web.xml to the following location: src/main/webapp/WEB-INF/glassfish-web.xml What if my project structure deviates from this? I want to have my WEB-INF folder at the top level of my application. The <webXml> tag seems to be there for exactly this reason, so you can reference a deployment descriptor in a location other than the default one. So I'm still looking for a way to prevent maven from renaming.

            – yakmiras
            Mar 22 at 9:58












          • I've updated the answer. What if my project structure deviates from this? I think it is the purpose of copy-resources

            – Maran Subburayan
            Mar 22 at 14:29


















          • If I remove the <webXml> entry in the configuration section of the war-plugin then it works ONLY IF I move the glassfish-web.xml to the following location: src/main/webapp/WEB-INF/glassfish-web.xml What if my project structure deviates from this? I want to have my WEB-INF folder at the top level of my application. The <webXml> tag seems to be there for exactly this reason, so you can reference a deployment descriptor in a location other than the default one. So I'm still looking for a way to prevent maven from renaming.

            – yakmiras
            Mar 22 at 9:58












          • I've updated the answer. What if my project structure deviates from this? I think it is the purpose of copy-resources

            – Maran Subburayan
            Mar 22 at 14:29

















          If I remove the <webXml> entry in the configuration section of the war-plugin then it works ONLY IF I move the glassfish-web.xml to the following location: src/main/webapp/WEB-INF/glassfish-web.xml What if my project structure deviates from this? I want to have my WEB-INF folder at the top level of my application. The <webXml> tag seems to be there for exactly this reason, so you can reference a deployment descriptor in a location other than the default one. So I'm still looking for a way to prevent maven from renaming.

          – yakmiras
          Mar 22 at 9:58






          If I remove the <webXml> entry in the configuration section of the war-plugin then it works ONLY IF I move the glassfish-web.xml to the following location: src/main/webapp/WEB-INF/glassfish-web.xml What if my project structure deviates from this? I want to have my WEB-INF folder at the top level of my application. The <webXml> tag seems to be there for exactly this reason, so you can reference a deployment descriptor in a location other than the default one. So I'm still looking for a way to prevent maven from renaming.

          – yakmiras
          Mar 22 at 9:58














          I've updated the answer. What if my project structure deviates from this? I think it is the purpose of copy-resources

          – Maran Subburayan
          Mar 22 at 14:29






          I've updated the answer. What if my project structure deviates from this? I think it is the purpose of copy-resources

          – Maran Subburayan
          Mar 22 at 14:29




















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55290945%2fmaven-war-filename-of-deployment-descriptor%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

          Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

          Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript