Skip to main content

Mavenで配布用アーカイブ作成

■アセンブリ記述子を作成
1.src/main/assembly ディレクトリにxmlファイルを作成
フォーマットをzipに指定すると、zipで作られる。
ここで配布するためのファイルやフォルダを指定してzipに含めるように設定する。

2.pom.xmlにアセンブリ記述子の追加
1で設定したxmlを読み込むよう追記

3.アーカイブの作成
eclipseで実行>実行の構成
Maven buildの新規構成で以下の内容を入力して、実行をクリック
基底ディレクトリー:現プロジェクトを選択
ゴール:assembly:assembly

targetディレクトリにアーカイブのzipファイルが作られていることを確認する。


■サーバーでJava実行
1.アーカイブをサーバーにアップロード
WinSCPを使用してzipファイルをサーバーに上げる。

2.アーカイブの解凍
unzip example-project-1.0-distibution.zip

3.解凍したフォルダを所定の位置に移動
mv example-project-1.0 /usr/local/example-project-1.0

4.所有者の変更
Javaを実行するユーザに変更する。
chown -R linux:linux /usr/local/example-project-1.0

5.プロジェクトの設定ファイルを変更
viで必要な設定ファイルの内容を変更する。

6.Java実行
スクリプトを叩くなり、Shellを走らせるなり
プロジェクトの実行方法に沿って実施。


○参考サイト
http://www.techscore.com/tech/Java/ApacheJakarta/Maven/7-2/

Comments

Popular posts from this blog

Postgresに初期データを投入

1.Linuxユーザの作成 postgresで設定したユーザをLinuxユーザとしても追加する必要があります。 これをしないとCOPYが実行できません。 adduser postgresusr 2.CSVファイルの配置 WinSCPを使用してCSVファイルをアップロード 所定のフォルダにCSVファイルを配置する。 3.CSVファイルへの権限付与 CSVファイルに権限付与を実施。 chmod -R 777 /home/linux/data (全権限付与でなくても実行可能なはず) 4.Postgresにログイン psql -h localhost -U postgresusr -d postgresdb 3.COPYコマンド実行 COPY TEST FROM '/home/linux/data/test.csv' WITH CSV; 4.SQLファイル実行 \i /home/linux/data/template.sql ○参考サイト http://www.dbonline.jp/postgresql/connect/index2.html http://okwave.jp/qa/q6807324.html http://itpro.nikkeibp.co.jp/article/COLUMN/20060227/230728/ http://homepage3.nifty.com/nasunu-i/LinuxBeginner/Permission.htm http://sasuke.main.jp/postgrescmd.html

How to deploy your PHP and Java file in PHP/JavaBridge

Here I explain how to deploy your PHP and Java file in your PHP/JavaBridge folder. You may need basic knowledge of Linux command, PHP , Java , Tomcat . Please use the link below to go to further reading if necessary. I. How to install Java II. How to install Tomcat III. How to install PHP and CGI IV. How to deploy PHP/JavaBridge V. How to deploy your PHP and Java files V. Deploy your PHP and Java file In this chapter, I will not talk detail about how to create and run Java . If you are curious about how to create PHP that executes Java , check PHP/JavaBridge site. 1. Create Java Hello World 1.1. Open eclipse and create Java Project . 1.2. Create HelloWorld.java file under the project. import javax.swing.JOptionPane; public class HelloWorld {     public static final String JAVABRIDGE_PORT="8080";     static final php.java.bridge.JavaBridgeRunner runner = php.java.bridge.JavaBridgeRunner.getInstance(JAVABRIDGE_PORT);     public stat...

How to install Java on your Mac 

Here I explain about how to install Java on your . You may need basic knowledge of Linux command, PHP , Java , Tomcat . Please use the link below to go to further reading if necessary. I. How to install Java II. How to install Tomcat III. How to install PHP and CGI IV. How to deploy PHP/JavaBridge V. How to deploy your PHP and Java files I. How to install Java 1. Download JDK Install most up-to-date JDK from Oracle site . Click downloaded dmg file and follow the guidance. Please follow the step explain this site if you have problem following the instruction. 2. Set up JAVA_HOME 2.1. Open Terminal and enter the following command. vim ~/.bash_profile 2.2. Enter  i  to change to insert mode. 2.3. Add JAVA_HOME as follow. export JAVA_HOME=/Library/Java/JavaVirtualMachines/{your JDK folder}/Contents/Home 2.4. Press esc button and enter  :wq  to save and quit the .bash_profile . 2.5. Enter the command below to update bash source .bash_p...