我需要在 struts2-jquery 网格插件中做一些增强。我从https://struts2-jquery.googlecode.com/svn/trunk下载了源代码。我改变了这个来源的逻辑。当我使用mvn package执行我的 POM.xml 文件时。我收到了异常
"The project com.jgeppert.struts2.jquery:struts2-jquery-grid-plugin:3.5.0-SNAPSHOT
have 1 error
Non-resolvable parent POM:could not find artifact com.jgeppert.struts2.jquery:struts2-
jquery:pom:3.5.0-snapshot and 'Parent.relativePath' points at wrong local POM @line 5,c
olumn 13 "
我的 pom.xml 文件如下所示。
<?xml version="1.0"?>
<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.jgeppert.struts2.jquery</groupId>
<artifactId>struts2-jquery</artifactId>
<version>3.5.0-SNAPSHOT</version>
</parent>
<artifactId>struts2-jaquery-grid-plugin</artifactId>
<name>Struts 2 jQuery Grid Plugin</name>
<packaging>jar</packaging>
<scm>
<connection>scm:svn:http://struts2-jquery.googlecode.com/svn/trunk/struts2-jquery-grid-plugin</connection>
<developerConnection>scm:svn:https://struts2-jquery.googlecode.com/svn/trunk/struts2-jquery-grid-plugin</developerConnection>
<url>http://code.google.com/p/struts2-jquery/source/browse/</url>
</scm>
<build>
<plugins>
<plugin>
<groupId>org.apache.myfaces.tobago</groupId>
<artifactId>maven-apt-plugin</artifactId>
<version>1.0.39</version>
<configuration>
<A>
uri=/struts-jquery-grid-tags,
tlibVersion=${tlib.version},
jspVersion=2.0,
shortName=sjg,
displayName="Struts2 jQuery Grid Tags",
outFile=${basedir}/target/classes/META-INF/struts-jquery-grid-tags.tld,
description="Struts2 tags based on jQuery and jqGrid.",
outTemplatesDir=${basedir}/src/site/docs
</A>
<resourceTargetPath>target</resourceTargetPath>
<fork>false</fork>
<force>true</force>
<nocompile>true</nocompile>
<showWarnings>true</showWarnings>
<factory>
org.apache.struts.annotations.taglib.apt.TLDAnnotationProcessorFactory
</factory>
<target>1.5</target>
<includes>
<include>**/*.java</include>
</includes>
</configuration>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>execute</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<!-- Core -->
<dependency>
<groupId>com.jgeppert.struts2.jquery</groupId>
<artifactId>struts2-jquery-plugin</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jsp-api</artifactId>
<version>2.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts-annotations</artifactId>
<version>1.0.4</version>
<optional>true</optional>
</dependency>
<!-- JSP API -->
<!-- struts-annotations must be in compile scope for maven-apt-plugin to
function correctly. Marking it optional to exclude it from transitive dependency resolution -->
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-core</artifactId>
<version>${struts2.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.velocity</groupId>
<artifactId>velocity</artifactId>
<version>1.5</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>
据我了解,父标签查看另一个 pom.xml 文件。我试图在父标签中添加相对路径,但它不起作用。我没有在https://struts2-jquery.googlecode.com/svn/trunk中看到父 pom.xml 。
我删除了父标签并将其添加到 groupid , artifactId & version 给出为 3.5.0-SNAPSHOT 然后它也失败了。我再次更改了 3.4.0 而不是 3.5.0-SNAPSHOT 然后是它的构建 .jar 文件。但它并没有影响我的改变。
那么如何使用代码的最新更改运行 pom 文件。是否有任何替代方法可以创建 .jar 文件而不是运行 pom.xml 文件。