2017-03-07 1 views
1

jackson json 라이브러리를 사용하는 사용자 지정 프로세서를 만들었으므로 단위 테스트가 정상적으로 작동합니다.잭슨 종속성으로 인해 사용자 지정 프로세서 빌드가 실패합니다.

타겟 nar를 만들기 위해 빌드 할 프로젝트/모듈에 대해 다소 혼란스러워합니다.

프로세서 (받는다는) 프로젝트 pom.xml 파일은

이다 :

<?xml version="1.0" encoding="UTF-8"?> 
<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor 
license agreements. See the NOTICE file distributed with this work for additional 
information regarding copyright ownership. The ASF licenses this file to 
You under the Apache License, Version 2.0 (the "License"); you may not use 
this file except in compliance with the License. You may obtain a copy of 
the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required 
by applicable law or agreed to in writing, software distributed under the 
License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS 
OF ANY KIND, either express or implied. See the License for the specific 
language governing permissions and limitations under the License. --> 
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 
<modelVersion>4.0.0</modelVersion> 
<parent> 
<groupId>com.datalake</groupId> 
<artifactId>CDCNiFi</artifactId> 
<version>1.0-SNAPSHOT</version> 
</parent> 
<artifactId>nifi-NiFiCDCPoC-processors</artifactId> 
<packaging>jar</packaging> 
<dependencies> 
<dependency> 
<groupId>org.apache.nifi</groupId> 
<artifactId>nifi-api</artifactId> 
</dependency> 
<dependency> 
<groupId>org.apache.nifi</groupId> 
<artifactId>nifi-utils</artifactId> 
</dependency> 
<dependency> 
      <groupId>org.codehaus.jackson</groupId> 
      <artifactId>jackson-mapper-asl</artifactId> 
     </dependency>   
<dependency> 
<groupId>org.apache.nifi</groupId> 
<artifactId>nifi-mock</artifactId> 
<scope>test</scope> 
</dependency> 
<dependency> 
<groupId>org.apache.nifi</groupId> 
<artifactId>nifi-dbcp-service-api</artifactId> 
</dependency> 
<dependency> 
<groupId>org.slf4j</groupId> 
<artifactId>slf4j-simple</artifactId> 
<scope>test</scope> 
</dependency> 
<dependency> 
<groupId>junit</groupId> 
<artifactId>junit</artifactId> 
<scope>test</scope> 
</dependency> 
</dependencies> 
</project> 

NAR (받는다는) 프로젝트 pom.xml 파일이다 (?)

<?xml version="1.0" encoding="UTF-8"?> 
<!-- 
    Licensed to the Apache Software Foundation (ASF) under one or more 
    contributor license agreements. See the NOTICE file distributed with 
    this work for additional information regarding copyright ownership. 
    The ASF licenses this file to You under the Apache License, Version 2.0 
    (the "License"); you may not use this file except in compliance with 
    the License. You may obtain a copy of the License at 
    http://www.apache.org/licenses/LICENSE-2.0 
    Unless required by applicable law or agreed to in writing, software 
    distributed under the License is distributed on an "AS IS" BASIS, 
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
    See the License for the specific language governing permissions and 
    limitations under the License. 
--> 
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 
    <modelVersion>4.0.0</modelVersion> 
    <parent> 
     <groupId>com.datalake</groupId> 
     <artifactId>CDCNiFi</artifactId> 
     <version>1.0-SNAPSHOT</version> 
    </parent> 
    <artifactId>nifi-NiFiCDCPoC-nar</artifactId> 
    <version>1.0-SNAPSHOT</version> 
    <packaging>nar</packaging> 
    <properties> 
     <maven.javadoc.skip>true</maven.javadoc.skip> 
     <source.skip>true</source.skip> 
    </properties> 
    <dependencies> 
     <dependency> 
      <groupId>com.datalake</groupId> 
      <artifactId>nifi-NiFiCDCPoC-processors</artifactId> 
      <version>1.0-SNAPSHOT</version> 
     </dependency> 
    </dependencies> 
</project> 

부모 POM .xml

<?xml version="1.0" encoding="UTF-8"?> 
<!-- 
    Licensed to the Apache Software Foundation (ASF) under one or more 
    contributor license agreements. See the NOTICE file distributed with 
    this work for additional information regarding copyright ownership. 
    The ASF licenses this file to You under the Apache License, Version 2.0 
    (the "License"); you may not use this file except in compliance with 
    the License. You may obtain a copy of the License at 
    http://www.apache.org/licenses/LICENSE-2.0 
    Unless required by applicable law or agreed to in writing, software 
    distributed under the License is distributed on an "AS IS" BASIS, 
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
    See the License for the specific language governing permissions and 
    limitations under the License. 
--> 
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 
    <modelVersion>4.0.0</modelVersion> 
    <parent> 
     <groupId>org.apache.nifi</groupId> 
     <artifactId>nifi-nar-bundles</artifactId> 
     <version>1.1.1</version> 
    </parent> 
    <groupId>com.datalake</groupId> 
    <artifactId>CDCNiFi</artifactId> 
    <version>1.0-SNAPSHOT</version> 
    <packaging>pom</packaging> 
    <modules> 
     <module>nifi-NiFiCDCPoC-processors</module> 
     <module>nifi-NiFiCDCPoC-nar</module> 
    </modules> 

</project> 

부모 또는 프로세서 프로젝트를 만들려고 할 때 잭슨 오류가 발생합니다. 이유는 무엇인지 이해할 수 없습니다. 아들 라이브러리가로드 받고되지 않습니다

