eclipse maven project deploying error - eclipse

i am trying to deploy my maven project in eclipse using goal clean tomcat7:deploy
in tomcat-users.xml:
<user username="milma" password="milma" roles="manager-gui" />
in pom xml:
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
<configuration>
<url>http://localhost:8080/company</url>
<server>TomcatServer</server>
<path>/company</path>
</configuration>
</plugin>
in m2/settings.xml:
<server>
<id>TomcatServer</id>
<username>company</username>
<password>company</password>
</server>
</servers>
</settings>
why i getting this error?
[ERROR] Failed to execute goal org.apache.tomcat.maven:tomcat7-maven-plugin:2.2:deploy (default-cli) on project milma: Cannot invoke Tomcat manager: Connection reset by peer: socket write error -> [Help 1]
does any one can help me.

Your URL for uploading is worng. it must be: http://localhost:8080/manager/text
<configuration>
<url>http://localhost:8080/manager/text</url>
<server>TomcatServer</server>
<path>/company</path>
</configuration>
Because the URL is the URL of the tomcat Manager servlet, not the URL where your application should be called.

Related

Jib - "Cannot find 'useCurrentTimestamp' "

I add jib into a pom.xml file as the followings:
<properties>
<docker.org>springcloudstream</docker.org>
<docker.version>${project.version}</docker.version>
</properties>
...
<build>
<plugins>
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>jib-maven-plugin</artifactId>
<version>2.1.0</version>
<configuration>
<from>
<image>springcloud/openjdk</image>
</from>
<to>
<image>${docker.org}/${project.artifactId}:${docker.version}</image>
</to>
<container>
<useCurrentTimestamp>true</useCurrentTimestamp>
</container>
</configuration>
</plugin>
</plugins>
</build>
After running the following build command,
./mvnw package jib:dockerBuild
I get the following error.
[ERROR] Failed to execute goal com.google.cloud.tools:jib-maven-plugin:2.1.0:dockerBuild (default-cli) on project usage-detail-sender-kafka: Unable to parse configuration of mojo com.google.cloud.tools:jib-maven-plugin:2.1.0:dockerBuild for parameter useCurrentTimestamp: Cannot find 'useCurrentTimestamp' in class com.google.cloud.tools.jib.maven.JibPluginConfiguration$ContainerParameters
The UseCurrentTimestamp is already in the configuration. After an online search, I only find one entry: https://github.com/GoogleContainerTools/jib/issues/413. I can't see a solution on the page.
What is missing?
The CHANGELOG indicates that useCurrentTimestamp was deprecated and removed in 2.0.0:
Removed deprecated <container><useCurrentTimestamp> configuration in favor of <container><creationTime> with USE_CURRENT_TIMESTAMP
It looks like you need to replace
<useCurrentTimestamp>true</useCurrentTimestamp>
with
<creationTime>USE_CURRENT_TIMESTAMP</creationTime>

Mulesoft - Cloudhub deployment error: Deployment configuration is not valid, : No deployment configuration was defined

