gpt4 book ai didi

maven - 通过 Maven Wagon WebDAV 提供程序将 Javadoc 部署到 NTLM 验证的服务器

转载 作者:行者123 更新时间:2023-12-01 15:14:54 26 4
gpt4 key购买 nike

我正在尝试使用 Maven 将我的 Javadoc(已成功创建)部署到 Sharepoint 服务器,这需要 NTLM 身份验证。我将 Maven Wagon 插件与 WebDAV 提供程序一起使用来执行此操作。我正在使用 m2eclipse 设置运行配置以在特定配置文件中执行目标。

我基本上是从我发现的关于这些工具的各种解决方案中拼凑出一个解决方案。听起来 Maven 目前可能根本不支持 NTLM,但其他​​页面建议该标记可能允许这样做。我还看到过在分发管理中指定部署站点的解决方案,这与 Apache 的使用页面相反。无论如何,我遇到了很多问题。

首先,当我从运行配置菜单(在“发布”配置文件中执行“干净”和“打包”)运行时,Wagon 插件包含在其中执行“wagon:upload”目标'package' 阶段,执行被忽略。它会创建项目 jar 和 Javadoc,并附加源代码,但 Wagon 插件不会执行。

我也曾尝试在单独创建 Javadoc 后自行运行“wagon:upload”目标,但我遇到了这个错误(在调试中):

