When I run ant on CentOS to build java project I receive an error:
Could not create task or type of type: replaceregexp
ant -diagnostics shows that optional tasks are not available. How I can install optional tasks for ant?
Ant is installed from CentOS package.
Works for me:
yum install ant-nodeps
Run the following command, to download the jars associated with ANT's optional tasks:
ant -f $ANT_HOME/fetch.xml -Ddest=user -Dm2.url=http://repo1.maven.org/maven2
For a full explanation,
see the ANT Manual documentation.
yum install ant-apache-regexp
It will install the required optional task (jar).
yum search ant
One can do a quick search to get a list of other ant related packages.
try
yum list 'ant*'
to see available ant packages.
In my case
yum install ant-antlr.x86_64 worked.
Related
On root I used :
dotnet tool install --global dotnet-sonarscanner --version 4.7.1to install sonarscanner
and it's working:
SonarScanner for MSBuild 4.7.1
Using the .NET Core version of the Scanner for MSBuild
WARNING: Please specify the command 'begin' or 'end' to indicate whether pre- or post-processing is required. These parameters will become mandatory in a later release.
Post-processing started.
But in a docker it isn't:
root#3bea636a6418:/# dotnet sonarscanner
bash: dotnet: command not found
I tried to pass it:
export PATH="$PATH:/root/.dotnet/tools"
but with no luck
ps. ...and everything because of sonarscanner could not find java on docker:
SonarScanner for MSBuild 5.2
Using the .NET Core version of the Scanner for MSBuild
Post-processing started.
Calling the SonarScanner CLI…
Could not find ‘java’ executable in JAVA_HOME or PATH.
The SonarScanner did not complete successfully
14:43:39.402 Post-processing failed. Exit code: 1
Cleaning up file based variables
ERROR: Job failed: exit code 1```
Install all the dependencies for your dotnet tools to work, ldd command can help you with this, and make sure all software required can be found also, for example can be found on the PATH variable if required.
to help you use interactive bash on the docker container, and add to your dockerfile if this works.
docker exec -it (container) bash
docker images usually installs what is required only, so you add the tools only to run your software successfully.
- apt-get update
- apt-get install --yes openjdk-11-jre
solved problem
ps. it's not that obvious because in docker bash when I run java -version I get answer that java is already installed
When executing the command ant -v, it gives me the error:
Apache Ant(TM) version ${project.version} compiled on ${TODAY}.
How do I fix this?
The Ant source code shows where these non-referenced properties come from:
$ cat src/main/org/apache/tools/ant/version.txt
VERSION=${project.version}
DATE=${TODAY}
These properties are supposed to be expanded when the Ant binaries are built with ant jars.
Are you trying to use a version of Ant you built yourself?
The official binaries from Apache shouldn't have this problem.
I'm trying to run grails geb/spock tests on jenkins. I install Xvfb Plugin
https://wiki.jenkins-ci.org/display/JENKINS/Xvfb+Plugin.
Jenkins configurations:
Project configuration:
Exception:
After you install the Xvfb Plugin, you have to do: Manage Jenkins -> Configure System and find the Xvfb Installation section and add an installation with a Name and Directory in which to find Xvfb executable (which can be blank if it can be found in the PATH). Without this setting, Xvfb doesn't work.
So, why not search the PATH by default? Why should this be needed??
I am trying to install a project from github using phpunit. The project uses composer to install the dependencies.
When I run ant to build the project, I get a simple error message, but I would like to access more complete logs of ant. Is it accessible ?
Best,
Mehdi
See:
http://ant.apache.org/manual/running.html
For example using:
-verbose, -v
is quite popular to see what ANT does and how it does resolve dependencies.
Sebastian
I'm having some trouble figuring out how to install Ant on Cygwin. I want to use Ant to build Nutch. I've looked through a bunch of tutorials but I can't find anything that is low level enough for me to understand. I need something like...
Download ant, put it here
Open Cygwin
type "export ANT_HOME=..."
...
Can anyone help me out here?
Assuming you have a JDK already installed, you can do this:
$ export ANT_HOME=/cygdrive/c/apache-ant-1.7.1
which assumes you've unzipped Ant into C:\apache-ant-1.7.1. Then:
$ export PATH=$ANT_HOME/bin:$PATH
$ ant -version
Apache Ant version 1.7.1 compiled on June 27 2008
In Windows, add the path to your ant /bin directory to the Path system variable. This can easily be done by right clicking on Computer > Properties > Advanced System Settings > Environment Variables, click on Path in the System Variables, click on Edit and add ; followed by the path to your ant bin directory to the end of the Variable value.
Start or restart Cygwin.
Type ant -version The version should be displayed.
Here's a step-by-step guide:
simply download and unzip ANT binaries say into c:\apache-ant-1.8.1
download and unzip NUTCH sources say into: c:\apache-nutch-1.2
open the command prompt and run the following:
cd c:\apache-nutch-1.2
c:\apache-ant-1.8.1\bin\ant
the same would work from the Bash shell, just use Cygwin-style paths:
cd /cygdrive/c/apache-nutch-1.2
./cygdrive/c/apache-ant-1.8.1/bin/ant
That's it, you will find a new directory build containing the output.
For convenience, you might want to add the Ant bin directory to the PATH environment variable so that you don't have to give the full path each time, but that's optional.
BTW I just did those exact steps, and all went fine.
Finally, follow this tutorial to get started.