Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/maven/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
将Java插件发布到Repo错误_Java_Maven - Fatal编程技术网

将Java插件发布到Repo错误

将Java插件发布到Repo错误,java,maven,Java,Maven,我正在尝试将我的插件发布到OSS SonaType上的pluginrepository。他们已经为快照和完整版本设置了我的命名空间。我正在努力做出我的第一次回购承诺。我似乎找不到正确的Maven配置来将插件推送到repo,而不是尝试更新repo。下面找到我的pom.xml和maven配置代码。任何帮助都将不胜感激 Pom.xml: <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/

我正在尝试将我的插件发布到OSS SonaType上的pluginrepository。他们已经为快照和完整版本设置了我的命名空间。我正在努力做出我的第一次回购承诺。我似乎找不到正确的Maven配置来将插件推送到repo,而不是尝试更新repo。下面找到我的pom.xml和maven配置代码。任何帮助都将不胜感激

Pom.xml:

<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.companynamehere.dmweb</groupId>
  <artifactId>DMWeb</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <name>DMWeb</name>
  <build>
    <sourceDirectory>src</sourceDirectory>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.3</version>
        <configuration>
          <source>1.8</source>
          <target>1.8</target>
        </configuration>
      </plugin>
    </plugins>
  </build>
    <dependencies>
    <dependency>
        <groupId>org.springframework.security</groupId>
        <artifactId>spring-security-web</artifactId>
        <version>4.0.2.RELEASE</version>
    </dependency>
  </dependencies>
  <pluginRepositories>
        <pluginRepository>
            <id>OSS-Repo</id>
            <name>oss-repo</name>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
            <releases>
                <enabled>false</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </pluginRepository>
    </pluginRepositories>
</project>
Goals: com.companynamehere:DMWeb:validate
Error resolving version for plugin 'com.companynamehere:DMWeb' from the repositories [local (C:\Users\kylec\.m2\repository), OSS-Repo (https://oss.sonatype.org/content/repositories/snapshots), central (https://repo.maven.apache.org/maven2)]: Plugin not found in any plugin repository -> [Help 1]
错误:

<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.companynamehere.dmweb</groupId>
  <artifactId>DMWeb</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <name>DMWeb</name>
  <build>
    <sourceDirectory>src</sourceDirectory>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.3</version>
        <configuration>
          <source>1.8</source>
          <target>1.8</target>
        </configuration>
      </plugin>
    </plugins>
  </build>
    <dependencies>
    <dependency>
        <groupId>org.springframework.security</groupId>
        <artifactId>spring-security-web</artifactId>
        <version>4.0.2.RELEASE</version>
    </dependency>
  </dependencies>
  <pluginRepositories>
        <pluginRepository>
            <id>OSS-Repo</id>
            <name>oss-repo</name>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
            <releases>
                <enabled>false</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </pluginRepository>
    </pluginRepositories>
</project>
Goals: com.companynamehere:DMWeb:validate
Error resolving version for plugin 'com.companynamehere:DMWeb' from the repositories [local (C:\Users\kylec\.m2\repository), OSS-Repo (https://oss.sonatype.org/content/repositories/snapshots), central (https://repo.maven.apache.org/maven2)]: Plugin not found in any plugin repository -> [Help 1]

首先遵循maven的默认布局…永远不要在pom中定义插件最好使用
settings.xml
文件并使用存储库管理器…我怀疑您是否真的喜欢在构建中使用快照。您好@khmarbaise,您能提供关于这个settings.xml的更多信息以及默认的maven布局是什么吗?此外,这个插件处于测试状态,所以我认为最好以快照的形式发布?我的一句话完全错了<代码>永远不要在pom中定义插件…我的意思是:
永远不要在pom中定义属性
。。。。如果您的插件是beta版,只需发布beta版或使用类似
0.2.0
…@khmarbaise的版本,我明白了,我可以将我的pluginRepositories和其他属性移到这个设置文件中,但是将初始java包推送到repo的正确Maven命令是什么?