【やりたいこと】
PdflibというPDF出力のサードパーティライブラリを使用したサンプルプロジェクトを仮想環境のサーバで動作させてみたいと思っています。Maven Installで生成されたwarに参照しているライブラリjarを含め、デプロイできる状態にしたいです。
【ぶつかっている問題】
こちらを参考に、ローカルのjarをwarに含める方法を試していますが、warを見てみると出力されていません。
ローカルサーバで動かしてもpdflibが解決できずエラーになります。
以下、pom.xmlの記述です。
xml
1<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 2 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 3 <modelVersion>4.0.0</modelVersion> 4 <groupId>lcreate</groupId> 5 <artifactId>javapdf</artifactId> 6 <packaging>war</packaging> 7 <version>0.0.1-SNAPSHOT</version> 8 <name>javapdf Maven Webapp</name> 9 <url>http://maven.apache.org</url> 10 <properties> 11 <java.version>1.8</java.version> 12 <maven.compiler.source>1.8</maven.compiler.source> 13 <maven.compiler.target>1.8</maven.compiler.target> 14 </properties> 15 <dependencies> 16 <dependency> 17 <groupId>junit</groupId> 18 <artifactId>junit</artifactId> 19 <version>3.8.1</version> 20 <scope>test</scope> 21 </dependency> 22 <!-- https://mvnrepository.com/artifact/javax.servlet/javax.servlet-api --> 23 <dependency> 24 <groupId>javax.servlet</groupId> 25 <artifactId>javax.servlet-api</artifactId> 26 <version>4.0.1</version> 27 <scope>provided</scope> 28 </dependency> 29 <!-- https://mvnrepository.com/artifact/javax.servlet.jsp/javax.servlet.jsp-api --> 30 <dependency> 31 <groupId>javax.servlet.jsp</groupId> 32 <artifactId>javax.servlet.jsp-api</artifactId> 33 <version>2.3.3</version> 34 <scope>provided</scope> 35 </dependency> 36 <!-- pdflibを組み込む --> 37 <dependency> 38 <groupId>com.pdflib</groupId> 39 <artifactId>pdflib</artifactId> 40 <version>1.0</version> 41 <scope>system</scope> 42 <systemPath>${basedir}/lib/pdflib.jar</systemPath> 43 </dependency> 44 </dependencies> 45 <build> 46 <finalName>javapdf</finalName> 47 <plugins> 48 <plugin> 49 <groupId>org.apache.maven.plugins</groupId> 50 <artifactId>maven-install-plugin</artifactId> 51 <executions> 52 <execution> 53 <id>install-external</id> 54 <phase>clean</phase> 55 <configuration> 56 <file>${basedir}/lib/pdflib.jar</file> 57 <repositoryLayout>default</repositoryLayout> 58 <groupId>com.pdflib</groupId> 59 <artifactId>pdflib</artifactId> 60 <version>1.0</version> 61 <packaging>jar</packaging> 62 <generatePom>true</generatePom> 63 </configuration> 64 <goals> 65 <goal>install-file</goal> 66 </goals> 67 </execution> 68 </executions> 69 </plugin> 70 </plugins> 71 </build> 72</project>
【ためしてみたこと】
Maven Cleanでローカルリポジトリにjarは出力されていました。
/Users/aaa/.m2/repository/com/pdflib
Maven installしてwarを見ると以下のようになっており、javapdf.war/WEB-INF/配下にlib/pdflib.jarが出力されていない状態です。
どうしたら、warにローカルのjarを含めて出力できるようになるでしょうか?
よろしくお願いします。
あなたの回答
tips
プレビュー