Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resources filtering in webapp #40

Closed
elw00d opened this issue Jul 29, 2014 · 7 comments
Closed

Resources filtering in webapp #40

elw00d opened this issue Jul 29, 2014 · 7 comments

Comments

@elw00d
Copy link

elw00d commented Jul 29, 2014

Hello, thanks for nice plugin ! My application has some props propagating into xml files on build. I use next script block:

war {
    // Enable filtering on all xml files in WEB-INF
    filesMatching('WEB-INF/*.xml', { FileCopyDetails fileDetails ->
        logger.error("File filtered: " + fileDetails.path)
        filter(ReplaceTokens, tokens: [
                "hosts"    : project.property("hosts"),
                "ports"    : project.property("ports"),
                "usernames": project.property("usernames"),
                "passwords": project.property("passwords")
        ])
    })
}

But when I'm using gretty jettyRun task, content inside inplaceWebapp directory is not filtered. I had a look at prepareInplaceWebAppFolder(Project) source code and found that it doesn't support any customization here. What can I do to hook this copy operation and enable flltering for it ?

@akhikhl akhikhl self-assigned this Jul 29, 2014
@akhikhl
Copy link
Owner

akhikhl commented Jul 29, 2014

Hi, I will try to invent adequate extension mechanism.

@akhikhl
Copy link
Owner

akhikhl commented Aug 1, 2014

Is your WEB-INF directory located in src/main/webapp?

@elw00d
Copy link
Author

elw00d commented Aug 2, 2014

Yes, it is there

@akhikhl
Copy link
Owner

akhikhl commented Aug 25, 2014

Resource filtering is implemented in Gretty 1.1.2-SNAPSHOT. Could you, please, test it?

Here is documentation: http://akhikhl.github.io/gretty-doc/Web-app-filtering.html

In order to use snapshot version of Gretty, you'll need to add jfrog snapshot repository:

buildscript {
  repositories {
    mavenLocal()
    jcenter()
    maven { url 'http://oss.jfrog.org/artifactory/oss-snapshot-local' }
  }

  dependencies {
    classpath 'org.akhikhl.gretty:gretty:1.1.2-SNAPSHOT'
  }
}

@elw00d
Copy link
Author

elw00d commented Aug 26, 2014

Hurray ! It works ! Thank you very much !

@elw00d elw00d closed this as completed Aug 26, 2014
@akhikhl
Copy link
Owner

akhikhl commented Aug 26, 2014

Hi Igor,

I'm glad that it works for you :)

How did you solve "plugin not found" problem?

On Tue, Aug 26, 2014 at 10:06 AM, Kostromin Igor notifications@github.com
wrote:

Hurray ! It works ! Thank you very much !


Reply to this email directly or view it on GitHub
#40 (comment).

@elw00d
Copy link
Author

elw00d commented Aug 26, 2014

Yes, I've just placed buildscript section in outer scope (was in project { } section)

javabrett pushed a commit to javabrett/gretty that referenced this issue Feb 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants