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

          How to preserve electronics (computers, tablets and phones) for hundreds of years Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) The network's official Twitter account is up and running again. What content…How might modern humans leave a message for 50,000 years?How would an aquatic race develop computers?How do we make computers care for human life?Keeping supplies for 1000 yearsWhat will cell phones become in 100 years?What body armor protects against a laser?Could a society attain 1800s technology if limited to using copper and bronze?Electricity power (magic) and electronicsScavenging metal resources in post-apocalypse after 100 yearsWhy would precursors create devices that can survive and still work after hundreds of years?

          155 수학 과학 기타 둘러보기 메뉴eh추가해eh문서를 완성해

          해남서초등학교 학교 연혁 학교 동문 외부 링크 둘러보기 메뉴북위 34° 34′ 21″ 동경 126° 35′ 50″ / 북위 34.5726385° 동경 126.5972670°  / 34.5726385; 126.5972670해남서초등학교eh