【问题标题】:repository element存储库元素
【发布时间】:2010-12-27 15:58:50
【问题描述】:
 Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.5:deploy (default-deploy) on project mysticpaste: Deployment failed: repository element was not specified in the POM inside distributionManagement element or in -DaltDeploymentRepository=id::layout::url parameter -> [Help 1]

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/maven-v4_0_0.xsd">

 <modelVersion>4.0.0</modelVersion>
 <groupId>com.mysticcoders</groupId>
 <artifactId>mysticpaste</artifactId>
 <packaging>war</packaging>
 <version>1.0-SNAPSHOT</version>
 <!-- TODO project name  -->
 <name>quickstart</name>
 <description></description>

 <!-- TODO
  <organization>
  <name>company name</name>
  <url>company url</url>
  </organization>
 -->

 <licenses>
  <license>
   <name>The Apache Software License, Version 2.0</name>
   <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
   <distribution>repo</distribution>
  </license>
 </licenses>

 <dependencies>
  <!--  WICKET DEPENDENCIES -->

  <dependency>
   <groupId>org.apache.wicket</groupId>
   <artifactId>wicket</artifactId>
   <version>${wicket.version}</version>
  </dependency>

  <!--  SPRING DEPENDENCIES -->

  <dependency>
       <groupId>org.springframework</groupId>
       <artifactId>spring</artifactId>
       <version>2.5.5</version>
     </dependency>

      <dependency>
          <groupId>org.springframework</groupId>
          <artifactId>spring-webmvc</artifactId>
          <version>2.5.5</version>
       </dependency> 

       <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-test</artifactId>
            <version>2.5.5</version>
         </dependency>

         <dependency> 
      <groupId>org.springframework</groupId>
      <artifactId>spring-tx</artifactId>
       <version>2.5.5</version>
  </dependency>


        <dependency>
            <groupId>commons-dbcp</groupId>
            <artifactId>commons-dbcp</artifactId>
            <version>1.2.2</version>
        </dependency>

      <!-- Hibernate framework -->
 <dependency>
    <groupId>org.hibernate</groupId>
    <artifactId>hibernate-core</artifactId>
    <version>3.3.0.GA</version>
 </dependency>

  <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate</artifactId>
            <version>3.2.6.ga</version>
            <exclusions>
                <exclusion>
                    <groupId>javax.transaction</groupId>
                    <artifactId>jta</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

 <dependency>
    <groupId>javassist</groupId>
    <artifactId>javassist</artifactId>
    <version>3.8.0.GA</version>
 </dependency>

 <!-- MySQL database driver -->
 <dependency>
  <groupId>mysql</groupId>
  <artifactId>mysql-connector-java</artifactId>
  <version>5.1.9</version>
 </dependency>


  <!-- OPTIONAL 
   <dependency>
   <groupId>org.apache.wicket</groupId>
   <artifactId>wicket-extensions</artifactId>
   <version>${wicket.version}</version>
   </dependency>
  -->

  <!-- LOGGING DEPENDENCIES - LOG4J -->

  <dependency>
   <groupId>org.slf4j</groupId>
   <artifactId>slf4j-log4j12</artifactId>
   <version>1.4.2</version>
  </dependency>
  <dependency>
   <groupId>log4j</groupId>
   <artifactId>log4j</artifactId>
   <version>1.2.14</version>
  </dependency>

  <!--  JUNIT DEPENDENCY FOR TESTING -->
   <dependency>
     <groupId>junit</groupId>
     <artifactId>junit</artifactId>
     <version>3.8.2</version>
     <scope>test</scope>
   </dependency>

  <!--  JETTY DEPENDENCIES FOR TESTING  -->

  <dependency>
   <groupId>org.mortbay.jetty</groupId>
   <artifactId>jetty</artifactId>
   <version>${jetty.version}</version>
   <scope>provided</scope>
  </dependency>
  <dependency>
   <groupId>org.mortbay.jetty</groupId>
   <artifactId>jetty-util</artifactId>
   <version>${jetty.version}</version>
   <scope>provided</scope>
  </dependency>
  <dependency>
   <groupId>org.mortbay.jetty</groupId>
   <artifactId>jetty-management</artifactId>
   <version>${jetty.version}</version>
   <scope>provided</scope>
  </dependency>
 </dependencies>

 <build>
 <filters>
        <filter>src/main/filters/filters-${env}.properties</filter>
    </filters>
  <resources>
   <resource>
    <filtering>true</filtering>
    <directory>src/main/resources</directory>
   </resource>
   <resource>
    <filtering>false</filtering>
    <directory>src/main/java</directory>
    <includes>
     <include>**</include>
    </includes>
    <excludes>
     <exclude>**/*.java</exclude>
    </excludes>
   </resource>
  </resources>
  <testResources>
   <testResource>
    <filtering>false</filtering>
    <directory>src/test/java</directory>
    <includes>
     <include>**</include>
    </includes>
    <excludes>
     <exclude>**/*.java</exclude>
    </excludes>
   </testResource>
  </testResources>
  <plugins>
   <plugin>
    <groupId>org.mortbay.jetty</groupId>
    <artifactId>maven-jetty-plugin</artifactId>
   </plugin>
   <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-eclipse-plugin</artifactId>
    <configuration>
     <downloadSources>true</downloadSources>
    </configuration>
   </plugin>   
  </plugins>
 </build>

 <properties>
  <wicket.version>1.3.5</wicket.version>
  <jetty.version>6.1.4</jetty.version>
     <env>DEV</env>
 </properties>

 <profiles>
      <profile>
          <id>DEV</id>
          <properties>
              <env>DEV</env>
          </properties>
      </profile>

      <profile>
          <id>QA</id>
          <properties>
              <env>QA</env>
          </properties>
      </profile>

      <profile>
          <id>PROD</id>
          <properties>
              <env>PROD</env>
          </properties>
      </profile>
 </profiles>
</project>

【问题讨论】:

  • 用大约两三句话描述您的问题的半体面文字将在帮助他人理解您想要做什么方面大有帮助。转储代码/XML 和异常/错误无济于事。
  • 也许你的意思是mvn jboss-as:deploy而不是mvn deploy

标签: java maven


【解决方案1】:

我相信您正在尝试做的是将 webapp 部署到应用程序服务器。
为此,您使用mvn ... deploy 命令。

问题是mvn deploy 用于将项目(工件)的输出部署到 maven 存储库。例如与其他同事分享您的课程。

如果我是正确的,你需要某种mvn jetty:runmvn tomcat:run 命令来做你想做的事。

【讨论】:

  • 无关问题:如何高亮内联代码片段?
  • 用重音符键(在数字 1 键旁边)包围文本。
  • 嗯,通常情况下,开发人员只执行mvn installmvn jetty:run。通常,来自基础架构团队的人使用mvn deploy 发布SNAPSHOT 或最终版本。 deploy 将工件复制到您的存储库,然后用户可以从那里下载。
【解决方案2】:

请运行 mvn help:effective-pom 看起来您缺少 标签或 标签。

编辑:正如 Vitaly Polonetsky righty 提到的,您可能应该只是构建并启动服务器。我认为 Jetty 是嵌入式的。所以试试

 mvn clean install run:jetty

【讨论】:

  • 如果您只是在进行测试运行并希望看到构建的应用程序。尝试 mvn clean install
猜你喜欢
  • 2017-01-24
  • 1970-01-01
  • 1970-01-01
  • 2012-10-29
  • 1970-01-01
  • 1970-01-01
  • 2016-04-24
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多