- Java 双重比较
- java - 比较器与 Apache BeanComparator
- Objective-C 完成 block 导致额外的方法调用?
- database - RESTful URI 是否应该公开数据库主键?
我刚开始使用 cxf,所以这可能是一个新手错误..
我正在阅读 soa governance in action 这本书,并下载了示例项目。
当我使用 cxf 从 wsdl 构建源代码时,它将源代码放置在 eclipse 的“目标”目录中。但这些是它创建的 java 文件,编译器似乎看不到它们,因此构建需要这些文件的应用程序失败并出现编译器错误。
我是否应该将“目标”中的生成源目录添加到构建路径或其他内容?
非常感谢!
编辑:彻底混淆了。这是 pom
<build>
<pluginManagement>
<plugins>
<!--This plugin's configuration is used to store Eclipse m2e settings
only. It has no influence on the Maven build itself. -->
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.codehaus.mojo</groupId>
<artifactId>
build-helper-maven-plugin
</artifactId>
<versionRange>[1.7,)</versionRange>
<goals>
<goal>add-source</goal>
</goals>
</pluginExecutionFilter>
<action>
<execute></execute>
</action>
</pluginExecution>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.apache.cxf</groupId>
<artifactId>
cxf-codegen-plugin
</artifactId>
<versionRange>[1.0,)</versionRange>
<goals>
<goal>wsdl2java</goal>
</goals>
</pluginExecutionFilter>
<action>
<execute></execute>
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<id>add-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>target/generated/cxf</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-codegen-plugin</artifactId>
<version>${cxf.version}</version>
<executions>
<execution>
<id>generate-sources</id>
<phase>generate-sources</phase>
<configuration>
<sourceRoot>${project.build.directory}/generated/cxf</sourceRoot>
<wsdlOptions>
<wsdlOption>
<wsdl>${basedir}/src/main/resources/contract/accountService.wsdl</wsdl>
</wsdlOption>
</wsdlOptions>
</configuration>
<goals>
<goal>wsdl2java</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxws</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxws</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxrs</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http-jetty</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.manning.ossoagov.chapter2</groupId>
<artifactId>traffic-service-general</artifactId>
<version>0.0.1-SNAPSHOT</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
</dependencies>
编辑:我也不清楚我应该如何构建它..?我将它作为 eclipse 中的 maven 构建运行,目标是生成源代码。这似乎产生了来源。但是我应该如何构建整个包呢?即使生成了源代码,它也不会编译..?非常感谢!
编辑:更新的 Maven 日志
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for org.manning.ossoagov.chapter2:traffic-service-remoting-WS:jar:0.0.1-SNAPSHOT
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: org.apache.cxf:cxf-rt-frontend-jaxws:jar -> duplicate declaration of version ${cxf.version} @ line 134, column 15
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Traffic Service WS Remoting 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- cxf-codegen-plugin:2.3.2:wsdl2java (generate-sources) @ traffic-service-remoting-WS ---
[INFO]
[INFO] --- build-helper-maven-plugin:1.7:add-source (add-source) @ traffic-service-remoting-WS ---
[INFO] Source directory: /Users/bw/Documents/workspace3/traffic-service-remoting-WS/target/generated/cxf added.
[INFO]
[INFO] --- maven-resources-plugin:2.4.3:resources (default-resources) @ traffic-service-remoting-WS ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 3 resources
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ traffic-service-remoting-WS ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.4.3:testResources (default-testResources) @ traffic-service-remoting-WS ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent! [INFO] Copying 1 resource
[INFO] [INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ traffic-service-remoting-WS ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.7.1:test (default-test) @ traffic-service-remoting-WS ---
[INFO] Surefire report directory: /Users/bw/Documents/workspace3/traffic-service-remoting-WS/target/surefire-reports
T E S T S
-------------------------------------------------------
There are no tests to run.
Results :
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO] --- maven-jar-plugin:2.3.1:jar (default-jar) @ traffic-service-remoting-WS ---
[INFO] Building jar: /Users/bw/Documents/workspace3/traffic-service-remoting-WS/target/traffic-service-remoting-WS-0.0.1-SNAPSHOT.jar
[INFO]
[INFO] --- maven-install-plugin:2.3.1:install (default-install) @ traffic-service-remoting-WS ---
[INFO] Installing /Users/bw/Documents/workspace3/traffic-service-remoting-WS/target/traffic-service-remoting-WS-0.0.1-SNAPSHOT.jar to /Users/bw/.m2/repository/org/manning/ossoagov/chapter2/traffic-service-remoting-WS/0.0.1-SNAPSHOT/traffic-service-remoting-WS-0.0.1-SNAPSHOT.jar
[INFO] Installing /Users/bw/Documents/workspace3/traffic-service-remoting-WS/pom.xml to /Users/bw/.m2/repository/org/manning/ossoagov/chapter2/traffic-service-remoting-WS/0.0.1-SNAPSHOT/traffic-service-remoting-WS-0.0.1-SNAPSHOT.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 8.179s
[INFO] Finished at: Tue Apr 16 07:49:17 BST 2013
[INFO] Final Memory: 11M/81M
[INFO] ------------------------------------------------------------------------
编辑:试图缩小范围。我有一个“Maven 问题”,“目标 org.apache.cxf:cxf-codegen-plugin:2.3.2:wsdl2java 的执行生成源失败。(org.apache.cxf:cxf-codegen-plugin:2.3.2 :wsdl2java:generate-sources:generate-sources)"
但是如果我转到命令行并执行 mvn org.apache.cxf:cxf-codegen-plugin:wsdl2java
然后我就成功了
是否有可能是 eclipse 的自动构建没有以相同的方式运行它?可能是警告..?
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for org.manning.ossoagov.chapter2:traffic-service-remoting-WS:jar:0.0.1-SNAPSHOT
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: org.apache.cxf:cxf-rt-frontend-jaxws:jar -> duplicate declaration of version ${cxf.version} @ line 134, column 15
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Traffic Service WS Remoting 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- cxf-codegen-plugin:2.3.2:wsdl2java (default-cli) @ traffic-service-remoting-WS ---
[INFO] Nothing to generate
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.868s
[INFO] Finished at: Tue Apr 16 09:37:40 BST 2013
[INFO] Final Memory: 6M/81M
[INFO] ------------------------------------------------------------------------
最佳答案
你应该将这个文件夹添加到类路径中,使用 maven 你可以这样做:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.4</version>
<executions>
<execution>
<id>add-wsdl-source</id>
<phase>process-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>${project.build.directory}/path/to/generated/sources</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
关于java - cxf 将源文件放在目标中但编译器看不到它们?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16029798/
我一直在尝试处理一个类项目,在该项目中我必须设置一个面向 GUI 的转换程序,并且我试图将数据从我的类的方法传递到 ActionListener,但监听器是告诉我文本字段不存在。它位于同一个包和类中,
我在服务器上有两个版本的 PHP(Centos 6.8) - 5.6 和 7.1 我的 Nginx 使用 php7.1,它不是默认的 PHP 解释器。 经过一番与 yum 的斗争后,我安装了 php7
我正在尝试为 BEAGLE 安装 OpenCL .首先,我下载了 intel_sdk_for_opencl_applications_2020.3.494.tar.gz 来自 here .然后我解压并
我想知道为什么我在 controlPanel 中看不到 topPanel 这是我的代码: import java.awt.BorderLayout; import java.awt.Color; im
在我的 urls.py 中,我有以下内容: urlpatterns = patterns('', # Examples: #url(r'^$', 'welcome_page.home'
非常感谢大家的帮助! 在 GetProductByID 下,我收到一条错误消息“int does not contain a definition for FirstOrDefault”。 using
1) 我已经通过 my computuer -> System variables; 设置了变量 CLASSPATH 2) 重新启动控制台并键入 echo %CLASSPATH%,CLASSPATH
我已经看过这篇文章了PHP doesn't see mysql extension ,但这对我没有帮助。 我使用: Windows Seven(在虚拟机中为 32 位,在真实电脑上为 64 位) 带
当我尝试通过输入 python3 来验证 Python3 是否可以看到 Django 时其次是 import django进入终端(这样我就可以打印 Django 的版本号),我得到以下错误: Tra
我已经使用 easy_install 安装了 pygraphviz但是当我启动 python 时出现错误: >>>import pygraphviz as pgv Traceback (most re
在向 Microsoft 报告之前,我想在这里问一下。我有一个问题,我无法看到我的 WinUI 3 应用程序的实时可视化树。我什至看不到应用程序内工具栏。我可以在 WPF 和 UWP 应用程序中看到,
我对缺乏基本的了解和 内。 我希望看到 39 个 svg 子元素,100 像素高,每个子元素中都有清晰的文本。 http://jsfiddle.net/pn5sj8ge/ 最佳答案 发生这种情况的原因
我正在尝试设置一个新的持续集成服务器,该服务器利用 Phing 和 PHPUnit 自动运行测试用例。 我已经用 Pear 安装了 Phing: pear channel-discover pear.
lua -e "print(package.path)" ./?.lua;/usr/share/lua/5.1/?.lua;/usr/share/lua/5.1/?/init.lua;/usr/lib
我刚刚从 https://github.com/llvm/llvm-project.git 安装了 clang++ 和 libc++ .尝试运行时: clang main.cpp -stdlib=li
我一直在使用 Highstock 图表,我注意到当图表中有很多点时,无法使用工具提示查看最后一个点: 您可以看到工具提示显示了 5 月 9 日的点,而还有一个显示 5 月 10 日的点(正如您在范围选
This question already has answers here: error_log message is truncated when using print_r (5个答案) 1年前
我在编写 Selenium 测试来检查我的应用程序时遇到问题。我想测试的是,当用户输入正确的登录名/密码时,会显示正确的页面并且用户已登录。 主要问题是我的登录表单是作为 AngularJS 指令生成
我正在尝试在 Azure 服务上发布我的 ASP.NET Core 应用程序。这有效,但是当我尝试使用应用程序功能时,我收到消息 Your App Service app is up and runn
在我的 ionic 应用程序中,我有一个功能,用户应该在应用程序的导航栏中看到水平点线,单击它们,然后应该出现一个弹出菜单,其中包含两个菜单项(添加到收藏夹并添加评论)。下图说明了我的观点。 问题是这
我是一名优秀的程序员,十分优秀!