IDEA-25934 (Maven: Webapp resources filtering) does not appear to work

已回答

My plugin configuration is as follows. Resources are not being filterd. Perhaps alternate delimiter support was not included?  I am using build 134.1007 :

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-war-plugin</artifactId>
        <version>2.1.1</version>
        <configuration>
          <failOnMissingWebXml>false</failOnMissingWebXml>
          <webappDirectory>${application.war.directory}</webappDirectory>
          <delimiters>
            <delimiter>${*}</delimiter>
            <delimiter>@</delimiter>
          </delimiters>
          <webResources>
            <resource>
              <directory>src/main/${project.webapp.directory}</directory>
              <targetPath />
            </resource>
            <resource>
              <directory>src/main/${project.resources.directory}</directory>
              <targetPath>WEB-INF/classes</targetPath>
            </resource>
            <resource>
              <filtering>true</filtering>
              <directory>src/main/webapp/META-INF</directory>
              <includes>
                <include>context.xml</include>
              </includes>
              <targetPath>META-INF</targetPath>
            </resource>
          </webResources>
        </configuration>
      </plugin>

0
Avatar
Permanently deleted user

"${*}" and "@" are default delimiters, not an alternate.
Could you provide small sample project?

0
Avatar
Permanently deleted user

You're correct, those are indeed default delimeters that we just havppen to specify. Included a small maven project with just a context.xml. Under IntelliJ, this file is copied over with @app.name@ unfiltered, whereas a mvn clean install always filters it.



Attachment(s):
testApp.tar.gz
0
Avatar
Permanently deleted user

On my machine all works right. Try to use last EAP http://confluence.jetbrains.com/display/IDEADEV/IDEA+13.1+EAP

0
Avatar
Permanently deleted user

I tried after updating to the latest build, but no luck. Perhaps I am doing something wrong in the build process. I am using a Local Tomcat server, with "Make" and "Build war" artifact before deployment. The target directory is being created, but the resources are not being resolved.

0
Avatar
Permanently deleted user

I have tried pretty much every configuration I can think of, and this feature is still not working with the latest build. Can you confirm the steps you are taking to get it to work?

Thanks

0
Avatar
Permanently deleted user

I download attached project, open it in IDEA, press "Reimport All projects", select Menu -> Build -> Build Artifacts... -> testApp:war , open "target/testApp-1.0.0-testApp/META-INF/context.xml"
The content is:
<Context path="/testApp" docBase="/home/user/tttProjects/ideaProject/target/testApp-1.0.0-testApp" debug="0" useHttpOnly="false">
</Context>

0
Avatar
Permanently deleted user

Thanks. Recreating the project worked for me for the test app (invalidating caches had not). For my actual applicaiton, properties not defined in the pom still don't work however. I have attached a new version of the previous test project where the property "testProperty" is not resolved for me, but the other now are.



Attachment(s):
ideaProject.tar.gz
0
Avatar
Permanently deleted user

Thanks for sample, fixed. Fix will be available in 13.1.2

0
Avatar
Permanently deleted user

Is that 13.1.RC2? (Want to make sure the right version has been released before I get another trial license).

0
Avatar
Permanently deleted user

No, I can't port fix to 13.1.0 , because it is not a critical fix. Fix will be available in the next EAP after release 13.1.0

0
Avatar
Permanently deleted user

I have 13.1.2 and my previous issue was successfully fixed. I now am realizing that my filtered overlays (also in the maven-war-plugin) are not working - should these be working, or is this not implemented yet?

0
Avatar
Permanently deleted user

IntelliJ IDEA's Make features are capable of filtering Maven resources. However, IntelliJ IDEA yet does not support filtering web resources.

 

https://www.jetbrains.com/help/idea/2016.3/maven.html#d1332169e308

 

0
Avatar
Permanently deleted user

What's the status here? This was reported 3 years ago. When can we expected a fix?

0

请先登录再写评论。