This is my build details in POM:
<build>
<plugins>
<plugin>
<groupId>org.mule.tools.maven</groupId>
<artifactId>mule-maven-plugin</artifactId>
<version>${mule.maven.plugin.version}</version>
<extensions>true</extensions>
<configuration>
<deploymentType>${deploymentType}</deploymentType>
<muleVersion>${muleVersion}</muleVersion>
<redeploy>${redeploy}</redeploy>
<businessGroup>${businessGroup}</businessGroup>
<username>${username}</username>
<password>${password}</password>
<applicationName>${applicationName}</applicationName>
<environment>${environment}</environment>
<region>${region}</region>
<workers>${workers}</workers>
<workerType>${workerType}</workerType>
<uri>${anypoint.uri}</uri>
</configuration>
<executions>
<execution>
<id>deploy</id>
<phase>deploy</phase>
<goals>
<goal>deploy</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
<configuration>
<compilerArgs>
<args>-parameters</args>
</compilerArgs>
</configuration>
</plugin>
</plugins>
</build>
These are my properties:
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<app.runtime>4.2.1</app.runtime>
<mule.maven.plugin.version>3.2.7</mule.maven.plugin.version>
<deploymentType>cloudhub</deploymentType>
<muleVersion>4.2.1</muleVersion>
<redeploy>true</redeploy>
<businessGroup>****</businessGroup>
<username>****</username>
<password>****</password>
<applicationName>****</applicationName>
<environment>Sandbox</environment>
<region>us-east-1</region>
<workers>1</workers>
<workerType>Micro</workerType>
<anypoint.uri>https://anypoint.mulesoft.com</anypoint.uri>
</properties>
Following is my terminal command:
mvn clean deploy -DmuleDeploy -X
and I am getting following error:
[ERROR] Failed to execute goal org.mule.tools.maven:mule-maven-plugin:3.2.7:deploy (default-deploy) on project helloworld: Deployment configuration is not valid, : No deployment configuration was defined. Aborting. -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.mule.tools.maven:mule-maven-plugin:3.2.7:deploy (default-deploy) on project helloworld: Deployment configuration is not valid,
If I use following configuration, it deploys successfully in cloudhub:
<configuration>
<cloudHubDeployment>
<uri>${anypoint.uri}</uri>
<muleVersion>${muleVersion}</muleVersion>
<businessGroup>${businessGroup}</businessGroup>
<username>${username}</username>
<password>${password}</password>
<applicationName>${applicationName}</applicationName>
<environment>${environment}</environment>
<region>${region}</region>
<workers>${workers}</workers>
<workerType>${workerType}</workerType>
</cloudHubDeployment>
</configuration>
Not sure where I am doing wrong in the first config.
The configuration in the first example is for the older version of the Mule Maven Plugin (2.2.x or earlier) for Mule 3.x. The versions for Mule 4.x (3.3.x) always used the format of your second example. See the documentation at https://docs.mulesoft.com/mule-runtime/4.2/mmp-concept#deploying-to-cloudhub
The last version of the Mule Maven Plugin for Mule 3 (2.3.x) uses the same format than the Mule 4 version.
In summary, the first example is obsolete and not compatible with a Mule 4 deployment.

GWT 2.5.1 SuperDevMode not enabled

i work on a GWT/GWTPHONEGAP/MGWT project and i need using gwt 2.5.1 with SuperdevMode.
I use maven and the following command "classpath gwt:runcodeServer", when i compile my project no error occur, but when i go to my webBrowser to using superDevMode, it's impossible to recompile, the error message is "this module has doesn't have Super Dev mode enabled" although my *.gwt.xml contains the following line enabled superDevMode.
<add-linker name="xsiframe"/>
<set-configuration-property name="devModeRedirectEnabled" value="true"/>
<set-property name="compiler.useSourceMaps" value="true" />
with following entrypoint
<entry-point class="**.**.*.client.MgwtAppEntryPoint" />
When i go to the localhost:9876 the project is present & source are available.
Following my configuration of maven :
jetty :
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>9.1.2.v20140210</version>
<configuration>
<reload>manual</reload>
<httpConnector>
<port>9090</port><!-- port 8080 already use by tiviz-web -->
</httpConnector>
<webApp>
<baseResource implementation="org.eclipse.jetty.util.resource.ResourceCollection">
<resourcesAsCSV>src/main/webapp,${basedir}/target/tiviz-gwt-0.0.1-SNAPSHOT</resourcesAsCSV>
</baseResource>
<extraClasspath>${basedir}/src/main/webapp/WEB-INF/classes</extraClasspath>
<allowDuplicateFragmentNames>true</allowDuplicateFragmentNames>
</webApp>
<systemProperties>
<systemProperty>
<name>gwt.codeserver.port</name>
<value>9876</value>
</systemProperty>
</systemProperties>
</configuration>
</plugin>
and my configuration of gwt-maven-plugin
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<!-- Plugin configuration. There are many available options, see gwt-maven-plugin
documentation at codehaus.org -->
<configuration>
<!-- run params -->
<copyWebapp>false</copyWebapp>
<productionMode>false</productionMode>
</configuration>
</plugin>
problem come from an bad configuration in the path of my webapp ressource in jetty plugin.

How to solve Maven connection exception error

