play1 framework 유틸리티는 문서로 잘 설명되어 있지 않다.

이럴 때를 위해 play help 명령어를 실행한다.


$ play help

~        _            _

~  _ __ | | __ _ _  _| |

~ | '_ \| |/ _' | || |_|

~ |  __/|_|\____|\__ (_)

~ |_|            |__/

~

~ play! 1.4.2, https://www.playframework.com

~

~ For all commands, if the application is not specified, the current directory is used

~ Use 'play help cmd' to get more help on a specific command

~

~ Core commands:

~ ~~~~~~~~~~~~~~

~ antify          Create a build.xml file for this project

~ autotest        Automatically run all application tests

~ build-module    Build and package a module

~ check           Check for a release newer than the current one

~ classpath       Display the computed classpath

~ clean           Delete temporary files (including the bytecode cache)

~ dependencies    Resolve and retrieve project dependencies

~ eclipsify       Create all Eclipse configuration files

~ evolutions      Run the evolution check

~ evolutions:applyAutomatically apply pending evolutions

~ evolutions:markAppliedMark pending evolutions as manually applied

~ evolutions:resolveResolve partially applied evolution

~ help            Display help on a specific command

~ id              Define the framework ID

~ idealize        Create all IntelliJ Idea configuration files

~ install         Install a module

~ javadoc         Generate your application Javadoc

~ list-modules    List modules available from the central modules repository

~ modules         Display the computed modules list

~ netbeansify     Create all NetBeans configuration files

~ new             Create a new application

~ new-module      Create a module

~ out             Follow logs/system.out file

~ pid             Show the PID of the running application

~ precompile      Precompile all Java sources and templates to speed up application start-up

~ restart         Restart the running application

~ run             Run the application in the current shell

~ secret          Generate a new secret key

~ start           Start the application in the background

~ status          Display the running application's status

~ stop            Stop the running application

~ test            Run the application in test mode in the current shell

~ version         Print the framework version

~ war             Export the application as a standalone WAR archive

~

~ Also refer to documentation at https://www.playframework.com/documentation



status가 궁금하다면, 다음 명령어를 사용한다.


$ play help status

~        _            _

~  _ __ | | __ _ _  _| |

~ | '_ \| |/ _' | || |_|

~ |  __/|_|\____|\__ (_)

~ |_|            |__/

~

~ play! 1.4.2, https://www.playframework.com

~

~ Name:

~ ~~~~~

~ status -- Display the running application's status

~

~ Alias:

~ ~~~~~

~ st

~

~ Synopsis:

~ ~~~~~~~~~

