Деплой мавен проекта на томкэт

457
15 января 2017, 15:50

При деплое через консоль mvn tomcat7:deploy - все успешно, но когда я нажимаю в intellij idea на деплой выдает это. Полдня мучаюсь. Вижу что вызывает дефолтовый деплой. Получается мне нужно как то прописать вызов tomcat7:deploy а не дефолтовый.

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.spring4soap</groupId>
    <artifactId>spring4soap</artifactId>
    <version>1</version>
    <packaging>war</packaging>
    <name>Spring 4 Soap</name>
    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-ws</artifactId>
            <version>1.2.0.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>wsdl4j</groupId>
            <artifactId>wsdl4j</artifactId>
            <version>1.6.1</version>
        </dependency>
        <dependency>
            <groupId>javax.xml.bind</groupId>
            <artifactId>jaxb-api</artifactId>
            <version>2.2.12</version>
        </dependency>
    </dependencies>
    <!--    <distributionManagement>
            <repository>
                <id>TomcatServer</id>
                <url>http://tomcathost:8080/manager/text</url>
            </repository>
        </distributionManagement>-->
    <build>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>jaxb2-maven-plugin</artifactId>
                <version>1.6</version>
                <executions>
                    <execution>
                        <id>xjc</id>
                        <goals>
                            <goal>xjc</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <schemaDirectory>${project.basedir}/src/main/resources/</schemaDirectory>
                    <outputDirectory>${project.basedir}/src/main/java</outputDirectory>
                    <clearOutputDir>false</clearOutputDir>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <version>2.6</version>
                <configuration>
                    <failOnMissingWebXml>false</failOnMissingWebXml>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.tomcat.maven</groupId>
                <artifactId>tomcat7-maven-plugin</artifactId>
                <version>2.2</version>
                <configuration>
                    <url>http://tomcathost:8080/manager/text</url>
                    <server>TomcatServer</server>
                    <path>/webapp</path>
                    <username>admin</username>
                    <password>admin</password>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>

Вывод

"C:\Program Files\Java\jdk1.7.0_79\bin\java" "-Dmaven.multiModuleProjectDirectory=C:\Users\Sergey.I.Shevtsov\Desktop\Spring4SoapProducer - копия" -Xmx512m -Dmaven.home=C:\apache-maven-3.3.9 -Dclassworlds.conf=C:\apache-maven-3.3.9\bin\m2.conf -Didea.launcher.port=7550 "-Didea.launcher.bin.path=C:\IntelliJ IDEA 2016.3.2\bin" -Dfile.encoding=UTF-8 -classpath "C:\apache-maven-3.3.9\boot\plexus-classworlds-2.5.2.jar;C:\IntelliJ IDEA 2016.3.2\lib\idea_rt.jar" com.intellij.rt.execution.application.AppMain org.codehaus.classworlds.Launcher -Didea.version=2016.3.2 deploy
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building Spring 4 Soap 1
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- jaxb2-maven-plugin:1.6:xjc (xjc) @ spring4soap ---
[INFO] No changes detected in schema or binding files - skipping source generation.
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ spring4soap ---
[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:3.1:compile (default-compile) @ spring4soap ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ spring4soap ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory C:\Users\Sergey.I.Shevtsov\Desktop\Spring4SoapProducer - копия\src\test\resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ spring4soap ---
[INFO] No sources to compile
[INFO] 
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ spring4soap ---
[INFO] No tests to run.
[INFO] 
[INFO] --- maven-war-plugin:2.6:war (default-war) @ spring4soap ---
[INFO] Packaging webapp
[INFO] Assembling webapp [spring4soap] in [C:\Users\Sergey.I.Shevtsov\Desktop\Spring4SoapProducer - копия\target\spring4soap-1]
[INFO] Processing war project
[INFO] Copying webapp resources [C:\Users\Sergey.I.Shevtsov\Desktop\Spring4SoapProducer - копия\src\main\webapp]
[INFO] Webapp assembled in [121 msecs]
[INFO] Building war: C:\Users\Sergey.I.Shevtsov\Desktop\Spring4SoapProducer - копия\target\spring4soap-1.war
[INFO] 
[INFO] --- maven-install-plugin:2.4:install (default-install) @ spring4soap ---
[INFO] Installing C:\Users\Sergey.I.Shevtsov\Desktop\Spring4SoapProducer - копия\target\spring4soap-1.war to C:\Users\Sergey.I.Shevtsov\.m2\repository\com\spring4soap\spring4soap\1\spring4soap-1.war
[INFO] Installing C:\Users\Sergey.I.Shevtsov\Desktop\Spring4SoapProducer - копия\pom.xml to C:\Users\Sergey.I.Shevtsov\.m2\repository\com\spring4soap\spring4soap\1\spring4soap-1.pom
[INFO] 
[INFO] --- maven-deploy-plugin:2.7:deploy (default-deploy) @ spring4soap ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.535 s
[INFO] Finished at: 2017-01-13T18:09:19+03:00
[INFO] Final Memory: 18M/222M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project spring4soap: Deployment failed: repository element was not specified in the POM inside distributionManagement element or in -DaltDeploymentRepository=id::layout::url parameter -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
Answer 1

В IDEA вы указываете цель deploy, а в консоли tomcat7:deploy. Это разные цели.

Для запуска нужной вам цели можно использовать таб Maven Projects

Maven Projects -> <Ваше приложение> -> Plugins -> tomcat7 -> tomcat7:deploy

READ ALSO
Словарь на основе HashMap

Словарь на основе HashMap

Возникла необходимость создать класс словаря, метод которого для каждого слова возвращает его текстовое объяснениеИнициализировать словарь...

331
Живые обои Live Wallpaper

Живые обои Live Wallpaper

Доброго времени суток

438
JUnit: timeout некорректно работает?

JUnit: timeout некорректно работает?

Есть следующий тест:

277
Что такое External library?

Что такое External library?

external libraries intellij - это список подключенных по умолчанию библиотек? что то вроде include cstdlib?

310