Can someone help me out with this problem ... i have spent too much time with this error but couldnt solve this ...
[ERROR] Failed to execute goal org.apache.tomcat.maven:tomcat7-maven-plugin:2.1:
deploy (default-cli) on project HelloMaven: Cannot invoke Tomcat manager: Connection to http:// localhost:8080 refused: Connection refused: connect -> [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/ConnectException
Following is my pom.xml :
<modelVersion>4.0.0</modelVersion>
<groupId>com.abc.app</groupId>
<artifactId>HelloMaven</artifactId>
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
<name>HelloMaven Maven Webapp</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<finalName>HelloMaven</finalName>
<plugins>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.0</version>
<configuration>
<url>http://localhost:8080/manager/html</url>
<server>TomcatServer</server>
<path>/HelloMaven</path>
</configuration>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
First clarify which version of Tomcat you are running. It's essentially important because configuration is sligthly different. I will describe it for Tomcat 7.
Define a new user in your tomcat-user.xml and assign it the privilege "manager-script". This user should have no other manager-...-Roles.
Open your pom.xml and change the configuration of your tomcat7-plugin. Change the url to http:// localhost:8080/manager/text. Keep in mind that you use the text-console and not the html-console.
Goto your settings.xml and check, that there is a server-configuration with the corresponding id that you use in your tomcat7-plugin-configuration.
for example:
<server>
<id>TomcatServer</id>
<username>scriptuser</username>
<password>mypassword</password>
</server>

Maven 3 site descriptor issue : deploying artifact not working or site not building

I've migrated to maven 3.0.3 but I'm not able to build the maven site.
In fact my project use an external parent pom that doesn't provide any site descriptor as artifact.
1- Is there a way to generate the maven site even if the parent doesn't provide a site.xml ? I can't make it work. "mvn site" command still crashing trying to download the site.xml of the parent with the following eroor (ArtifactResolutionException: Unable to locate site descriptor...)
2- How do we install or deploy the site.xml on maven repository. I try to add the following xml in my parent pom, but it's not installing anything in my local repo with mvn install command. I've a src/site/site.xml in my project, my project is a pom type project
maven-site-plugin
attach-descriptor
attach-descriptor
UPDATE
No it's not working
In my pom I have
<url>${site_url_pattern}</url>
<distributionManagement>
<site>
<id>test</id>
<url>file://${baseDir}../maven-site</url>
</site>
</distributionManagement>
In plugin management I put
<plugin>
<!-- Site plugin -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>3.0</version>
<configuration>
<chmod>true</chmod>
<inputEncoding>${encoding}</inputEncoding>
<outputEncoding>${encoding}</outputEncoding>
</configuration>
</plugin>
In plugins I put
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>3.0</version>
<configuration>
<locales>en</locales>
<reportPlugins>
<!-- Manage site info part creation -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin
</artifactId>
<version>2.2</version>
<configuration>
<dependencyLocationsEnabled>false</dependencyLocationsEnabled>
<dependencyDetailsEnabled>false</dependencyDetailsEnabled>
<offline>true</offline>
</configuration>
<reports>
<report>cim</report>
<!-- Dependencies report are consuming resources set MAVEN_OPTS=-Xmx1024m if java heap <report>dependencies</report> <report>dependencies-convergence</report> <report>dependencies-management</report> -->
<report>index</report>
<report>issue-tracking</report>
<!-- pb time generation on licence report <report>license</report> -->
<report>mailing-list</report>
<report>plugin-management</report>
<report>project-team</report>
<report>scm</report>
<report>summary</report>
</reports>
</plugin>
</reportPlugins>
</configuration>
<executions>
<execution>
<id>attach-descriptor</id>
<goals>
<goal>attach-descriptor</goal>
</goals>
</execution>
</executions>
</plugin>
I have a src/site/site.xml in the same project
When I do mvn site I still have
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-site-plugin:3.0:si
te (default-site) on project ner-delivery: SiteToolException: The site descripto
r cannot be resolved from the repository: ArtifactResolutionException: Unable to
locate site descriptor: Could not transfer artifact com.sopragroup.evolan:evola
n-framework-superpom:xml:site_en:6.14.2 from/to Artifactory (http://pdtinteg.ptx
.fr.sopra/artifactory/repo): Access denied to: http://pdtinteg.ptx.fr.sopra/arti
factory/repo/com/sopragroup/evolan/evolan-framework-superpom/6.14.2/evolan-frame
work-superpom-6.14.2-site_en.xml
[ERROR] com.sopragroup.evolan:evolan-framework-superpom:xml:6.14.2
If I put manually a evolan-framework-superpom-6.14.2-site_en.xml on my local repo it's working, but that's not a real solution
Explicitly configure maven-site-plugin 3.0 in your pom:
<pluginManagement>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>3.0</version>
<configuration>
<chmod>true</chmod>
<inputEncoding>UTF-8</inputEncoding>
<outputEncoding>UTF-8</outputEncoding>
</configuration>
</plugin>
</pluginManagement>
Add a url & a distributionManagement element that tell where you plan to deploy it.
Add a src/site/site.xml that contains what you need.
If your parent has none of these, it will work.