前提・実現したいこと
EC2上でmavenを実行してjarファイルを生成したのですが、
上手くいきません。
調べているとjasperとitextの依存関係がおかしい?ような気がするのですが。。
実行したコマンドはこちらです↓
mvn clean dependency:copy-dependencies -DoutputDirectory=lib antrun:run package
Eclipseで実行の構成からゴールを上記の引数にしてビルドを実行するとエラーなくjarが生成されます。
EC2上だと上手くいきません。
何か分かる方がいればご回答よろしくお願いします。
発生している問題・エラーメッセージ
[INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 14.679 s [INFO] Finished at: 2021-08-10T08:02:58+09:00 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal on project demo: Could not resolve dependencies for project com.example:demo:jar:0.0.1-SNAPSHOT: The following artifacts could not be resolved: org.olap4j:olap4j:jar:0.9.7.309-JS-3, com.lowagie:itext:jar:2.1.7.js2: Could not find artifact org.olap4j:olap4j:jar:0.9.7.309-JS-3 in central (https://repo.maven.apache.org/maven2) -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
pom.xml
1<?xml version="1.0" encoding="UTF-8"?> 2<project xmlns="http://maven.apache.org/POM/4.0.0" 3 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 4 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> 5 <modelVersion>4.0.0</modelVersion> 6 <parent> 7 <groupId>org.springframework.boot</groupId> 8 <artifactId>spring-boot-starter-parent</artifactId> 9 <version>2.3.3.RELEASE</version> 10 <relativePath /> <!-- lookup parent from repository --> 11 </parent> 12 <groupId>com.example</groupId> 13 <artifactId>demo</artifactId> 14 <version>0.0.1-SNAPSHOT</version> 15 <name>demo</name> 16 <description>Demo project for Spring Boot</description> 17 18 <properties> 19 <java.version>11</java.version> 20 </properties> 21 22 <dependencies> 23 24 <!-- 自動ビルド --> 25 <dependency> 26 <groupId>org.springframework.boot</groupId> 27 <artifactId>spring-boot-devtools</artifactId> 28 </dependency> 29 30 <dependency> 31 <groupId>org.springframework.boot</groupId> 32 <artifactId>spring-boot-starter-web</artifactId> 33 </dependency> 34 35 <dependency> 36 <groupId>org.springframework.boot</groupId> 37 <artifactId>spring-boot-starter-test</artifactId> 38 <scope>test</scope> 39 <exclusions> 40 <exclusion> 41 <groupId>org.junit.vintage</groupId> 42 <artifactId>junit-vintage-engine</artifactId> 43 </exclusion> 44 </exclusions> 45 </dependency> 46 <dependency> 47 <groupId>org.springframework.boot</groupId> 48 <artifactId>spring-boot-starter-thymeleaf</artifactId> 49 </dependency> 50 51 <!-- データベースアクセス --> 52 <dependency> 53 <groupId>org.springframework.boot</groupId> 54 <artifactId>spring-boot-starter-data-jpa</artifactId> 55 </dependency> 56 <dependency> 57 <groupId>org.postgresql</groupId> 58 <artifactId>postgresql</artifactId> 59 <scope>runtime</scope> 60 </dependency> 61 <dependency> 62 <groupId>org.springframework.boot</groupId> 63 <artifactId>spring-boot-starter-jdbc</artifactId> 64 </dependency> 65 66 <dependency> 67 <groupId>org.webjars</groupId> 68 <artifactId>momentjs</artifactId> 69 <version>2.24.0</version> 70 </dependency> 71 <dependency> 72 <groupId>org.webjars</groupId> 73 <artifactId>tempusdominus-bootstrap-4</artifactId> 74 <version>5.1.2</version> 75 </dependency> 76 77 <!-- Jasper Report --> 78 <dependency> 79 <groupId>net.sf.jasperreports</groupId> 80 <artifactId>jasperreports</artifactId> 81 <version>6.1.0</version> 82 </dependency> 83 <!-- Jasper Report --> 84 <dependency> 85 <groupId>org.apache.tomcat.embed</groupId> 86 <artifactId>tomcat-embed-jasper</artifactId> 87 </dependency> 88 89 <!-- バリデーション --> 90 <dependency> 91 <groupId>javax.validation</groupId> 92 <artifactId>validation-api</artifactId> 93 </dependency> 94 <dependency> 95 <groupId>org.hibernate</groupId> 96 <artifactId>hibernate-validator</artifactId> 97 <version>5.2.4.Final</version> 98 </dependency> 99 100 <!-- lombok --> 101 <dependency> 102 <groupId>org.projectlombok</groupId> 103 <artifactId>lombok</artifactId> 104 <scope>provided</scope> 105 </dependency> 106 107 <!-- secutiry config --> 108 <dependency> 109 <groupId>org.springframework.security</groupId> 110 <artifactId>spring-security-core</artifactId> 111 </dependency> 112 <dependency> 113 <groupId>org.springframework.security</groupId> 114 <artifactId>spring-security-web</artifactId> 115 </dependency> 116 <dependency> 117 <groupId>org.springframework.security</groupId> 118 <artifactId>spring-security-config</artifactId> 119 </dependency> 120 121 <dependency> 122 <groupId>org.springframework.session</groupId> 123 <artifactId>spring-session-jdbc</artifactId> 124 </dependency> 125 126 <!-- thymeleafがSpringSecurityのroleを参照するようにする為の設定 --> 127 <dependency> 128 <groupId>org.thymeleaf.extras</groupId> 129 <artifactId>thymeleaf-extras-springsecurity5</artifactId> 130 </dependency> 131 132 <!-- https://mvnrepository.com/artifact/com.opencsv/opencsv --> 133 <dependency> 134 <groupId>com.opencsv</groupId> 135 <artifactId>opencsv</artifactId> 136 <version>5.4</version> 137 </dependency> 138 139 <!-- https://mvnrepository.com/artifact/com.lowagie/itext --> 140 <dependency> 141 <groupId>com.lowagie</groupId> 142 <artifactId>itext</artifactId> 143 <version>2.1.7.js2</version> 144 </dependency> 145 146 </dependencies> 147 148 <build> 149 <finalName>bankbank</finalName> 150 <plugins> 151 <plugin> 152 <groupId>org.springframework.boot</groupId> 153 <artifactId>spring-boot-maven-plugin</artifactId> 154 </plugin> 155 <plugin> 156 <groupId>org.apache.maven.plugins</groupId> 157 <artifactId>maven-antrun-plugin</artifactId> 158 <configuration> 159 <target> 160 <echo message="copy files" /> 161 <property name="fileDir" value="src/main/resources" /> 162 <copy file="${fileDir}/prod.application.properties" 163 tofile="${fileDir}/application.properties" overwrite="true" /> 164 </target> 165 </configuration> 166 </plugin> 167 </plugins> 168 </build> 169</project>
補足情報(FW/ツールのバージョンなど)
Apache Maven 3.6.3
回答2件
あなたの回答
tips
プレビュー