[DEBUG] Configuring mojo org.codehaus.mojo:wagon-maven-plugin:1.0-beta-3:upload
from plugin realm ClassRealm[plugin>org.codehaus.mojo:wagon-maven-plugin:1.0-bet
a-3, parent: sun.misc.Launcher$AppClassLoader@11b86e7]
[DEBUG] Configuring mojo 'org.codehaus.mojo:wagon-maven-plugin:1.0-beta-3:upload
' with basic configurator -->
[DEBUG] (f) followSymLink = false
[DEBUG] (f) fromDir = C:\Documents and Settings\c40208\IBM\rationalsdp\CEC\cec
-diagnostics
[DEBUG] (f) optimize = false
[DEBUG] (f) project = MavenProject: com.mycompany.cec:cec-diagnostics:0.5.0-SNAPSH
OT @ C:\Documents and Settings\c40208\IBM\rationalsdp\CEC\cec-diagnostics\pom.xm
l
[DEBUG] (f) serverId = serverId
[DEBUG] (f) settings = org.apache.maven.execution.SettingsAdapter@11b86c7
[DEBUG] (f) skip = false
[DEBUG] (f) useDefaultExcludes = true
[DEBUG] -- end configuration --
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.687s
[INFO] Finished at: Fri Apr 13 08:54:34 EDT 2012
[INFO] Final Memory: 5M/15M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:wagon-maven-plugin:1.0-beta-3:u
pload (default-cli) on project cec-diagnostics: The parameters 'url' for goal or
g.codehaus.mojo:wagon-maven-plugin:1.0-beta-3:upload are missing or invalid -> [
Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal o
rg.codehaus.mojo:wagon-maven-plugin:1.0-beta-3:upload (default-cli) on project c
ec-diagnostics: The parameters 'url' for goal org.codehaus.mojo:wagon-maven-plug
in:1.0-beta-3:upload are missing or invalid
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:221)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje
ct(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje
ct(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBu
ild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(Lifecycl
eStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Laun
cher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.jav
a:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(La
uncher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:
352)
Caused by: org.apache.maven.plugin.PluginParameterException: The parameters 'url
' for goal org.codehaus.mojo:wagon-maven-plugin:1.0-beta-3:upload are missing or
invalid
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.populatePl
uginFields(DefaultMavenPluginManager.java:576)
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getConfigu
redMojo(DefaultMavenPluginManager.java:529)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(Default
BuildPluginManager.java:92)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:209)
... 19 more
[ERROR]
[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/PluginParamete
rException

我知道这是一个很复杂的问题,但有没有人有任何意见或建议可能对我有所帮助?

这是我的 POM 文件:

<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>
<groupId>com.mycompany.cec</groupId>
<artifactId>cec-diagnostics</artifactId>
<version>0.5.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>CEC Diagnostics Jar</name>
<description><![CDATA[Assertion capture and analysis library for Java]]]></description>
<inceptionYear>2011</inceptionYear>
<scm>
<developerConnection>scm:svn:(FQDN)/(path)</developerConnection>
<url>(FQDN)/(path)</url>
</scm>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring.framework.version>3.0.5.RELEASE</spring.framework.version>
<jar.plugin.version>2.4</jar.plugin.version>
<bundle.plugin.version>2.3.6</bundle.plugin.version>
<surefire.plugin.version>2.12</surefire.plugin.version>
<testng.version>6.3.1</testng.version>
<javadoc.plugin.version>2.8.1</javadoc.plugin.version>
<source.plugin.version>2.1.2</source.plugin.version>
<wagon.plugin.version>1.0-beta-3</wagon.plugin.version>
<project.info.reports.plugin.version>2.4</project.info.reports.plugin.version>
<site.plugin.version>3.0</site.plugin.version>
<pdf.plugin.version>1.2</pdf.plugin.version>
<confluence.plugin.version>3.1.3</confluence.plugin.version>
<confluence.root>http://confluence.sys.mycompany.com/confluence</confluence.root>
<confluence.space>SEI</confluence.space>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${spring.framework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${spring.framework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
<version>${spring.framework.version}</version>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>${testng.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>${jar.plugin.version}</version>
<configuration>
<archive>
<index>true</index>
<manifest>
<addClasspath>true</addClasspath>
</manifest>
<manifestEntries>
<Specification-Title>${project.name}</Specification-Title>
<Specification-Version>${project.version}</Specification-Version>
<Specification-Vendor>${project.organization.name}</Specification-Vendor>
<Implementation-Title>${project.name}</Implementation-Title>
<Implementation-Version>${project.version}</Implementation-Version>
</manifestEntries>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>${bundle.plugin.version}</version>
<executions>
<execution>
<id>bundle-manifest</id>
<phase>process-classes</phase>
<goals>
<goal>manifest</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
<extensions>
<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-webdav-jackrabbit</artifactId>
<version>2.2</version>
</extension>
</extensions>
</build>
<profiles>
<profile>
<id>release</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>${javadoc.plugin.version}</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
<configuration>
<additionalJOption>-J-Dhttp.auth.ntlm.domain=dav:https//(domain)</additionalJOption>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>${source.plugin.version}</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>wagon-maven-plugin</artifactId>
<version>${wagon.plugin.version}</version>
<executions>
<execution>
<id>upload-javadocs</id>
<phase>package</phase>
<goals>
<goal>upload</goal>
</goals>
<configuration>
<serverId>(serverId)</serverId>
<fromDir>${project.build.directory}/apidocs</fromDir>
<includes>*</includes>
<excludes>pom.xml</excludes>
<url>dav:https://(domain)/(path)</url>
<toDir>(path)</toDir>
<optimize>true</optimize>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>${site.plugin.version}</version>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>${project.info.reports.plugin.version}</version>
<reportSets>
<reportSet>
<reports>
<report>summary</report>
<report>project-team</report>
<report>plugins</report>
<report>dependencies</report>
<report>scm</report>
<report>cim</report>
<report>issue-tracking</report>
</reports>
</reportSet>
</reportSets>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>${javadoc.plugin.version}</version>
<configuration>
<show>public</show>
</configuration>
</plugin>
</plugins>
</reporting>
<repositories>
(repositories)
</repositories>
<distributionManagement>
(repositories)
</distributionManagement>
<developers>
(developers)
</developers>
</project>

尽管我不得不审查与公司相关的网站,但希望它能理解发生了什么。此外,我在 settings.xml 中添加了代理和服务器配置,如下所示:

<proxy>
<active>true</active>
<protocol>https</protocol>
<host>(host address)</host>
<port>9090</port>
<username>(username)</username>
<password>(password)</password>
<nonProxyHosts>*.mycompany.com</nonProxyHosts>
</proxy>

服务器:

<server>
<id>(the same serverId from the POM)</id>
<username>(username)</username>
<password>(password)</password>
</server>

非常感谢。

最佳答案

您的网址应如下所示 <url>dav:http://...</url> .

首先尝试 beta-4,然后按命令设置,如 -Dwagon.url=。如果它仍然不起作用,您必须在 Codehaus 的 JIRA 上提交工单。 source code似乎很好。这是一个注入(inject)问题。你能试试另一个 Maven 版本吗?

关于maven - 通过 Maven Wagon WebDAV 提供程序将 Javadoc 部署到 NTLM 验证的服务器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10106838/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com