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

JBake JettyServer doesn't work with custom destination #314

Closed
jmcgarr opened this Issue Nov 4, 2016 · 6 comments

Comments

Projects
None yet
3 participants
@jmcgarr
Contributor

jmcgarr commented Nov 4, 2016

I am running a JBake site using the Gradle plugin. I am partial (and so it the plugin) to using the src/jbake directory for source and the build/jbake directory for output. I cannot get jbake to serve content using these two directories. Here's the command I used:

jbake src/jbake build/jbake -b -s

This results in a successful bake to the build/jbake directory, but the Jetty server presents content from the output directory.

Planning on trying to create a unit test to replicate this.

jmcgarr added a commit to jmcgarr/jbake that referenced this issue Nov 4, 2016

Fix Issue #314 - JettyServer fails to serve cmdline destination dir
The Main.run() method is responsible for configuring the destination directory for JBake's built in JettyServer. This commit is to ensure that it considers the desitination directory passed in from the commandline. Still need to add tests.
@jonbullock

This comment has been minimized.

Show comment
Hide comment
@jonbullock

jonbullock Nov 13, 2016

Member

At first glance this is probably down to the fact that the -s option is configured to use the source parameter.

Member

jonbullock commented Nov 13, 2016

At first glance this is probably down to the fact that the -s option is configured to use the source parameter.

@jonbullock jonbullock added this to the v2.5.1 milestone Nov 13, 2016

@jonbullock jonbullock self-assigned this Nov 13, 2016

@ancho

This comment has been minimized.

Show comment
Hide comment
@ancho

ancho Nov 14, 2016

Member

It is also possible to apply the gradle gretty plugin. For example:

plugins {
     id 'org.akhikhl.gretty' version '1.4.0'
}

 gretty {
     httpPort = 8881
     contextPath = "/blog/"
     extraResourceBases = ["build/jbake"]
 }

Run gradle jettyRun to fire up jetty with your fresh baked website.

See https://github.com/ancho/calmdev-website for a configuration with different target environments (local, test and prod).

Member

ancho commented Nov 14, 2016

It is also possible to apply the gradle gretty plugin. For example:

plugins {
     id 'org.akhikhl.gretty' version '1.4.0'
}

 gretty {
     httpPort = 8881
     contextPath = "/blog/"
     extraResourceBases = ["build/jbake"]
 }

Run gradle jettyRun to fire up jetty with your fresh baked website.

See https://github.com/ancho/calmdev-website for a configuration with different target environments (local, test and prod).

@jmcgarr

This comment has been minimized.

Show comment
Hide comment
@jmcgarr

jmcgarr Nov 14, 2016

Contributor

Thanks for that @ancho.

I really wanted the jbake-gradle-plugin to take advantage of the new file watching features built into the Main.java. My hope is to land this fix so I can push that PR as well.

Contributor

jmcgarr commented Nov 14, 2016

Thanks for that @ancho.

I really wanted the jbake-gradle-plugin to take advantage of the new file watching features built into the Main.java. My hope is to land this fix so I can push that PR as well.

@ancho

This comment has been minimized.

Show comment
Hide comment
@ancho

ancho Nov 15, 2016

Member

gradle has a continuous build feature gradle -t. It watches for changes of the task inputs and runs the task again if something has changed.

See https://www.calmdevelopment.de/blog/2016/08/jbake-continuous-with-gradle.html

Member

ancho commented Nov 15, 2016

gradle has a continuous build feature gradle -t. It watches for changes of the task inputs and runs the task again if something has changed.

See https://www.calmdevelopment.de/blog/2016/08/jbake-continuous-with-gradle.html

@ancho

This comment has been minimized.

Show comment
Hide comment
@ancho

ancho Nov 15, 2016

Member

But don't get me wrong. It's still a bug and need to be fixed. Thank you for cleaning up and improving the application.

Member

ancho commented Nov 15, 2016

But don't get me wrong. It's still a bug and need to be fixed. Thank you for cleaning up and improving the application.

jonbullock added a commit that referenced this issue Jan 4, 2017

Merge pull request #316 from jmcgarr/fix/issue-314
Improve testability of Main.java while fixing issue #314

@jonbullock jonbullock added the bug label Jan 4, 2017

@jonbullock

This comment has been minimized.

Show comment
Hide comment
Member

jonbullock commented Jan 4, 2017

See #316

@jonbullock jonbullock closed this Jan 4, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment