w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Ignore gradle transitive project dependencies using eclipse WTP
After a massive search through net and digging into so many Gradle and WTP stuff, I was able to get this working. Basically, there are three ways to ignore dependencies in WTP deploy directory (or I am aware of only three of them!). 1. Setting transitive to false As you have mentioned in the question and the syntax is like: compile('group.id:jar.name:1.0') {transitive = false} runtime('group.id:jar.name:1.0') {transitive = false} This should prevent the dependant JARs of being added to final WTP directory. 2. Excluding using provided syntax Gadle comes with a feature to prevent dependencies of being added to final WAR file which in here can be used to prevent them of being copied to WTP deploy dir. And here is the syntax: providedCompile 'group.id:jar.name:1.0' providedRuntime 'group

Categories : Java

How to use Gradle to generate Eclipse and Intellij project files for Android projects
Gradle itself is a generic build tool, it is not created specifically for Android. All the functionality is enabled using plug-ins. Traditionally, build plug-ins don't generate project structure. That's the job of project specific tools. The android plug-in for Gradle follows this. The problem is that current android tool in SDK generates old type of project structure (ant builds). The new project structure can only be generated via Android Studio. There is a concept of archetypes in tools like Maven, which allow using project templates. Gradle does not support that yet (requests have been made for this feature). Refer to this thread: http://issues.gradle.org/browse/GRADLE-1289 , some users have provided scripts to generate structure. Build Initialization feature is in progress: http

Categories : Android

Gradle 'demo' project refresh failed: Could not fetch model of type 'IdeaProject' using Gradle installation
Is that dependencies block in buildscript? I think you are mixing the classpath of the build and the dependencies of your project. It should look something like: // this is to configure the code running the build, ie where to find the plugin buildscript { repositories { mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:0.5.+' } } // now we configure the project itself dependencies { compile project(':screentester') }

Categories : Android

Update project version and versions in other projects dependencies
I think there is no direct way with Maven. However I would try a different approach: project1 writes its version number in a properties file, something like project1.version = 1.0.0. This can be easily done using filtering. project2 reads the properties using the properties-maven-plugin and the dependency to project1 uses something like <version>project1.version</version>. However I find this approach strange. I think that your two projects are very close and should be sharing a parent pom and have the same version, or you should handle this manually, because a version update is never trivial and should be done with caution (and testing).

Categories : Eclipse

Gradle dependencies with Travis CI on Android project
I got this solved with some help. It seems that Gradle couldn't find the Android Support dependencies on the local repository, those needed to be installed with the following command: android update sdk --filter extra-android-support --no-ui --force > /dev/null android update sdk --filter extra-android-m2repository --no-ui --force > /dev/null You can check my .travis.yml file on this public repository (https://github.com/Ruenzuo/cloaked-octo-cyril), hope this helps someone else.

Categories : Android

Can the Gradle Eclipse Plugin attach source jar files to local jar dependencies
When using a flatDir repository, the Eclipse plugin should attach any source jars as long as they are in the same location as the dependency jar (with the same name followed by either -src or -sources). Say you have a local jar called dependency.jar at location x/y/z. If you put the sources jar in the same location and call it dependency-sources or dependency-src, it will be attached. Please note that this only works for flatDir repositories and not for plain file dependencies.

Categories : Eclipse

Adding eclipse project dependencies to a Maven project
I'm not sure about your question 1, but if I understand it correctly, you would like to build with Eclipse two Maven projects where A depends on B? Then you may use an Eclipse plugin like m2eclipse. For your second question, I think the solution would be to use the system scope for your dependency that you can't find in any public repository. Of course, if you can deploy the dependency on an entreprise repository it would be better.

Categories : Java

Gradle project refresh failed
Go to your project folder like so Open the file buid.gradle in any text editor. Under dependencies change to 'com.android.tools.build:gradle:0.5.0'

Categories : Android

Gradle and multiple projects with Roboguice dependency
You're right that the dummy library isn't necessary since you're using Maven. If you look at the .pom for Roboguice, it lists Guice as a dependency with the "no_aop" classifier. However, you're also listing Guice explicitly without the classifier. My guess is that Maven is pulling in both versions, which results in the dexing merge conflict. Try removing compile 'com.google.inject:guice:3.0' from your Gradle build file and see if it builds.

Categories : Android

Maven dependencies vs dependency management for multiple projects
In dependencyManagement you declare dependency versions, exclusions and other things that let you manage them in place (e.g. a parent pom) for multiple projects. In dependencies you then declare the actual usage/need of a dependency and if the dependency is managed in a parent pom you can do so without using a version and it will be inherited and therefore be consisted across you usages downstream of the the parent pom. Same logic applies for pluginManagement and plugins btw.

Categories : Maven

How can I tell what dependencies a project has in Eclipse
First, close all your projects (select all, right click and then close). Then, select the project you are interested in and open it. You will be asked if you want to also open the dependencies. This will allow you to see what's needed. You can then delete the projects that weren't opened.

Categories : Eclipse

Android gradle build: running assembleDebug makes release tasks of project dependencies being called
Android library modules publishes only "release" build type. They don't have "debug" build type. Even your application module build the debug version, it will use the release version of the library. You can enable "debug" build type of the library dependency using the following in your module's build.gradle file: android { publishNonDefault true ... } Then when you are using that dependency in the other module, you should use like this: dependencies { releaseCompile project(path: ':moduleY', configuration: 'release') debugCompile project(path: ':moduleY', configuration: 'debug') } I am using the same trick in my application. I have a shared module and I use debug version of the module. Find details here: https://github.com/pomopomo/WearPomodoro/blob/develop/mobile/build.g

Categories : Android

How can a Github Gradle project built in travis-ci access dependencies normally found in my local Maven repo?
You can either commit the artifacts to a private source control repository, or push them to a private binary repository. The only suitable software-as-a-service binary repository that I'm aware of at this time is Artifactory Online. If you go with a binary repository, you'll also have to provide Travis with (temporary) credentials to download the artifacts. One way to do this would be to configure the Travis build to set an environment variable containing the necessary information.

Categories : Maven

Missing project dependencies in eclipse
I did some additional searching and currently this is only possible with multi-project builds. Basically you need all your projects in one gigantic multi-project build. There you can reference them as you like and get the correct dependencies in eclipse as it seems. There is a jira issue with a feature request to make that possible without a multi-project build. Custom logic for eclipse will only help with builds in eclipse, because in a gradle build it would use the dependency from the repository, where the changes are missing. You need to make sure that all changed dependencies are build and published before building the main project. Eclipse workaround: eclipse.classpath.file { whenMerged { cp -> // remove library dependencies def toBeRemoved = cp.entries.fin

Categories : Java

Failed to import new Gradle project: Could not install Gradle distribution from 'http://services.gradle.org/distributions/gradle-1.6-bin.zip'
Thank you, I have resolved this problem already. The cause of this error is really surprising. If you try to download Gradle using 3G connection, it will always fail, that is at least in my case. When I connect using DSL connection Android Studio directly start to download Gradle with no problem and I am able to create new project. Now even if I switch back to 3G connection it is still working. So to replicate my scenario, try to download Gradle using 3G connection or install brand new Android Studio installation using 3G connection. I hope this will help someone. NOTE: My 3G connection speed is better than my DSL connection.

Categories : Gradle

Gradle extract multiple dependencies each to a different directory
I found a working solution. Don't know if it's the best way, but this is what I came up with: task extractDeps << { configurations.cppDependencies.resolvedConfiguration.resolvedArtifacts.each { artifact -> copy { from project.zipTree(artifact.getFile()) into new File(project.buildDir, "DEP_DIR/" + artifact.name) } } }

Categories : Java

eclipse - cannot get project export/dependencies working
Found it. Goddamnit - I needed to fiddle with Deployment Assembly in afd-public. It seems that there are a couple of ways to do it. I can include afd-public/build/classes and afd-public/etc/hibernate and have them deployed to WEBINF/classes, or I can deploy the add-core jarfile to lib. To get the afd-core jarfile correct, I create afd-core as a j2ee "utility project" and check that the Deployment Assembly there is correct. Which it is.

Categories : Eclipse

Creating gradle project in eclipse
My best guess is that you chose "use Gradle wrapper" in the Gradle project import wizard. The downloads generally work fine, but might not work anymore for very old Gradle versions such as 1.0-rc-2. To solve this problem, you can either upgrade to a newer Gradle version, or point the wizard to a local Gradle installation.

Categories : Eclipse

Can't get eclipse kepler to deploy dependency projects of dynamic web project
Create an EAR project using this link: http://www.eclipse.org/webtools/jst/components/j2ee/scenarios/application_creation_tutorial.html After creation, try to Add the Project in server entry.

Categories : Eclipse

Exporting a Java project with external dependencies to a jar using Eclipse
jar file is like zip compressed file. Usually Eclipse (default) java project will be organized like following directory structure: some_project |____ src/ <--- your java source files |____ bin/ <--- compiled class files |____ lib/ <--- 3rd party libs e.g. commons*.jar To package above structure and distribute as a single jar (zip) file- go inside bin/ directory and select everything inside and just right click (assuming you are working on windows) and send to compressed (zipped) folder. Give a suitable name to the generated zip file e.g. your-sdk.jar then right click on lib/ and compress into a another zip together with your-sdk.jar and you are done. This can be accomplished using jar command line tool also- but, you have to read the jar options/help on how

Categories : Java

when i am running gradle project via eclipse i got some exception
It's likely you haven't installed a JDK. Even though you have "jdk1.7", you may have only the runtime environment. You may need to install the "-devel" option for the package, for example, both these would be required: java-1.7.0-openjdk java-1.7.0-openjdk-devel If you can't find the right package, tell us your distro and the exact name of the jdk1.7 package you have so we can help more.

Categories : Java

Two almost similar Android projects having same project structure in eclipse not installing in my phone
You can't install two apps with the same package name: package="com.jungle.main" Change one of them and you'll be fine. See also: http://developer.android.com/guide/topics/manifest/manifest-element.html#package

Categories : Android

no gradle file in eclipse project Android studio
All you need is a simple build.gradle file for your ActionBarSherlock project. Here's one I've created: buildscript { repositories { mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:0.4.2' } } apply plugin: 'android-library' dependencies { compile 'com.android.support:support-v4:13.0.0' } android { buildToolsVersion "17.0" compileSdkVersion 17 sourceSets { main { manifest.srcFile 'AndroidManifest.xml' java.srcDirs = ['src'] resources.srcDirs = ['src'] aidl.srcDirs = ['src'] renderscript.srcDirs = ['src'] res.srcDirs = ['res'] assets.srcDirs = ['assets'] } } }

Categories : Eclipse

Generating eclipse project from android gradle plugin
I feel like my response may be short of a true answer, but hopefully it qualifies under "Any ideas?" Anyhow... It's hard to know without seeing more of the gradle file, but I find the warning gradle is giving you to be quite suspicious. TaskContainer.add() doesn't really jump out at me, but the suggestion does. Please use the cr:eclipseClasspath Now obviously deprecated doesn't automatically mean "this won't work" but gradle is suggesting you use cr:eclipseClasspath and it sounds like you are having issues with the eclipse classpath. It's hard to assume the warning and your issues are not related. Have you done any investigation along that route?

Categories : Android

Create gradle sample project for eclipse (java web)
For those who are interested in I solved this problem in this way http://github.com/pepuch/gradleTemplatesCreator. Project was created for my own usage so it's not clear and finished.

Categories : Java

Is it possible to share library projects between projects when using Android Studio and gradle?
Couldn't you use git with submodules? e.g. In your .gitmodules file, you may add this: [submodule "volley"] path = volley url = https://path/to/volley/repository You can set the url to Volley's official repository, or to your own in-house version of volley. Other projects can be setup the same way and point to the same volley repository. I think this way, other users can call git clone and all the dependent projects will be downloaded within the main project folder and they don't have to worry about downloading the library projects separately. For Volley though, I would just compile it into a JAR file and stick it into the /libs folder of the main project. That is, if you don't need to modify its source. [Update] For library projects that you don't need to modify its source, you ca

Categories : Android

Importing an eclipse project in Android studio. Error with Gradle
You have used Gradle 1.8, as your error mentions, you should use Gradle 1.6. Download it from here http://services.gradle.org/distributions-snapshots

Categories : Android

Gradle flat project with multiple Jars in one project
You mention that some of the components depend on each other, so I am also wondering why you would not want to implement this as a multi-project build. For now, let's assume all of your components are independent Gradle projects. Given that they produce a JAR file, it seems to be a given that they are Java projects. I'd create a build.gradle file for each project. . └── your-project └── component1 │ ├── build.gradle │ └── src └── component2 ├── build.gradle └── src For each of these projects, we will apply the Java plugin. The only difference to the standard conventions introduced by this plugin is that your source files sit in the directory src instead of src/main/java. To configure this, all you need to

Categories : Java

How do I change an external JAR for multiple Eclipse projects at once?
I dont't know a way, but can tell a hack: Open some of your .classpath files (in the root of each project). They probably all contain a <classpathentry> related to your JAR. Add the Javadoc location to one and check the change in the <classpathentry>; it will be something like: <attributes> <attribute name="javadoc_location" value="jar:file:/path/to/javadoc.jar!/"/> </attributes> Mass replace the plain <classpathentry> with the enhanced one; DON'T FORGET TO BACK THINGS UP BEFORE DOING THIS :)

Categories : Java

Running JUnit tests from multiple projects in Eclipse
You can't run the tests for multiple projects in Eclipse, at least using the normal runners. There are, however a number of options: Create an ant/maven script which runs everything If you want to run your tests every time you save, you can use Infinitest. From the site of Infinitest: Infinitest is a Continuous Testing plugin for Eclipse and IntelliJ. Each time a change is made on the source code, Infinitest runs all the tests that might fail because of these changes. Infinitest can potentially run all of the tests in all projects.

Categories : Java

How to get Eclipse show class hierarchy across multiple PHP projects?
You can achieve that by adding MyFramework project files to MySite's PHP Include Paths. Note from Eclipse's help: Note: Adding libraries or external projects elements to your project's Include Path will also make elements defined in these resources available as content assist options. Most major IDEs support PHP Include Paths.

Categories : PHP

Gradle with Eclipse - incomplete .classpath when multiple sourcesets
This was solved in a way that was closely related to a similar question I asked yesterday: // Create a list of all the configuration names for my source sets def ssConfigNames = sourceSets.findAll { ss -> ss.name != "main" }.collect { ss -> "${ss.name}Compile".toString() } // Find configurations matching those of my source sets configurations.findAll { conf -> "${conf.name}".toString() in ssConfigNames }.each { conf -> // Add matching configurations to Eclipse classpath eclipse.classpath { plusConfigurations += conf } } Update: I also asked the same question in the Gradle forums, and got an even better solution: eclipseClasspath.plusConfigurations = configurations.findAll { it.name.endsWith("Runtime") } It is not as precise, in that it adds other st

Categories : Gradle

How to track multiple open source projects inside of a single project with git?
I've gone ahead and added in my first git submodule. Works well! Thannk you James Allardice. I'm using Sourcetree app for managing Git and I couldn't add a subtree, just a submodule. The only problem, the submodule doesn't show me with tracking if there is any new commits on the upstream project, I just have to check those repos every time I start working in Sourcetree app.

Categories : GIT

Change project file structure after migrating from Eclipse to Android Studio gradle structure
While migrating your project from Eclipse to Android Studio, no change have been done on project structure. The only that have changed are new .iml and .gradle files. Your java code stays in project/src/ folder, and has not been moved in project/src/main/java folder (like in a new created project from AndroidStudio). Your AndroidManifest file also stays in the project/ folder and has not been moved in project/src/main/ folder (like in a new created project from AndroidStudio). At migration, the build.gradle file is customized in order to be able to compile with the old structure is described in the gradle documentation : Configuring the Structure For a new created project in AndroidStudio, the sourceSets part of the build.gradle file : sourceSets { main.java.srcDirs = ['src/java']

Categories : Android

Multiple executable jar files with different external dependencies from a single project with sbt-assembly
The concept of Maven profile translates in sbt/Ivy as configuration. You can define settings within a configuration and have sbt-assembly generate two jars. You can add libraryDependency to a specific configuration by adding % "config". This, however requires the project to be aware of the configuration(s) upfront. In build.sbt (requires sbt 0.13.0 or above): import AssemblyKeys._ val Dispatch10 = config("dispatch10") extend(Compile) val TestDispatch10 = config("testdispatch10") extend(Test) val Dispatch11 = config("dispatch11") extend(Compile) val TestDispatch11 = config("testdispatch11") extend(Test) val root = project.in(file(".")). configs(Dispatch10, TestDispatch10, Dispatch11, TestDispatch11). settings( name := "helloworld", organization := "com.eed3si9n", scalaV

Categories : Scala

How do I migrate my Android Eclipse project to using Gradle and Android Studio?
You should create a folder in you project's root and name it libs. Then copy your jar file to that folder and add dependencies { compile fileTree(dir: 'libs', include: '*.jar') } to your build.gradle file. If above won't work. You may need to try this post

Categories : Java

Remote gradle debug on build.gradle file from Eclipse IDE
It's a known limitation that Gradle build scripts can't currently be debugged in IDEs. I'm not aware of the specific error though. Usually the debugger just doesn't stop at the breakpoint (but it will stop at breakpoints for user-defined plugin/task classes and Gradle classes).

Categories : Eclipse

Gradle not able to find dependencies when use build script named anything other than "build.gradle"
-b only works for single-project builds. In multi-project builds, settings.gradle determines which build scripts constitute the build, which project they belong to, and where they are located.

Categories : Android

How should one handle dependencies among Play sub-projects?
After more searching, I came across this blog entry. I'm going to give this a shot and see how it works: http://eng.42go.com/play-framework-dependency-injection-guice/ After using this for a couple of weeks, it's been mostly a success. There are still chicken/egg problems to work out, but I think that's because I hadn't really thought through how much each of my sub-projects depended on others. There's still no really easy way to access routes from parts of projects you don't depend on, but you probably shouldn't be linking to projects you don't depend on, anyway. I did figure out how to specify a main template and urls/calls for things like my "Not Found", "Permission Required", and "Login" pages so that all sub-projects could access them.

Categories : Scala

Tycho and Eclipse: How to resolve OSGI dependencies to my own bundles at development time within Eclipse, without opening all of them in the IDE
As indicated by Nick Wilson, you will need to install the m2e Tycho Configurator, which basically "links up" Eclipse and Tycho (i.e., makes Tycho available in Eclipse). You should've been pointed towards it after having installed m2e, but you can also install it manually: Go to Window > Preferences > Maven > Discovery. Click the "Open Catalog" button. This will open the "m2e Marketplace" window. Search for "tycho", this should give you the "Tycho Configurator" as sole search result. Click "Finish", you're done. I've had this issue as well, and it isn't simple to find the solution, so I hope this helps!

Categories : Eclipse



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.