2016-02-25 39 views
-1

我正在./run.shAlfresco的所有功能於一體擴展,但我得到了錯誤:run.sh - 包X不存在

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.2:compile (default-compile) on project repo-amp: Compilation failure: Compilation failure:

[ERROR] /home/user/signextension/sign/repo-amp/src/main/java/pt/empt/sign/fields/CreateFields.java:[3,25] package com.itextpdf.text does not exist

[ERROR] /home/user/signextension/sign/repo-amp/src/main/java/pt/empt/sign/fields/CreateFields.java:[4,25] package com.itextpdf.text does not exist

[ERROR] /home/user/signextension/sign/repo-amp/src/main/java/pt/empt/sign/fields/CreateFields.java:[5,1] package com.itextpdf.text.pdf does not exist

run.sh

#!/bin/bash 
# Downloads the spring-loaded lib if not existing and runs the full all-in-one 
# (Alfresco + Share + Solr) using the runner project 
springloadedfile=~/.m2/repository/org/springframework/springloaded/1.2.3.RELEASE/springloaded-1.2.3.RELEASE.jar 

if [ ! -f $springloadedfile ]; then 
mvn validate -Psetup 
fi 
MAVEN_OPTS="-javaagent:$springloadedfile -noverify -Xms256m -Xmx2G" mvn clean install -Prun 

我試試這個:

#!/bin/bash 
# Downloads the spring-loaded lib if not existing and runs the full all-in-one 
# (Alfresco + Share + Solr) using the runner project 
springloadedfile=~/.m2/repository/org/springframework/springloaded/1.2.3.RELEASE/springloaded-1.2.3.RELEASE.jar 
itextpdffile=~/.m2/repository/com/itextpdf/itextpdf/5.5.7/itextpdf-5.5.7.jar 

if [ ! -f $springloadedfile ] && [ ! -f $itextpdffile ]; then 
mvn validate -Psetup 
fi 
MAVEN_OPTS="-javaagent:$springloadedfile -javaagent:$itextpdffile -noverify -Xms256m -Xmx2G" mvn clean install -Prun 

但我得到了錯誤:

Failed to find Premain-Class manifest attribute in /home/user/.m2/repository/com/itextpdf/itextpdf/5.5.7/itextpdf-5.5.7.jar Error occurred during initialization of VM agent library failed to init: instrument

任何幫助解決這個問題?

回答

2

該itext庫不是一個javaagent庫,檢查this link瞭解更多關於java代理和它們的意義是什麼!

到iText的依賴關係添加到項目中的正確方法是加入這個片段:

<dependency> 
    <groupId>com.itextpdf</groupId> 
    <artifactId>itextpdf</artifactId> 
    <version>5.5.7</version> 
</dependency> 

到主pom.xml文件(或回購放大器的pom.xml或者)(相關內容部分)。當然,請回滾您對run.sh文件所做的任何更改!

+0

我已經嘗試了這個主要的pom.xml,但不起作用。我現在嘗試在repo-amp pom.xml中,我認爲解決了:)謝謝!你知道爲什麼這不起作用? – PRVS