~ play status [app_path] [--url=http://...] [--secret=...]

~

~ Description:

~ ~~~~~~~~~~~~

~ This script tries to connect to the running application's /@status URL to request the application status.

~ The application status contains useful informations about the running application.

~

~ The status command is aimed at monitoring applications running on production servers.

~

~ Options:

~ ~~~~~~~~

~ --url:

~ The script try to connect to the application at the localhost domain. If you want to monitor an application running on

~ a remote server, specify the application URL using this option (eg. play status --url=http://myapp.com)

~

~ --secret:

~ The script uses the secret key to generate an authorization token. It assumes that the secret key available from the

~ app_path/conf/application.conf is valid. If not you can provide your own secret key using this option

~ (eg. play status --secret=bghjT7ZG7ZGCO8)

~

~ If you provide both options, you can run this command without a local application directory (app_path is not required).

~


프로젝트 디렉토리에서 다음 커맨드를 실행한다.


$ play status --url=http://127.0.0.1:9000

~        _            _

~  _ __ | | __ _ _  _| |

~ | '_ \| |/ _' | || |_|

~ |  __/|_|\____|\__ (_)

~ |_|            |__/

~

~ play! 1.4.2, https://www.playframework.com

~

~ Status from http://127.0.0.1:19000/@status,

~

Java:

~~~~~

Version: 1.8.0_40

Home: /usr/java/jdk1.8.0_40/jre

Max memory: 438304768

Free memory: 36274240

Total memory: 233832448

Available processors: 2

Play framework:

~~~~~~~~~~~~~~~

Version: 1.4.2

Path: /usr/local/play-1.4.2

ID: beta

Mode: PROD

Tmp dir: xxxxxxx


Application:

~~~~~~~~~~~~

Path: xxxxx

Name: play-server

Started at: 06/13/2016 22:23


Loaded modules:

~~~~~~~~~~~~~~

spring at xxxxx


Loaded plugins:

~~~~~~~~~~~~~~

0:play.CorePlugin [enabled]

1:play.ConfigurationChangeWatcherPlugin [disabled]

10:play.modules.router.ext.YetAnotherRouterAnnotationsPlugin [enabled]

100:play.data.parsing.TempFilePlugin [enabled]

200:play.data.validation.ValidationPlugin [enabled]

300:play.db.DBPlugin [enabled]

400:play.db.jpa.JPAPlugin [enabled]

450:play.db.Evolutions [enabled]

500:play.i18n.MessagesPlugin [enabled]

600:play.libs.WS [enabled]

700:play.jobs.JobsPlugin [enabled]

1000:play.modules.spring.SpringPlugin [enabled]

100000:play.plugins.ConfigurablePluginDisablingPlugin [enabled]

Threads:
~~~~~~~~
Thread[Reference Handler,10,system] WAITING
Thread[Finalizer,8,system] WAITING
Thread[Signal Dispatcher,9,system] RUNNABLE
Thread[RMI TCP Accept-0,5,system] RUNNABLE
Thread[RMI TCP Accept-19100,5,system] RUNNABLE
Thread[RMI TCP Accept-0,5,system] RUNNABLE
......
Thread[nifty-client-worker-2,5,main] RUNNABLE
Thread[nifty-client-worker-3,5,main] RUNNABLE

Requests execution pool:
~~~~~~~~~~~~~~~~~~~~~~~~
Pool size: 256
Active count: 0
Scheduled task count: 1936
Queue size: 0

Monitors:

~~~~~~~~

AController.list()                             ->      121 hits;    226.6 avg;    116.0 min;    707.0 max;

........


Jobs execution pool:

~~~~~~~~~~~~~~~~~~~

Pool size: 0

Active count: 0

Scheduled task count: 0

Queue size: 0




만약 play 커맨드를 알고 싶다면, 다음 소스를 살펴본다.


https://github.com/playframework/play1/tree/master/framework/pym/play/commands


만약 status에 대해서 깊이 알고 싶다면,

CorePlugin.java와  https://github.com/playframework/play1/blob/master/framework/pym/play/commands/status.py를 살펴본다.

실제 url이  url = 'http://localhost:%s/@status' % http_port 인 것을 볼 수 있다.



Posted by '김용환'
,



ivy 기반 빌드 프로젝트는 ~/.ivy 디렉토리를 사용한다. 

예를 들어, play1 framework는 ~/.ivy/cache 디렉토리에 저장된 의존 lib가 저장된다. 


예를 들어, org.apache.httpcomponents.httpcore는 아래와 같이 저장된다.

~/.ivy2/cache/org.apache.httpcomponents/httpcore


$ ls

ivy-4.2.4.xml            ivy-4.3.3.xml.original   ivy-4.4.4.xml            ivydata-4.3.3.properties jars

ivy-4.2.4.xml.original   ivy-4.4.1.xml            ivy-4.4.4.xml.original   ivydata-4.4.1.properties sources

ivy-4.3.3.xml            ivy-4.4.1.xml.original   ivydata-4.2.4.properties ivydata-4.4.4.properties



디렉토리에는 버전 별 xml 파일, xml.original 파일, jars, sources가 있다.


xml.original 파일은 pom 다음과 같다. 


$ cat ivy-4.4.4.xml.original


<?xml version="1.0" encoding="UTF-8"?>

<!--

   ====================================================================

   Licensed to the Apache Software Foundation (ASF) under one

   or more contributor license agreements.  See the NOTICE file

   distributed with this work for additional information

   regarding copyright ownership.  The ASF licenses this file

   to you under the Apache License, Version 2.0 (the

   "License"); you may not use this file except in compliance

   with the License.  You may obtain a copy of the License at


     http://www.apache.org/licenses/LICENSE-2.0


   Unless required by applicable law or agreed to in writing,

   software distributed under the License is distributed on an

   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

   KIND, either express or implied.  See the License for the

   specific language governing permissions and limitations

   under the License.

   ====================================================================


   This software consists of voluntary contributions made by many

   individuals on behalf of the Apache Software Foundation.  For more

   information on the Apache Software Foundation, please see

   <http://www.apache.org />.

 --><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

  <modelVersion>4.0.0</modelVersion>

  <parent>

    <groupId>org.apache.httpcomponents</groupId>

    <artifactId>httpcomponents-core</artifactId>

    <version>4.4.4</version>

  </parent>

  <artifactId>httpcore</artifactId>

  <name>Apache HttpCore</name>

  <inceptionYear>2005</inceptionYear>

  <description>

   Apache HttpComponents Core (blocking I/O)

  </description>

  <url>http://hc.apache.org/httpcomponents-core-ga</url>

  <packaging>jar</packaging>

...




ivy는 ivy 기반의 xml로 변경한다.


$ cat ivy-4.4.4.xml

<?xml version="1.0" encoding="UTF-8"?>

<ivy-module version="2.0" xmlns:m="http://ant.apache.org/ivy/maven">

<info organisation="org.apache.httpcomponents"

module="httpcore"

revision="4.4.4"

status="release"

publication="20151027021814"

>

<description homepage="http://hc.apache.org/httpcomponents-core-ga">

Apache HttpComponents Core (blocking I/O)

</description>

<m:properties__api.comparison.version>4.4</m:properties__a

...


메타정보는 properties에 정의된다.


$ cat ivydata-4.4.4.properties

#ivy cached data file for org.apache.httpcomponents#httpcore;4.4.4

#Mon Jun 13 22:10:57 KST 2016

artifact\:httpcore\#pom.original\#pom\#-401045955.exists=true

artifact\:httpcore\#jar\#jar\#-2053608617.original=artifact\:httpcore\#jar\#jar\#-2053608617

artifact\:httpcore\#pom.original\#pom\#-401045955.original=artifact\:httpcore\#pom.original\#pom\#-401045955

artifact\:ivy\#ivy\#xml\#-726796163.location=https\://repo1.maven.org/maven2/org/apache/httpcomponents/httpcore/4.4.4/httpcore-4.4.4.pom

artifact\:httpcore\#pom.original\#pom\#-401045955.is-local=false

resolver=mavenCentral

artifact\:ivy\#ivy\#xml\#-726796163.exists=true

artifact\:httpcore\#pom.original\#pom\#-401045955.location=https\://repo1.maven.org/maven2/org/apache/httpcomponents/httpcore/4.4.4/httpcore-4.4.4.pom

artifact\:httpcore\#jar\#jar\#-2053608617.location=https\://repo1.maven.org/maven2/org/apache/httpcomponents/httpcore/4.4.4/httpcore-4.4.4.jar

artifact\:ivy\#ivy\#xml\#-726796163.is-local=false

artifact\:httpcore\#source\#jar\#-410049307.original=artifact\:httpcore\#source\#jar\#-410049307

artifact\:httpcore\#jar\#jar\#-2053608617.exists=true

artifact\:httpcore\#jar\#jar\#-2053608617.is-local=false

artifact\:ivy\#ivy\#xml\#-726796163.original=artifact\:httpcore\#pom.original\#pom\#-401045955

artifact\:httpcore\#source\#jar\#-410049307.exists=true

artifact\:httpcore\#source\#jar\#-410049307.is-local=false

artifact.resolver=mavenCentral

artifact\:httpcore\#source\#jar\#-410049307.location=https\://repo1.maven.org/maven2/org/apache/httpcomponents/httpcore/4.4.4/httpcore-4.4.4-sources.ja



만약 ivy 컴파일일 실패하면, jars에 jar가 있는지. properties,xml, xml.original 파일이 존재하는지 확인해본다.


참고

ivy 파일 이슈를 해결해도

컴파일 안되면, maven repository 이슈이다.



참고

https://theholyjava.wordpress.com/2011/01/26/using-ivy-with-pom-xml/

Posted by '김용환'
,