Playframework dist does not support sub projects? - playframework-2.2

Currently on 2.2.1. Ive got a play project with 2 play sub projects setup as shown on:
http://www.playframework.com/documentation/2.2.x/SBTSubProjects
I've got a main route file and routes files for each of the sub projects.
Routes:
GET / controllers.Application.index
-> /app admin.Routes
-> /workflow workflow.Routes
GET /assets/*file controllers.Assets.at(path="/public", file)
admin.routes
GET /abcd controllers.someController
When I do a play run, everything seems to work as expected. I can hit the abcd controller via
/app/abcd
When I do a play dist, it seems like the routes file running is not from the top level play server but from one of the sub-projects and I only see routes from the admin subproject and the path is incorrect:
/abcd
Question is, does dist support sub projects? If so, how do I debug whats going on here?

It should support submodules. There's a known issue related to sbt described here:
https://groups.google.com/forum/#!topic/play-framework/QavYYDJVdMI
But it should have been fixed.
You can look at the the version of sbt in your project like this:
<your-app-dir>/project$ cat build.properties
sbt.version=0.13.0

Related

how can i create project by chromium gn tools?

install depot_tool then following the gn guide and standalone guide, but i always get error "gn.py: Could not find checkout in any parent of the current path."
so my problem is :
how to create the gn project which is not using chromium sub project, eg: only one function like helloword?
how to create the gn project which is using chromium sub project like v8/pdfium, eg: one console project is using pdfium to read pdf page count.?
I'm not completely sure from the error you describe but it sounds like you don't have a .gn file in the root.
I recently started getting into gn and made a simple starter project: https://github.com/aellerton/experiment-learn-gn
The first thing I didn't expect was the need to have a root .gn file, and that the file needs to point to the root config: https://github.com/aellerton/experiment-learn-gn/blob/master/.gn
The second thing I didn't expect was the need to provide an entire toolchain. I kind of like this now as it gives me full power. I used this one here, by making it a git submodule as the author suggests: https://github.com/timniederhausen/gn-build
Then building a trivial Hello World console program was straightforward.

Load Vue Component from ouside src directory

I have a project started with the vue-cli, and i'd love to include a component from a different local folder. I'm not that great at webpack config, so I'm not sure if it's just as simple as adding another path to some config setting. I've looked around in the docs, but everything I'm finding shows me the awesome auto scaffolding that vue init project gives us.
Any ideas?
Here's what the project structure looks like:
webroot/
-wp-content/
-wp-admin/
-wp-includes/
-other PHP classes/
-static/
-vue/
-global-components/ (<- this is where i'd like to put some generic .vue components)
-app1/ (<- this was created by vue-cli and is where i'd like to build a specific vue app for a specific wordpress page/post)
-app2/ (<- this was created by vue-cli and is where i'd like to build a different app for a specific wordpress page/post)
So, you can see there's a bunch of things going on in this repo, and I'd like to be able to reference both the src folder inside app1 and app2, but also have each app reference the global-components folder. I'm not sure that the client would like to push their custom components up to npm, and I don't think they want to build out their own private npm source, so I was hoping for a way to build multiple vue.js applications without copying these components to each individual app.
Any thoughts?

"go build ./..." cannot find package

I know internet full of similar issues and I tried all of suggested solutions, but can't figure out it at least 2 days.
I trying to deploy little Go server I using IntelliJ IDEA and it works great, it can build/run my code, but if I use terminal as example:
go build ./...
I see something like that:
OS-X-Dennis:backend denis$ go build ./...
out/production/mypocket_backend/server.go:4:2: cannot find package "api.jwt.auth/routers" in any of:
/usr/local/go/src/api.jwt.auth/routers (from $GOROOT)
/Users/denis/Programming/Golang/src/api.jwt.auth/routers (from $GOPATH)
OS X 10.11.2, IntelliJ IDEA 2016.1
$GOPATH = "Users/denis/Programming/Golang"
$GOROOT = "/usr/local/go"
$PATH = "$PATH:$GOPATH/bin"
These paths are correct?
Here is my work structure:
/Golang/
.bin/
.pkg/
.darwin-amd64/
.//other folders/
.src/
.github.com/
.backend/ //project's source
/src
/api.jwt.auth/
//source code
.server.go - file with main func
//other files as example .gitignore
.//other folders//
Here is my screen of main file and whole project-structure:
I see that logs show me wrong path to my project.
now
/Users/denis/Programming/Golang/src/api.jwt.auth/routers
should
/Users/denis/Programming/Golang/src/backend/src/api.jwt.auth/routers
I don't know where I should correct this path.
Your GOPATH can have multiple directories in it.
If you truly want your backend directory to be a path of some of your Go libraries, in addition to your existing path of /Users/denis/Programming/Golang you can set your GOPATH to: /Users/denis/Programming/Golang:/Users/denis/Programming/Golang/src/backend
This will cause import statements to search for source files in both the /Users/denis/Programming/Golang/src directory and the /Users/denis/Programming/Golang/src/backend/src directory.
I would personally recommend moving your api.jwt.auth folder to /Users/denis/Programming/Golang/src/api.jwt.auth to keep your source all in one area, but having two different directories in your GOPATH as suggested above will work too.
To understand GOPATH better, you can simply type go help gopath. Also a quickstart is here

After migration to 2.2.1, all public assets, including javascripts and css return 404 in PROD mode

I migrated to 2.2.1 one week ago and I am encountring some serious issues, my project worked fine in 2.1.5.
Since earliest play2 versions, I have been using the following procedure to access my public assets (copy pasted from the official doc):
-> routes file :
GET /assets/*file controllers.Assets.at(path="/public", file)
in template file:
<link href="#{routes.Assets.at("stylesheets/bootstrap.css")}" rel="stylesheet">
without any problem.
However, now that I upgraded to 2.2.1, it's only working in DEV mode (play debug / run), in PROD, all my assets URLs return 404 errors.
I tought it was a packaging problem, checked the main jar file, I could see the public folder and the various *.js and *css files so they seem to be properly included. Also the generated URLs look clean :
http://localhost:9000/assets/stylesheets/bootstrap.css
I use a single module layout and develop on windows 7. I tried deploying on a linux debian 6 but had exactly the same issue.
I would appreciate any help, it seems that I am not the only one having this problem but no information about a possible fix yet... Reverting to 2.1.5 would be a difficult task because 2.2 introduced some serious incompatibilities in the API and required many code changes.
You should have /assets/*file instead of /assets*file in your routes file but I doubt this will resolve your problem.
If you have other specific routes for some assets, make sure the general GET /assets/*file is the last one in your routes file.
I finally found the cause of the problem by removing all dependencies from my project one by one.
One of the plugin I am using (Japid) was compiled with an earlier version of play 2.2.x and was incompatible with 2.2.1, that caused problems with assets routing.
Fortunately, japid author has been very responsive and fixed the issue. (see release 0.9.14.1)

How to install play! framework modules?

I'm trying to install this pagination module for my Play! application, but can't get it to work. I've extracted the zip file inside /play/modules/paginate-head/ and I an example here on SO, to change my dependencies.yml file into:
# Application dependencies
require:
- play
- pagination -> paginate-head
repositories:
- My modules:
type: local
artifact: ${application.path}/../[module]
contains:
- paginate-head
But I still don't think the module is being loaded. I'm assuming it's documentation should appear on http://localhost:9000/#documentation/home or are there other ways to see if a module was loaded? It's not telling me anything in the console neither.
Any ideas how to get this installed?
You don't need to extract a zip file, just running the command
play install paginate-head
should work fine. But unzipping will also work. You also don't need that "repositories" section in your dependencies.yml file. Play! knows where to find modules.
The real issue is that your require should look like this:
require:
- play
- play -> paginate head
Notice play to the left of the '->' which signifies that it's a module. Also no dash between 'paginate' and 'head'. That's because 'paginate' is the module name and 'head' is the version and these should be separated by a space.
Also, for modules that are hosted in the main Play! modules repo, you don't even have to install them. You can just add the require above and start Play! and it will install it automatically. Though it will install under the applications modules directory, not the play modules directory.
Hope that helps!