E:\NiFi\CDCNiFi\nifi-NiFiCDCPoC-proces 
sors>mvn clean install 
[INFO] Scanning for projects... 
[INFO] Inspecting build with total of 1 modules... 
[INFO] Installing Nexus Staging features: 
[INFO] ... total of 1 executions of maven-deploy-plugin replaced with nexus-st 
aging-maven-plugin 
[INFO] 
[INFO] ------------------------------------------------------------------------ 
[INFO] Building nifi-NiFiCDCPoC-processors 1.0-SNAPSHOT 
[INFO] ------------------------------------------------------------------------ 
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ nifi-NiFiCDCPoC-proces 
sors --- 
[INFO] Deleting E:\NiFi\CDCNiFi\nifi-N 
iFiCDCPoC-processors\target 
[INFO] 
[INFO] --- maven-enforcer-plugin:1.3.1:enforce (enforce-maven) @ nifi-NiFiCDCPoC 
-processors --- 
[INFO] 
[INFO] --- maven-remote-resources-plugin:1.5:process (default) @ nifi-NiFiCDCPoC 
-processors --- 
[INFO] 
[INFO] --- maven-resources-plugin:2.7:resources (default-resources) @ nifi-NiFiC 
DCPoC-processors --- 
[INFO] Using 'UTF-8' encoding to copy filtered resources. 
[INFO] Copying 1 resource 
[INFO] Copying 3 resources 
[INFO] 
[INFO] --- maven-compiler-plugin:3.2:compile (default-compile) @ nifi-NiFiCDCPoC 
-processors --- 
[INFO] Changes detected - recompiling the module! 
[INFO] Compiling 7 source files to E:\ 
NiFi\CDCNiFi\nifi-NiFiCDCPoC-processors\target\classes 
[INFO] ------------------------------------------------------------- 
[ERROR] COMPILATION ERROR : 
[INFO] ------------------------------------------------------------- 
[ERROR] E:\NiFi\CDCNiFi\nifi-NiFiCDCPo 
C-processors\src\main\java\com\datalake\processors\MyProcessor.java:[65,3 
3] error: package com.fasterxml.jackson.core does not exist 
[ERROR] E:\NiFi\CDCNiFi\nifi-NiFiCDCPo 
C-processors\src\main\java\com\datalake\processors\MyProcessor.java:[66,3 
7] error: package com.fasterxml.jackson.databind does not exist 
[ERROR] E:\NiFi\CDCNiFi\nifi-NiFiCDCPo 
C-processors\src\main\java\com\datalake\processors\MyProcessor.java:[250, 
10] error: cannot find symbol 
[ERROR] symbol: class ObjectMapper 
    location: class MyProcessor 
E:\NiFi\CDCNiFi\nifi-NiFiCDCPoC-proces 
sors\src\main\java\com\datalake\processors\MyProcessor.java:[250,42] erro 
r: cannot find symbol 
[ERROR] symbol: class ObjectMapper 
    location: class MyProcessor 
E:\NiFi\CDCNiFi\nifi-NiFiCDCPoC-proces 
sors\src\main\java\com\datalake\processors\MyProcessor.java:[279,21] erro 
r: cannot find symbol 
[INFO] 5 errors 
[INFO] ------------------------------------------------------------- 
[INFO] ------------------------------------------------------------------------ 
[INFO] BUILD FAILURE 
[INFO] ------------------------------------------------------------------------ 
[INFO] Total time: 4.179 s 
[INFO] Finished at: 2017-03-06T21:26:33+01:00 
[INFO] Final Memory: 27M/560M 
[INFO] ------------------------------------------------------------------------ 
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3. 
2:compile (default-compile) on project nifi-NiFiCDCPoC-processors: Compilation f 
ailure: Compilation failure: 
[ERROR] E:\NiFi\CDCNiFi\nifi-NiFiCDCPo 
C-processors\src\main\java\com\datalake\processors\MyProcessor.java:[65,3 
3] error: package com.fasterxml.jackson.core does not exist 
[ERROR] E:\NiFi\CDCNiFi\nifi-NiFiCDCPo 
C-processors\src\main\java\com\datalake\processors\MyProcessor.java:[66,3 
7] error: package com.fasterxml.jackson.databind does not exist 
[ERROR] E:\NiFi\CDCNiFi\nifi-NiFiCDCPo 
C-processors\src\main\java\com\datalake\processors\MyProcessor.java:[250, 
10] error: cannot find symbol 
[ERROR] symbol: class ObjectMapper 
[ERROR] location: class MyProcessor 
[ERROR] E:\NiFi\CDCNiFi\nifi-NiFiCDCPo 
C-processors\src\main\java\com\datalake\processors\MyProcessor.java:[250, 
42] error: cannot find symbol 
[ERROR] symbol: class ObjectMapper 
[ERROR] location: class MyProcessor 
[ERROR] E:\NiFi\CDCNiFi\nifi-NiFiCDCPo 
C-processors\src\main\java\com\datalake\processors\MyProcessor.java:[279, 
21] error: cannot find symbol 
[ERROR] -> [Help 1] 
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit 
ch. 
[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 rea 
d the following articles: 
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException 

답변

1

당신은 프로세서 (받는다는) 프로젝트 pom.xml에 아래의 종속성을 추가 할 필요가있다 :. -

<dependency> 
    <groupId>com.fasterxml.jackson.core</groupId> 
    <artifactId>jackson-core</artifactId> 
    <version>2.7.8</version> 
</dependency> 
+0

A가 이상한 비트 이클립스에서 컴파일 및 단위 테스트가 있음을 추가하지 않고 일, 난 그냥 다음을했다 : \t \t \t org.codehaus.jackson \t \t \t 잭슨 - 매퍼 -asl \t \t \t \t