С сегодняшнего дня мы больше не можем строить наш файл из яшмы. Для этого мы используем jasperreports-maven-plugin.Зачем нужен jasperreports-maven-plugin itext: itext: jar: 4.2.0?
В мавена 2.2.1, это было настроено так:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jasperreports-maven-plugin</artifactId>
<version>1.0-beta-2</version>
<executions>
<execution>
<goals>
<goal>compile-reports</goal>
</goals>
<configuration>
<sourceDirectory>${basedir}/src/main/resources/reports</sourceDirectory>
<outputDirectory>>${project.build.directory}/classes/reports</outputDirectory>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>net.sf.jasperreports</groupId>
<artifactId>jasperreports</artifactId>
<version>5.5.1</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>compile</scope>
</dependency>
</dependencies>
<configuration>
<sourceDirectory>C:\Windows\TEMP/src/main/resources/reports</sourceDirectory>
<outputDirectory>C:\Windows\TEMP\target/classes/reports</outputDirectory>
</configuration>
</plugin>
Но, как было сказано, так как сегодня, мы получили эту ошибку сборки:
...
Downloading: http://repo1.maven.org/maven2/itext/itext/4.2.0/itext-4.2.0.jar
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to resolve artifact.
Missing:
----------
1) itext:itext:jar:4.2.0
Try downloading the file manually from the project website.
Then, install it using the command:
mvn install:install-file -DgroupId=itext -DartifactId=itext -Dversion=4.2.0 -Dpackaging=jar -Dfile=/path/to/file
Alternatively, if you host your own repository you can deploy the file there:
mvn deploy:deploy-file -DgroupId=itext -DartifactId=itext -Dversion=4.2.0 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
Path to dependency:
1) org.codehaus.mojo:jasperreports-maven-plugin:maven-plugin:1.0-beta-2
2) jasperreports:jasperreports:jar:1.2.0
3) itext:itext:jar:4.2.0
Я думаю, что еще один вопрос (Dependency error in jasper-reports from itext) связано с его. И я попробовал решение Мехера использовать maven 3.2.3. Это похоже на решение, но мы не можем обновить (теперь) эту версию maven. Поэтому мне нужно другое решение для решения этой проблемы. Есть идеи? Я уже пытался исключить зависимости и использовать фиксированные версии, но мне не удалось добиться успеха в моей сборке. То, что я имею в виду следующее:
<!-- Compile jasper reports -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jasperreports-maven-plugin</artifactId>
<version>1.0-beta-2</version>
<configuration>
<sourceDirectory>${basedir}/src/main/resources/reports</sourceDirectory>
<outputDirectory>${project.build.directory}/classes/reports</outputDirectory>
</configuration>
<executions>
<execution>
<goals>
<goal>compile-reports</goal>
</goals>
<phase>generate-sources</phase>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jasperreports-maven-plugin</artifactId>
<version>1.0-beta-2</version>
<exclusions>
<exclusion>
<groupId>net.sf.jasperreports</groupId>
<artifactId>jasperreports</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>net.sf.jasperreports</groupId>
<artifactId>jasperreports</artifactId>
<version>5.5.1</version>
<exclusions>
<exclusion>
<groupId>com.lowagie</groupId>
<artifactId>itext</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.lowagie</groupId>
<artifactId>itext</artifactId>
<version>2.1.7</version>
</dependency>
</dependencies>
</plugin>
Почему плагин до сих пор ищет IText: IText: банку: 4.2.0? Любые идеи или предложения для решения этой проблемы?
Спасибо!
Я думаю, этого должно быть достаточно, чтобы заменить центральный URL-адрес репозитория. Он может просто использовать https - так что текущий url все еще: https://repo.maven.apache.org/maven2/ - поэтому в вас settings.xml добавьте репозиторий с id "central" и пусть он укажет на этот URL-адрес , itext все еще существует. – wemu
Итак, вы имеете в виду, что я могу найти itext 4.2.0 в этом репозитории? Я уже пробовал это, и его там нет. Вот почему я пытаюсь использовать фиксированную версию itext. – Joris
hm. Я думаю, что groupId неверен. itext: itext для версий с усыновителями. версии 4.2.x имеют com.lowagie: itext (groupId: artifactId). Я бы использовал «mvn help: dependency-tree», чтобы выяснить, откуда эта зависимость. Может быть, транзитивная зависимость в порядке, но она перезаписана чем-то в вашем собственном pom.xml – wemu